|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.lightdev.app.fileserver.http.FileSystemSerialiser
public class FileSystemSerialiser
Class FileSystemSerialiser transforms objects of the Light Development File System library to and from byte arrays.
It wraps an instance of class LocalFileSystem and exposes
its methods as methods of same name but with 'neutral' signatures. I.e. method
arguments and return values are deserialised from and serialised to byte arrays.
Objects exchanged by class LocalFileSystem can be used across different
instances of the Java virtual machine this way.
LocalFileSystem| Constructor Summary | |
|---|---|
FileSystemSerialiser()
create a new instance of class FileServer |
|
| Method Summary | |
|---|---|
boolean |
copy(byte[] filesToCopy,
byte[] toDirectory)
copy files to a given folder. |
boolean |
createFolder(byte[] folder)
create a new folder |
boolean |
delete(byte[] filesToDelete)
delete one or more files |
boolean |
extract(byte[] archive,
byte[] toFolder)
extract a given ZIP archive to a given folder |
boolean |
fileExists(byte[] file)
determine whether or not a given file exists in this instance of file system |
byte[] |
getFileSeparator()
get the string that is used to separate file and folder names in path expressions for the machine this file system refers to |
double |
getFolderSize(byte[] folder)
determine the size of a folder in bytes |
byte[] |
getParentFile(byte[] file)
get the file that is directly on top of a given file in the file hierarchy of this file system |
byte[] |
getRoots()
get the root directories of this file system |
double |
getSize(byte[] files)
|
byte[] |
getUrl()
get the url string of the machine this file system is located at |
byte[] |
list(byte[] directory)
get the files that are contained in a given folder |
boolean |
move(byte[] source,
byte[] dest)
move one or more files to a given folder. |
boolean |
pack(byte[] folder,
byte[] archive)
pack the contents of a given folder into a new ZIP compressed archive |
byte[] |
read(byte[] file)
read contents of a file |
byte[] |
rename(byte[] file,
byte[] newName)
rename a file, i.e. change the name of a file but not its location |
boolean |
write(byte[] file,
byte[] contents)
write contents of a file |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FileSystemSerialiser()
| Method Detail |
|---|
public byte[] getParentFile(byte[] file)
throws Exception
file - byte[] a byte array of type FileRef referencing the file to get the parent of
Exception
public byte[] list(byte[] directory)
throws Exception
directory - byte[] of type FileRef referencing the folder to get a list of files of
Exception
public byte[] getRoots()
throws Exception
Exception
public byte[] getFileSeparator()
throws Exception
Exception
public boolean copy(byte[] filesToCopy,
byte[] toDirectory)
throws Exception
filesToCopy - byte array of type FileRef[] with the files to copytoDirectory - byte array of type FileRef with the directory to copy to
Exception
public byte[] rename(byte[] file,
byte[] newName)
throws Exception
file - byte array of type FileRef with the file to renamenewName - byte array of type String with the new name; just the name, no path
Exception
public boolean move(byte[] source,
byte[] dest)
throws Exception
source - byte array of type fileRef[] with the files to movedest - byte array of type FileRef with the folder to move to
Exception
public boolean delete(byte[] filesToDelete)
throws Exception
filesToDelete - byte array of type FileRef[] with the list of files to delete
Exception
public boolean pack(byte[] folder,
byte[] archive)
throws Exception
folder - byte array of type FileRef with the folder to packarchive - byte array of type FileRef with the archive to create from the given files
Exception
public boolean extract(byte[] archive,
byte[] toFolder)
throws Exception
archive - byte array of type FileRef with the archive to extracttoFolder - byte array of type FileRef with the folder to extract
the contents of the archive to
Exception
public boolean createFolder(byte[] folder)
throws Exception
folder - byte array of type FileRef with the folder to create
Exception
public boolean fileExists(byte[] file)
throws Exception
file - byte array of type FileRef with the file to determine existence for
Exception
public double getFolderSize(byte[] folder)
throws Exception
folder - byte array of type FileRef with the folder to determine the size for
Exception
public double getSize(byte[] files)
throws Exception
Exception
public byte[] getUrl()
throws Exception
Exception
public byte[] read(byte[] file)
throws Exception
file - byte array of type FileRef with the reference to the file to read
Exception
public boolean write(byte[] file,
byte[] contents)
throws Exception
file - byte array of type FileRef with the reference to the file to writecontents - the contents to write to the referenced file
Exception
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||