org.jppf.server.protocol
Class URLLocation
java.lang.Object
org.jppf.server.protocol.AbstractLocation<URL>
org.jppf.server.protocol.URLLocation
- All Implemented Interfaces:
- Serializable, Location<URL>
public class URLLocation
- extends AbstractLocation<URL>
Wrapper for manipulating data from a URL.
- Author:
- Laurent Cohen
- See Also:
- Serialized Form
|
Constructor Summary |
URLLocation(String url)
Initialize this location with the specified file path. |
URLLocation(URL url)
Initialize this location with the specified file path. |
|
Method Summary |
InputStream |
getInputStream()
Obtain an input stream to read from this location. |
OutputStream |
getOutputStream()
Obtain an output stream to write to this location. |
long |
size()
This method always returns -1, as there is no reliable way to know the actual size of available data. |
URLLocation
public URLLocation(URL url)
- Initialize this location with the specified file path.
- Parameters:
url - a URL.
URLLocation
public URLLocation(String url)
throws MalformedURLException
- Initialize this location with the specified file path.
- Parameters:
url - a URL in string format.
- Throws:
MalformedURLException - if the url is malformed.
getInputStream
public InputStream getInputStream()
throws Exception
- Obtain an input stream to read from this location.
- Returns:
- an
InputStream instance.
- Throws:
Exception - if an I/O error occurs.- See Also:
Location.getInputStream()
getOutputStream
public OutputStream getOutputStream()
throws Exception
- Obtain an output stream to write to this location.
- Returns:
- an
OutputStream instance.
- Throws:
Exception - if an I/O error occurs.- See Also:
Location.getOutputStream()
size
public long size()
- This method always returns -1, as there is no reliable way to know the actual size of available data.
- Returns:
- -1.
- See Also:
Location.size()
Copyright © 2005-2010 JPPF Team.