Package org.cytoscape.io.util
Interface StreamUtil
-
public interface StreamUtilA 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-apiTo 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 StringURL_PATTERN
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description InputStreamgetInputStream(String source)Gets the input stream from given a string.InputStreamgetInputStream(URL source)Gets the input stream from givenURL.URLConnectiongetURLConnection(URL source)Obtain aURLConnectionfor 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 aURLConnectionfor 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
-
-