|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.sitemesh.offline.directory.InMemoryDirectory
public class InMemoryDirectory
Simple Directory implementation that stores contents in memory.
Can be useful for testing or providing an intermediate input/output for processing.
| Constructor Summary | |
|---|---|
InMemoryDirectory()
|
|
InMemoryDirectory(Charset encoding)
|
|
| Method Summary | |
|---|---|
void |
copy(String path,
Directory destinationDirectory,
String destinationPath)
Copy a file from this directory to another location. |
List<String> |
listAllFilePaths()
Get a list of all file paths (relative to the Directory). |
CharBuffer |
load(String path)
Load the contents from a file. |
void |
load(String path,
WritableByteChannel channelToWriteTo)
Load binary data. |
void |
save(String path,
CharBuffer contents)
Save the contents to a file, overwriting any existing content. |
void |
save(String path,
ReadableByteChannel channelToReadFrom,
int length)
Save binary data. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public InMemoryDirectory()
public InMemoryDirectory(Charset encoding)
| Method Detail |
|---|
public CharBuffer load(String path)
throws IOException
Directory
load in interface DirectoryIOException
public void save(String path,
CharBuffer contents)
throws IOException
Directory
save in interface DirectoryIOException
public List<String> listAllFilePaths()
throws IOException
Directory
listAllFilePaths in interface DirectoryIOException
public void load(String path,
WritableByteChannel channelToWriteTo)
throws IOException
Directory
load in interface DirectoryIOException
public void save(String path,
ReadableByteChannel channelToReadFrom,
int length)
throws IOException
Directory
save in interface DirectoryIOException
public void copy(String path,
Directory destinationDirectory,
String destinationPath)
throws IOException
Directory
copy in interface Directorypath - Path of file to copy (from this Directory)destinationDirectory - Target directory (may be this)destinationPath - Path under target directory.
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||