Constructor and Description |
---|
InMemoryDirectory() |
InMemoryDirectory(Charset encoding) |
Modifier and Type | Method and Description |
---|---|
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.
|
public InMemoryDirectory()
public InMemoryDirectory(Charset encoding)
public CharBuffer load(String path) throws IOException
Directory
load
in interface Directory
IOException
public void save(String path, CharBuffer contents) throws IOException
Directory
save
in interface Directory
IOException
public List<String> listAllFilePaths() throws IOException
Directory
listAllFilePaths
in interface Directory
IOException
public void load(String path, WritableByteChannel channelToWriteTo) throws IOException
Directory
load
in interface Directory
IOException
public void save(String path, ReadableByteChannel channelToReadFrom, int length) throws IOException
Directory
save
in interface Directory
IOException
public void copy(String path, Directory destinationDirectory, String destinationPath) throws IOException
Directory
copy
in interface Directory
path
- Path of file to copy (from this Directory)destinationDirectory
- Target directory (may be this)destinationPath
- Path under target directory.IOException
Copyright © 2015. All Rights Reserved.