Package org.cytoscape.io.util
Interface StreamUtil
-
public interface StreamUtil
A stateless utility class that provides special handling to support InputStreams and URLConnections over the network. If you intend to support the use of proxy servers, you should use this service.Module:
io-api
To use this in your app, include the following dependency in your POM:
<dependency> <groupId>org.cytoscape</groupId> <artifactId>io-api</artifactId> </dependency>
Cytoscape Backwards Compatibility (API Interface): We expect that this interface will be used but not implemented by developers using this interface. As such, we reserve the right to add methods to the interface as part of minor version upgrades. We will not remove methods for any changes other than major version upgrades.
-
-
Field Summary
Fields Modifier and Type Field Description static String
URL_PATTERN
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description InputStream
getInputStream(String source)
Gets the input stream from given a string.InputStream
getInputStream(URL source)
Gets the input stream from givenURL
.URLConnection
getURLConnection(URL source)
Obtain aURLConnection
for a givenURL
.
-
-
-
Field Detail
-
URL_PATTERN
static final String URL_PATTERN
- See Also:
- Constant Field Values
-
-
Method Detail
-
getInputStream
InputStream getInputStream(String source) throws IOException
Gets the input stream from given a string. Attempts to determine if the string is a URL or a File and then creates the appropriate InputStream. Proxy will be used if available.- Parameters:
source
- The string from which to generate the InputStream.- Returns:
- An input stream from the specified string.
- Throws:
IOException
-
getInputStream
InputStream getInputStream(URL source) throws IOException
Gets the input stream from givenURL
. Proxy will be used if available.- Parameters:
source
- The URL from which to generate the InputStream.- Returns:
- An input stream from the specified URL.
- Throws:
IOException
-
getURLConnection
URLConnection getURLConnection(URL source) throws IOException
Obtain aURLConnection
for a givenURL
. Proxy will be used if available.- Parameters:
source
- The URL from which to generate the URLConnection.- Returns:
- An URLConnection from the specified URL.
- Throws:
IOException
-
-