|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mockftpserver.fake.filesystem.AbstractFileSystemEntry
org.mockftpserver.fake.filesystem.FileEntry
public class FileEntry
File system entry representing a file
| Constructor Summary | |
|---|---|
FileEntry()
Construct a new instance without setting its path |
|
FileEntry(String path)
Construct a new instance with the specified value for its path |
|
FileEntry(String path,
String contents)
Construct a new instance with the specified path and file contents |
|
| Method Summary | |
|---|---|
FileSystemEntry |
cloneWithNewPath(String path)
Return a new FileSystemEntry that is a clone of this object, except having the specified path |
InputStream |
createInputStream()
Create and return an InputStream for reading the contents of the file represented by this entry |
OutputStream |
createOutputStream(boolean append)
Create and return an OutputStream for writing the contents of the file represented by this entry |
long |
getSize()
Return the size of this file |
boolean |
isDirectory()
Return false to indicate that this entry represents a file |
void |
setContents(byte[] contents)
Set the contents of the file represented by this entry |
void |
setContents(String contents)
Set the contents of the file represented by this entry |
String |
toString()
|
| Methods inherited from class org.mockftpserver.fake.filesystem.AbstractFileSystemEntry |
|---|
getGroup, getLastModified, getName, getOwner, getPath, getPermissions, lockPath, setGroup, setLastModified, setOwner, setPath, setPermissions, setPermissionsFromString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public FileEntry()
public FileEntry(String path)
path - - the value for path
public FileEntry(String path,
String contents)
path - - the value for pathcontents - - the contents of the file, as a String| Method Detail |
|---|
public boolean isDirectory()
isDirectory in interface FileSystemEntryisDirectory in class AbstractFileSystemEntrypublic long getSize()
public void setContents(String contents)
contents - - the String whose bytes are used as the contentspublic void setContents(byte[] contents)
contents - - the byte[] used as the contentspublic InputStream createInputStream()
public OutputStream createOutputStream(boolean append)
append - - true if the OutputStream should append to any existing contents false if
any existing contents should be overwritten
FileSystemException - - if an error occurs creating or initializing the OutputStreampublic FileSystemEntry cloneWithNewPath(String path)
path - - the new path value for the cloned file system entry
public String toString()
toString in class ObjectObject.toString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||