|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.binaryfantasy.murq.source.MemorySource
public class MemorySource
A ISource implementation intended for testing purposes only. As the
name implies, content streamed to this source is held in memory only.
| Constructor Summary | |
|---|---|
MemorySource()
Default constructor. |
|
| Method Summary | |
|---|---|
void |
close()
Called when a source is no longer to be used and provides a chance for clean up and release of resources. |
InputStream |
getInputStream(String key)
Returns a stream to read the content specified by the key,
or null if no content is associated with the
key. |
Set<String> |
getKeys()
Returns a Set of all current keys in this source, or an
empty Set if there are none. |
OutputStream |
getOutputStream(String key)
Returns a stream to write the content associated with the key. |
boolean |
remove(String key)
Returns true if the content mapped to the provided
key was removed, false if no content is
associated with the key. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public MemorySource()
| Method Detail |
|---|
public void close()
throws IOException
ISource
close in interface ISourceIOException - if there is a problem during closing.
public Set<String> getKeys()
throws IOException
ISourceSet of all current keys in this source, or an
empty Set if there are none.
getKeys in interface ISourceSet of all current keys in this source, or an
empty Set if there are none.
IOException - if there is a problem reading the keys.
public boolean remove(String key)
throws IOException
ISourcetrue if the content mapped to the provided
key was removed, false if no content is
associated with the key.
remove in interface ISourcekey - unique value associated with the content.
true if the content mapped to the provided
key was removed, false if no
content is associated with the key.
IOException - if an error occurred while trying to remove the content.
public InputStream getInputStream(String key)
throws IOException
ISourcekey,
or null if no content is associated with the
key.
getInputStream in interface ISourcekey - unique value associated with the content.
key,
or null if no content is associated with the
key.
IOException - if there is an error while getting the content stream for
reading.
public OutputStream getOutputStream(String key)
throws IOException
ISourcekey.
getOutputStream in interface ISourcekey - unique value associated with the content.
key.
IOException - if there is an error while getting the content stream for
writing.public String toString()
toString in class Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||