Class RecordableURL
java.lang.Object
com.easypost.easyvcr.clients.httpurlconnection.RecordableURL
A recordable URL, wrapper for RecordableHttpURLConnection and RecordableHttpsURLConnection.
-
Constructor Summary
ConstructorsConstructorDescriptionRecordableURL(String spec, Cassette cassette, Mode mode)Constructs a new recordable URL.RecordableURL(String spec, Cassette cassette, Mode mode, AdvancedSettings advancedSettings)Constructs a new recordable URL.Constructs a new recordable URL.RecordableURL(String protocol, String host, int port, String file, Cassette cassette, Mode mode, AdvancedSettings advancedSettings)Constructs a new recordable URL.RecordableURL(String protocol, String host, int port, String file, URLStreamHandler handler, Cassette cassette, Mode mode)Constructs a new recordable URL.RecordableURL(String protocol, String host, int port, String file, URLStreamHandler handler, Cassette cassette, Mode mode, AdvancedSettings advancedSettings)Constructs a new recordable URL.Constructs a new recordable URL.RecordableURL(String protocol, String host, String file, Cassette cassette, Mode mode, AdvancedSettings advancedSettings)Constructs a new recordable URL.RecordableURL(URL context, Cassette cassette, Mode mode)Constructs a new recordable URL.RecordableURL(URL context, Cassette cassette, Mode mode, AdvancedSettings advancedSettings)Constructs a new recordable URL.RecordableURL(URL context, String spec, Cassette cassette, Mode mode)Constructs a new recordable URL.RecordableURL(URL context, String spec, Cassette cassette, Mode mode, AdvancedSettings advancedSettings)Constructs a new recordable URL.RecordableURL(URL context, String spec, URLStreamHandler handler, Cassette cassette, Mode mode)Constructs a new recordable URL.RecordableURL(URL context, String spec, URLStreamHandler handler, Cassette cassette, Mode mode, AdvancedSettings advancedSettings)Constructs a new recordable URL. -
Method Summary
Modifier and TypeMethodDescriptionOpen an HTTP connection to the URL.openConnection(Proxy proxy)Open an HTTP connection to the URL.Open an HTTPS connection to the URL.openConnectionSecure(Proxy proxy)Open an HTTPS connection to the URL.
-
Constructor Details
-
RecordableURL
public RecordableURL(String protocol, String host, int port, String file, URLStreamHandler handler, Cassette cassette, Mode mode, AdvancedSettings advancedSettings) throws MalformedURLExceptionConstructs a new recordable URL.- Parameters:
protocol- The protocol of the URL.host- The host of the URL.port- The port of the URL.file- The file of the URL.handler- The URLStreamHandler of the URL.cassette- The cassette used by this recordable URL.mode- The VCR mode used by this recordable URL.advancedSettings- The advanced settings used by this recordable URL.- Throws:
MalformedURLException- If the URL is malformed.
-
RecordableURL
public RecordableURL(String protocol, String host, int port, String file, URLStreamHandler handler, Cassette cassette, Mode mode) throws MalformedURLExceptionConstructs a new recordable URL.- Parameters:
protocol- The protocol of the URL.host- The host of the URL.port- The port of the URL.file- The file of the URL.handler- The URLStreamHandler of the URL.cassette- The cassette used by this recordable URL.mode- The VCR mode used by this recordable URL.- Throws:
MalformedURLException- If the URL is malformed.
-
RecordableURL
public RecordableURL(String protocol, String host, int port, String file, Cassette cassette, Mode mode, AdvancedSettings advancedSettings) throws MalformedURLExceptionConstructs a new recordable URL.- Parameters:
protocol- The protocol of the URL.host- The host of the URL.port- The port of the URL.file- The file of the URL.cassette- The cassette used by this recordable URL.mode- The VCR mode used by this recordable URL.advancedSettings- The advanced settings used by this recordable URL.- Throws:
MalformedURLException- If the URL is malformed.
-
RecordableURL
public RecordableURL(String protocol, String host, int port, String file, Cassette cassette, Mode mode) throws MalformedURLExceptionConstructs a new recordable URL.- Parameters:
protocol- The protocol of the URL.host- The host of the URL.port- The port of the URL.file- The file of the URL.cassette- The cassette used by this recordable URL.mode- The VCR mode used by this recordable URL.- Throws:
MalformedURLException- If the URL is malformed.
-
RecordableURL
public RecordableURL(String protocol, String host, String file, Cassette cassette, Mode mode, AdvancedSettings advancedSettings) throws MalformedURLExceptionConstructs a new recordable URL.- Parameters:
protocol- The protocol of the URL.host- The host of the URL.file- The file of the URL.cassette- The cassette used by this recordable URL.mode- The VCR mode used by this recordable URL.advancedSettings- The advanced settings used by this recordable URL.- Throws:
MalformedURLException- If the URL is malformed.
-
RecordableURL
public RecordableURL(String protocol, String host, String file, Cassette cassette, Mode mode) throws MalformedURLExceptionConstructs a new recordable URL.- Parameters:
protocol- The protocol of the URL.host- The host of the URL.file- The file of the URL.cassette- The cassette used by this recordable URL.mode- The VCR mode used by this recordable URL.- Throws:
MalformedURLException- If the URL is malformed.
-
RecordableURL
public RecordableURL(URL context, String spec, URLStreamHandler handler, Cassette cassette, Mode mode, AdvancedSettings advancedSettings) throws MalformedURLExceptionConstructs a new recordable URL.- Parameters:
context- The URL of the URL.spec- The spec of the URL.handler- The URLStreamHandler of the URL.cassette- The cassette used by this recordable URL.mode- The VCR mode used by this recordable URL.advancedSettings- The advanced settings used by this recordable URL.- Throws:
MalformedURLException- If the URL is malformed.
-
RecordableURL
public RecordableURL(URL context, String spec, URLStreamHandler handler, Cassette cassette, Mode mode) throws MalformedURLExceptionConstructs a new recordable URL.- Parameters:
context- The URL of the URL.spec- The spec of the URL.handler- The URLStreamHandler of the URL.cassette- The cassette used by this recordable URL.mode- The VCR mode used by this recordable URL.- Throws:
MalformedURLException- If the URL is malformed.
-
RecordableURL
public RecordableURL(String spec, Cassette cassette, Mode mode, AdvancedSettings advancedSettings) throws MalformedURLExceptionConstructs a new recordable URL.- Parameters:
spec- The spec of the URL.cassette- The cassette used by this recordable URL.mode- The VCR mode used by this recordable URL.advancedSettings- The advanced settings used by this recordable URL.- Throws:
MalformedURLException- If the URL is malformed.
-
RecordableURL
Constructs a new recordable URL.- Parameters:
spec- The spec of the URL.cassette- The cassette used by this recordable URL.mode- The VCR mode used by this recordable URL.- Throws:
MalformedURLException- If the URL is malformed.
-
RecordableURL
public RecordableURL(URL context, String spec, Cassette cassette, Mode mode, AdvancedSettings advancedSettings) throws MalformedURLExceptionConstructs a new recordable URL.- Parameters:
context- The URL of the URL.spec- The spec of the URL.cassette- The cassette used by this recordable URL.mode- The VCR mode used by this recordable URL.advancedSettings- The advanced settings used by this recordable URL.- Throws:
MalformedURLException- If the URL is malformed.
-
RecordableURL
public RecordableURL(URL context, String spec, Cassette cassette, Mode mode) throws MalformedURLExceptionConstructs a new recordable URL.- Parameters:
context- The URL of the URL.spec- The spec of the URL.cassette- The cassette used by this recordable URL.mode- The VCR mode used by this recordable URL.- Throws:
MalformedURLException- If the URL is malformed.
-
RecordableURL
public RecordableURL(URL context, Cassette cassette, Mode mode, AdvancedSettings advancedSettings) throws MalformedURLExceptionConstructs a new recordable URL.- Parameters:
context- The URL of the URL.cassette- The cassette used by this recordable URL.mode- The VCR mode used by this recordable URL.advancedSettings- The advanced settings used by this recordable URL.- Throws:
MalformedURLException- If the URL is malformed.
-
RecordableURL
Constructs a new recordable URL.- Parameters:
context- The URL of the URL.cassette- The cassette used by this recordable URL.mode- The VCR mode used by this recordable URL.- Throws:
MalformedURLException- If the URL is malformed.
-
-
Method Details
-
openConnection
public RecordableHttpURLConnection openConnection() throws IOException, RecordingExpirationExceptionOpen an HTTP connection to the URL.- Returns:
- a RecordableHttpURLConnection instance.
- Throws:
IOException- if an I/O error occurs.RecordingExpirationException
-
openConnection
public RecordableHttpURLConnection openConnection(Proxy proxy) throws IOException, RecordingExpirationExceptionOpen an HTTP connection to the URL.- Parameters:
proxy- the proxy to use.- Returns:
- a RecordableHttpURLConnection instance.
- Throws:
IOException- if an I/O error occurs.RecordingExpirationException
-
openConnectionSecure
public RecordableHttpsURLConnection openConnectionSecure() throws IOException, RecordingExpirationExceptionOpen an HTTPS connection to the URL.- Returns:
- a RecordableHttpsURLConnection instance.
- Throws:
IOException- if an I/O error occurs.RecordingExpirationException
-
openConnectionSecure
public RecordableHttpsURLConnection openConnectionSecure(Proxy proxy) throws IOException, RecordingExpirationExceptionOpen an HTTPS connection to the URL.- Parameters:
proxy- the proxy to use.- Returns:
- a RecordableHttpsURLConnection instance.
- Throws:
IOException- if an I/O error occurs.RecordingExpirationException
-