|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
T - the type of this location.public interface Location<T>
Abstraction of a block of data no matter how its actual location is referred to.
The idea is to enable I/O operations with a very simple API between Location instances,
for instance bettween a URL and File locations to download a file from the internet and save it locally.
| Method Summary | |
|---|---|
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. |
| Method Detail |
|---|
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.
|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||