|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.zipxap.vfs.VFSRepository
public class VFSRepository
This class represents the Virtual-File-System equivalent of a java.io.File being used as a directory. The virtual file system is different from the underlying java API in that a java.io.File can represent both a file and a directory. In the VFS, a VFSFile can only represent a file, and a VFSRepository can only represent a directory. The VFSRepository is analogous to a java.io.File being used as a directory.
| Milestone | Who | Date, Time |
|---|---|---|
| Initial Version | K Penrose | June 2009 |
** Note that this table is not intended as an exhaustive list of subtle changes. It is intended to list changes that break the compatibility of older code, or major enhancements/rewrites
| Method Summary | |
|---|---|
java.util.List<java.lang.String> |
addRecursive(java.io.File file,
boolean overwriteExisting)
This method adds the file/directory (recursively) to the Document Manager, creating Documents/Repositories as appropriate. |
boolean |
containsFile(java.lang.String filePath)
Determine if this repository contains a document with the specified path. |
VFSRepository |
createRepository(java.lang.String repositoryName)
Create a repository with the specified name |
VFSRepository |
createRepository(java.lang.String repositoryName,
boolean createRecursive)
Create a repository with the specified name or (if createRecursive is true), path. |
void |
delete()
Delete this repository. |
void |
deleteAll()
Deletes this repository and all documents and repositories it contains, recursively, including deletion of all associated history items. |
void |
deleteFile(java.lang.String fileName)
Deletes the file with the specified name. |
void |
deleteFile(VFSFile file)
Delete the specified file from the repository. |
ValuePair<java.lang.Integer,java.lang.Integer> |
extractToFileSystemInternal(java.io.File outputDirectory,
boolean recursive)
Be careful because this method overwrites existing files if they are there. |
long |
getCreated()
|
java.lang.String |
getCreatedId()
|
VFSFile |
getFile(java.lang.String filePath)
Retrieve the file with the specified name. |
int |
getFileCount()
|
VFSFile[] |
getFiles()
|
long |
getLastModified()
|
java.lang.String |
getLastModifiedId()
|
java.lang.String |
getName()
|
java.io.OutputStream |
getOutputStream(java.lang.String fileName)
Retrieve the OutputStream of the VFSFile associated with the specified fileName. |
java.io.OutputStream |
getOutputStream(java.lang.String fileName,
boolean overwriteExisting)
Retrieve the OutputStream of the VFSFile associated with the specified fileName. |
java.lang.String |
getOwnerId()
|
VFSRepository |
getParent()
|
java.lang.String |
getPath()
|
VFSRepository[] |
getRepositories()
|
VFSRepository |
getRepository(int repositoryIdx)
|
VFSRepository |
getRepository(java.lang.String repositoryPath)
Get the VFSRepository at the specified path. |
int |
getRepositoryCount()
|
Entry |
getUnderlyingEntry()
|
VirtualFileSystem |
getVirtualFileSystem()
|
boolean |
isFileCollisionUponExtract(java.io.File outputDirectory,
boolean recursive)
Determine if performing an extractToFileSystem() will cause files to be overwritten in the specified output directory. |
void |
move(VFSRepository newParent)
Move this repository to the specified parent repository. |
void |
moveFile(VFSFile file,
VFSRepository newParent)
Move this repository to the specified parent repository. |
void |
registerChildFile(VFSFile file)
This should not be called by users of this API. |
void |
registerChildRepository(VFSRepository rep)
This should not be called by users of this API. |
void |
rename(java.lang.String newName)
Rename this repository to the specified newName. |
VFSFile |
saveFile(java.lang.String fileName,
byte[] content)
Save a file to this repository. |
VFSFile |
saveFile(java.lang.String fileName,
byte[] content,
boolean overwriteExisting)
Save a file to this repository. |
VFSFile |
saveFile(java.lang.String fileName,
java.io.File fileSystemFile)
Save the contents of the specified fileSystemFile to this repository using the specified fileName. |
VFSFile |
saveFile(java.lang.String fileName,
java.io.File fileSystemFile,
boolean overwriteExisting)
Save the contents of the specified fileSystemFile to this repository using the specified fileName. |
VFSFile |
saveFile(java.lang.String fileName,
java.io.InputStream inputStream)
Save the contents of the specified inputStream to this repository using the specified fileName. |
VFSFile |
saveFile(java.lang.String fileName,
java.io.InputStream inputStream,
boolean overwriteExisting)
Save the contents of the specified inputStream to this repository using the specified fileName. |
VFSFile |
saveFile(java.lang.String filename,
java.util.List<java.lang.Object> beansToSerialize)
This method performs bean serialization using the JavabeanSerializer |
VFSFile |
saveFile(java.lang.String fileName,
java.io.Reader reader)
Save the contents of the specified Reader to this repository using the specified fileName. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public VFSFile[] getFiles()
public VirtualFileSystem getVirtualFileSystem()
public java.lang.String getPath()
public java.lang.String getName()
public VFSFile saveFile(java.lang.String fileName,
byte[] content)
fileName - The name of the document, with no path information
UCException - if the specified fileName contains path information ('/'), or
if the fileName does not represent a valid file, or if
a file already exists in this repository with the specified fileName.
public VFSFile saveFile(java.lang.String fileName,
byte[] content,
boolean overwriteExisting)
fileName - The name of the document, with no path information
UCException - if the specified fileName contains path information ('/'), or
if the fileName does not represent a valid file, or if
a file already exists in this repository with the specified fileName and
the overwriteExisting argument was set to False.
public VFSFile saveFile(java.lang.String fileName,
java.io.File fileSystemFile)
fileName - The name of the document, with no path information
UCException - if the specified fileName contains path information ('/'), or
if the fileName does not represent a valid file, or if
a file already exists in this repository with the specified fileName.
public VFSFile saveFile(java.lang.String fileName,
java.io.File fileSystemFile,
boolean overwriteExisting)
fileName - The name of the document, with no path information
UCException - if the specified fileName contains path information ('/'), or
if the fileName does not represent a valid file, or if
a file already exists in this repository with the specified fileName and
the overwriteExisting argument was set to False.
public VFSFile saveFile(java.lang.String fileName,
java.io.InputStream inputStream)
fileName - The name of the document, with no path informationinputStream -
UCException - if the specified fileName contains path information ('/'), or
if the fileName does not represent a valid file, or if
a file already exists in this repository with the specified fileName.
public VFSFile saveFile(java.lang.String fileName,
java.io.InputStream inputStream,
boolean overwriteExisting)
fileName - The name of the document, with no path informationinputStream -
UCException - if the specified fileName contains path information ('/'), or
if the fileName does not represent a valid file, or if
a file already exists in this repository with the specified fileName and
the overwriteExisting argument was set to False.public java.io.OutputStream getOutputStream(java.lang.String fileName)
fileName -
UCException - if the specified fileName contains path information ('/'), or
if the fileName does not represent a valid file, or if
a file already exists in this repository with the specified fileName and
the overwriteExisting argument was set to False.
public java.io.OutputStream getOutputStream(java.lang.String fileName,
boolean overwriteExisting)
fileName - overwriteExisting -
UCException - if the specified fileName contains path information ('/'), or
if the fileName does not represent a valid file, or if
a file already exists in this repository with the specified fileName and
the overwriteExisting argument was set to False.
public VFSFile saveFile(java.lang.String fileName,
java.io.Reader reader)
fileName - The name of the document, with no path informationreader -
UCException - if the specified fileName contains path information ('/'), or
if the fileName does not represent a valid file, or if
a file already exists in this repository with the specified fileName.
public VFSFile saveFile(java.lang.String filename,
java.util.List<java.lang.Object> beansToSerialize)
filename - beans -
public java.util.List<java.lang.String> addRecursive(java.io.File file,
boolean overwriteExisting)
file -
public boolean containsFile(java.lang.String filePath)
filePath - The name of the document, with or without relative or absolute path information.
true if this repository contains a document with the specified pathpublic VFSRepository createRepository(java.lang.String repositoryName)
repositoryName -
public VFSRepository createRepository(java.lang.String repositoryName,
boolean createRecursive)
repositoryName - createRecursive - If set to true, then path separator ('/') is valid, and will be used to
create sub-repositories.
public void delete()
UCException - if this repository contains any files or sub-repositories.public void deleteAll()
public void deleteFile(java.lang.String fileName)
fileName - public void deleteFile(VFSFile file)
file -
public ValuePair<java.lang.Integer,java.lang.Integer> extractToFileSystemInternal(java.io.File outputDirectory,
boolean recursive)
outputDirectory - recursive - Specifies whether or not to extract repositories recursively.
public VFSFile getFile(java.lang.String filePath)
filePath - The name of the document, with or without relative or absolute path information.
Example: /myrepository/mysubrepository/mydocument.txt
public int getFileCount()
public VFSRepository[] getRepositories()
public VFSRepository getRepository(java.lang.String repositoryPath)
repositoryPath -
public int getRepositoryCount()
public boolean isFileCollisionUponExtract(java.io.File outputDirectory,
boolean recursive)
outputDirectory -
true if performing an extractToFileSystem() will
cause files to be overwritten in the specified output directory, else falsepublic void move(VFSRepository newParent)
newParent -
public void moveFile(VFSFile file,
VFSRepository newParent)
newParent - public void rename(java.lang.String newName)
newName - public Entry getUnderlyingEntry()
public java.lang.String getOwnerId()
public long getCreated()
public java.lang.String getCreatedId()
public long getLastModified()
public java.lang.String getLastModifiedId()
public VFSRepository getRepository(int repositoryIdx)
public void registerChildRepository(VFSRepository rep)
rep - public void registerChildFile(VFSFile file)
file - public VFSRepository getParent()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||