T - the type of this location.public interface Location<T>
The idea is to enable I/O operations with a very simple API between Location instances,
for instance between a URL and File locations to download a file from the internet and save it locally.
| Modifier and Type | Method and Description |
|---|---|
void |
addLocationEventListener(LocationEventListener listener)
Add a listener to the list of location event listeners for this location.
|
void |
copyTo(Location location)
Copy the content at this location to another location.
|
InputStream |
getInputStream()
Obtain an input stream to read from this location.
|
OutputStream |
getOutputStream()
Obtain an output stream to write to this location.
|
T |
getPath()
Get the path for this location.
|
void |
removeLocationEventListener(LocationEventListener listener)
Remove a listener from the list of location event listeners for this location.
|
long |
size()
Get the size of the data this location points to.
|
byte[] |
toByteArray()
Get the content at this location as an array of bytes.
|
T getPath()
InputStream getInputStream() throws Exception
InputStream instance.Exception - if an I/O error occurs.OutputStream getOutputStream() throws Exception
OutputStream instance.Exception - if an I/O error occurs.void copyTo(Location location) throws Exception
location - the location to copy to.Exception - if an I/O error occurs.long size()
byte[] toByteArray()
throws Exception
Exception - if an I/O error occurs.void addLocationEventListener(LocationEventListener listener)
listener - the listener to add to the list.NullPointerException - if the listener object is null.void removeLocationEventListener(LocationEventListener listener)
listener - the listener to remove from the list.NullPointerException - if the listener object is null.Copyright © 2005-2012 JPPF Team.