|
RSE Release 3.2 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ISystemArchiveHandler
An interface that allows implementing classes to create their own handlers for various types of archive files, ie: zip, jar, tar, rpm.
Method Summary | |
---|---|
void |
add(File[] files,
String virtualPath,
String[] names,
ISystemOperationMonitor archiveOperationMonitor)
A generalization of the add method. |
void |
add(File[] files,
String virtualPath,
String[] names,
String[] sourceEncodings,
String[] targetEncodings,
boolean[] isText,
ISystemOperationMonitor archiveOperationMonitor)
A generalization of the add method. |
void |
add(File file,
String virtualPath,
String name,
ISystemOperationMonitor archiveOperationMonitor)
Compresses the file file and adds it to the archive, placing
it in the virtual directory virtualPath . |
void |
add(File file,
String virtualPath,
String name,
String sourceEncoding,
String targetEncoding,
boolean isText,
ISystemOperationMonitor archiveOperationMonitor)
Compresses the file file and adds it to the archive, saving
it in the encoding specified by encoding if the isText is
true. placing it in the virtual directory virtualPath . |
void |
add(File file,
String virtualPath,
String name,
String sourceEncoding,
String targetEncoding,
ISystemFileTypes typeRegistery,
ISystemOperationMonitor archiveOperationMonitor)
Compresses the file file and adds it to the archive, saving
it in the encoding specified by encoding if the isText is
true. placing it in the virtual directory virtualPath . |
void |
add(InputStream stream,
String virtualPath,
String name,
String sourceEncoding,
String targetEncoding,
boolean isText,
ISystemOperationMonitor archiveOperationMonitor)
Compresses the bytes in the InputStream stream and adds them
as an entry to the archive, saving them in the encoding specified by
encoding if isText is true, and placing it in
the virtual directory virtualPath . |
void |
create()
Turns the archive that this handler represents into a new, empty archive. |
void |
createFile(String fullVirtualName,
ISystemOperationMonitor archiveOperationMonitor)
Creates a new, empty file in the archive. |
void |
createFolder(String fullVirtualName,
ISystemOperationMonitor archiveOperationMonitor)
Creates a new, empty folder in the archive. |
boolean |
delete(String fullVirtualName,
ISystemOperationMonitor archiveOperationMonitor)
Deletes the entry fullVirtualName from the archive, and
returns whether or not the deletion was successful. |
boolean |
exists()
Check if the archive handler implementation associated with this class exists. |
boolean |
exists(String fullVirtualName,
ISystemOperationMonitor archiveOperationMonitor)
Check whether a given virtual node exists in an archive. |
void |
extractVirtualDirectory(String dir,
File destinationParent,
File destination,
ISystemOperationMonitor archiveOperationMonitor)
Extracts the directory dir (and its children) from the
archive and places the results in the directory
destinationParent . |
void |
extractVirtualDirectory(String dir,
File destinationParent,
File destination,
String sourceEncoding,
boolean isText,
ISystemOperationMonitor archiveOperationMonitor)
Extracts the directory dir (and its children) from the
archive and places the results in the directory
destinationParent . |
void |
extractVirtualDirectory(String dir,
File destinationParent,
ISystemOperationMonitor archiveOperationMonitor)
Extracts the directory dir (and its children) from the
archive and places the results in the directory
destinationParent . |
void |
extractVirtualDirectory(String dir,
File destinationParent,
String sourceEncoding,
boolean isText,
ISystemOperationMonitor archiveOperationMonitor)
Extracts the directory dir (and its children) from the
archive and places the results in the directory
destinationParent . |
void |
extractVirtualFile(String fullVirtualName,
File destination,
ISystemOperationMonitor archiveOperationMonitor)
Extracts the virtual file named fullVirtualName from the
archive, placing the results in destination . |
void |
extractVirtualFile(String fullVirtualName,
File destination,
String sourceEncoding,
boolean isText,
ISystemOperationMonitor archiveOperationMonitor)
Extracts the virtual file named fullVirtualName from the
archive, placing the results in destination . |
void |
fullRename(String fullVirtualName,
String newFullVirtualName,
ISystemOperationMonitor archiveOperationMonitor)
Replaces the full name and path of the entry fullVirtualName
with the new full name and path newFullVirtualName . |
File |
getArchive()
Return the archive that this handler deals with. |
String |
getArchiveComment()
Get the comment associated with an archive. |
String |
getClassification(String fullVirtualName)
Get the classification for the entry with the given path. |
String |
getCommentFor(String fullVirtualName)
Get the user-defined comment for a specific entry in the archive. |
long |
getCompressedSizeFor(String fullVirtualName)
Get the amount of space taken up by a specific entry in the archive when it is in compressed form. |
String |
getCompressionMethodFor(String fullVirtualName)
Get the method used to compress a specific entry in the archive. |
File[] |
getFiles(String[] fullNames,
ISystemOperationMonitor archiveOperationMonitor)
Extracts and returns the specified list of virtual files from the archive. |
long |
getSizeFor(String fullVirtualName)
Return the size for an archive node. |
String |
getStandardName(VirtualChild vc)
Get the archive-type specific standard name for the VirtualChild vc . |
long |
getTimeStampFor(String fullVirtualName)
Return the timestamp for an archive node. |
VirtualChild[] |
getVirtualChildFolders(String fullVirtualName,
ISystemOperationMonitor archiveOperationMonitor)
Return those children of a specified node in an archive, which are folders. |
VirtualChild[] |
getVirtualChildren(String fullVirtualName,
ISystemOperationMonitor archiveOperationMonitor)
Return the children of a specified node in an archive. |
VirtualChild[] |
getVirtualChildrenList(ISystemOperationMonitor archiveOperationMonitor)
Return a flat list of entries in an archive. |
VirtualChild[] |
getVirtualChildrenList(String parent,
ISystemOperationMonitor archiveOperationMonitor)
Return a flat list of entries in an archive, whose full paths begin with the given parent prefix. |
VirtualChild |
getVirtualFile(String fullVirtualName,
ISystemOperationMonitor archiveOperationMonitor)
Return an archive node specified by a given virtual path. |
void |
move(String fullVirtualName,
String destinationVirtualPath,
ISystemOperationMonitor archiveOperationMonitor)
Moves the entry fullVirtualName to the location specified by
destinationVirtualPath , while leaving the entry with the
same name as before. |
void |
rename(String fullVirtualName,
String newName,
ISystemOperationMonitor archiveOperationMonitor)
Renames the entry fullVirtualName to the new name
newName while still leaving the entry in the same virtual
directory. |
void |
replace(String fullVirtualName,
File file,
String name,
ISystemOperationMonitor archiveOperationMonitor)
Compress the file file and replace the virtual file referred
to by fullVirtualName with the compressed file. |
void |
replace(String fullVirtualName,
InputStream stream,
String name,
String sourceEncoding,
String targetEncoding,
boolean isText,
ISystemOperationMonitor archiveOperationMonitor)
Compress the InputStream stream and replace the virtual file
referred to by fullVirtualName with the compressed stream. |
SystemSearchLineMatch[] |
search(String fullVirtualName,
SystemSearchStringMatcher matcher,
ISystemOperationMonitor archiveOperationMonitor)
Search for text within a virtual file in this archive. |
Method Detail |
---|
void create() throws SystemMessageException
SystemMessageException
- in case of an errorVirtualChild[] getVirtualChildrenList(ISystemOperationMonitor archiveOperationMonitor) throws SystemMessageException
archiveOperationMonitor
- the operation progress monitor
SystemMessageException
- in case of an error,
or SystemOperationCancelledException in case of user cancellationVirtualChild[] getVirtualChildrenList(String parent, ISystemOperationMonitor archiveOperationMonitor) throws SystemMessageException
parent
- full path of the parentarchiveOperationMonitor
- the operation progress monitor
parent
.
Returns an array of length 0 if there are no such entries.
SystemMessageException
- in case of an error,
or SystemOperationCancelledException in case of user cancellationVirtualChild[] getVirtualChildren(String fullVirtualName, ISystemOperationMonitor archiveOperationMonitor) throws SystemMessageException
fullVirtualName
- full virtual path of the parentarchiveOperationMonitor
- the operation progress monitor
fullVirtualName
. If fullVirtualName
is
"", returns the top level in the virtual file system tree. If there are
no values to return, returns null.
SystemMessageException
- in case of an error,
or SystemOperationCancelledException in case of user cancellationVirtualChild[] getVirtualChildFolders(String fullVirtualName, ISystemOperationMonitor archiveOperationMonitor) throws SystemMessageException
fullVirtualName
- full virtual path of the parentarchiveOperationMonitor
- the operation progress monitor
fullVirtualName
that are themselves directories. If
fullVirtualName
is "", returns the top level of directories
in the virtual file system tree. If there are no values to return,
returns null.
SystemMessageException
- in case of an error,
or SystemOperationCancelledException in case of user cancellationVirtualChild getVirtualFile(String fullVirtualName, ISystemOperationMonitor archiveOperationMonitor) throws SystemMessageException
fullVirtualName
- full virtual path of the object to retrievearchiveOperationMonitor
- the operation progress monitor
fullVirtualName
. This method never returns null. In cases
where the VirtualChild does not physically exist in the archive, this
method returns a new VirtualChild object whose exists() method returns
false.
SystemMessageException
- in case of an error,
or SystemOperationCancelledException in case of user cancellationboolean exists(String fullVirtualName, ISystemOperationMonitor archiveOperationMonitor) throws SystemMessageException
fullVirtualName
- full virtual path of the objectarchiveOperationMonitor
- the operation progress monitor
fullVirtualName
exists in the archive (physically).
SystemMessageException
- in case of an error,
or SystemOperationCancelledException in case of user cancellationboolean exists()
File getArchive()
long getTimeStampFor(String fullVirtualName) throws SystemMessageException
fullVirtualName
- virtual path specifying the node to check
fullVirtualName
SystemMessageException
- in case of an error,
or SystemOperationCancelledException in case of user cancellationlong getSizeFor(String fullVirtualName) throws SystemMessageException
fullVirtualName
- virtual path specifying the node to check
fullVirtualName
SystemMessageException
- in case of an error,
or SystemOperationCancelledException in case of user cancellationvoid extractVirtualFile(String fullVirtualName, File destination, ISystemOperationMonitor archiveOperationMonitor) throws SystemMessageException
fullVirtualName
from the
archive, placing the results in destination
.
fullVirtualName
- The full path and name of the virtual file in the
archive.destination
- The destination file for the extracted virtual file.archiveOperationMonitor
- the operation progress monitor
SystemMessageException
- in case of an error,
or SystemOperationCancelledException in case of user cancellationvoid extractVirtualFile(String fullVirtualName, File destination, String sourceEncoding, boolean isText, ISystemOperationMonitor archiveOperationMonitor) throws SystemMessageException
fullVirtualName
from the
archive, placing the results in destination
. Extracts to the
native encoding, but assumes that the source was archived using
sourceEncoding
if isText
is true.
fullVirtualName
- The full path and name of the virtual file in the
archive.destination
- The destination file for the extracted virtual file.sourceEncoding
- The encoding of the file in the archive.isText
- Whether or not the virtual file is a text file.archiveOperationMonitor
- the operation progress monitor
SystemMessageException
- in case of an error,
or SystemOperationCancelledException in case of user cancellationvoid extractVirtualDirectory(String dir, File destinationParent, ISystemOperationMonitor archiveOperationMonitor) throws SystemMessageException
dir
(and its children) from the
archive and places the results in the directory
destinationParent
.
dir
- The full name of the virtual directory to extractdestinationParent
- A handle to the directory in which the extracted
directory will be placed as a subdirectory.archiveOperationMonitor
- the operation progress monitor
SystemMessageException
- in case of an error,
or SystemOperationCancelledException in case of user cancellationvoid extractVirtualDirectory(String dir, File destinationParent, String sourceEncoding, boolean isText, ISystemOperationMonitor archiveOperationMonitor) throws SystemMessageException
dir
(and its children) from the
archive and places the results in the directory
destinationParent
. Extracts to the native encoding (if
isText
), but assumes that the source was archived using
sourceEncoding
.
dir
- The full name of the virtual directory to extractdestinationParent
- A handle to the directory in which the extracted
directory will be placed as a subdirectory.sourceEncoding
- The encoding of the files in the archive.isText
- Whether or not the files in the directory are text filesarchiveOperationMonitor
- the operation progress monitor
SystemMessageException
- in case of an error,
or SystemOperationCancelledException in case of user cancellationvoid extractVirtualDirectory(String dir, File destinationParent, File destination, ISystemOperationMonitor archiveOperationMonitor) throws SystemMessageException
dir
(and its children) from the
archive and places the results in the directory
destinationParent
. The results will be named
destination.getName() rather than dir
's name.
dir
- The full name of the virtual directory to extractdestinationParent
- A handle to the directory in which the extracted
directory will be placed as a subdirectory.destination
- A handle to the directory that will be created.
Whatever contents are in that directory will be replaced with what
is extracted from the archive.archiveOperationMonitor
- the operation progress monitor
SystemMessageException
- in case of an error,
or SystemOperationCancelledException in case of user cancellationvoid extractVirtualDirectory(String dir, File destinationParent, File destination, String sourceEncoding, boolean isText, ISystemOperationMonitor archiveOperationMonitor) throws SystemMessageException
dir
(and its children) from the
archive and places the results in the directory
destinationParent
. The results will be named
destination.getName() rather than dir
's name. Extracts to
the native encoding (if isText
), but assumes that the source
was archived using sourceEncoding
.
dir
- The full name of the virtual directory to extractdestinationParent
- A handle to the directory in which the extracted
directory will be placed as a subdirectory.destination
- A handle to the directory that will be created.
Whatever contents are in that directory will be replaced with what
is extracted from the archive.sourceEncoding
- The encoding of the files in the archive.isText
- Whether or not the files to be extracted in the directory
are all text filesarchiveOperationMonitor
- the operation progress monitor
SystemMessageException
- in case of an error,
or SystemOperationCancelledException in case of user cancellationvoid add(File file, String virtualPath, String name, ISystemOperationMonitor archiveOperationMonitor) throws SystemMessageException
file
and adds it to the archive, placing
it in the virtual directory virtualPath
. Pass the name as
the parameter name
. If the virtual path does not exist in
the archive, create it. If file
is a directory, copy it and
its contents into the archive, maintaining the tree structure.
file
- the file to be added to the archivevirtualPath
- the destination of the filename
- the name of the result virtual filearchiveOperationMonitor
- the operation progress monitor
SystemMessageException
- in case of an error,
or SystemOperationCancelledException in case of user cancellationvoid add(File file, String virtualPath, String name, String sourceEncoding, String targetEncoding, boolean isText, ISystemOperationMonitor archiveOperationMonitor) throws SystemMessageException
file
and adds it to the archive, saving
it in the encoding specified by encoding
if the isText is
true. placing it in the virtual directory virtualPath
. Pass
the name as the parameter name
. If the virtual path does not
exist in the archive, create it. If file
is a directory,
copy it and its contents into the archive, maintaining the tree
structure.
file
- the file to be added to the archivevirtualPath
- the destination of the filename
- the name of the result virtual filesourceEncoding
- the encoding of the source filetargetEncoding
- the encoding of the result fileisText
- is the file a text filearchiveOperationMonitor
- the operation progress monitor
SystemMessageException
- in case of an error,
or SystemOperationCancelledException in case of user cancellationvoid add(InputStream stream, String virtualPath, String name, String sourceEncoding, String targetEncoding, boolean isText, ISystemOperationMonitor archiveOperationMonitor) throws SystemMessageException
stream
and adds them
as an entry to the archive, saving them in the encoding specified by
encoding
if isText
is true, and placing it in
the virtual directory virtualPath
. Pass the name as the
parameter name
. If the virtual path does not exist in the
archive, create it.
stream
- the InputStream to be added as an entry to the archivevirtualPath
- the destination of the streamname
- the name of the result virtual filesourceEncoding
- the encoding of the source streamtargetEncoding
- the encoding of the result fileisText
- is the file a text filearchiveOperationMonitor
- the operation progress monitor
SystemMessageException
- in case of an error,
or SystemOperationCancelledException in case of user cancellationvoid add(File file, String virtualPath, String name, String sourceEncoding, String targetEncoding, ISystemFileTypes typeRegistery, ISystemOperationMonitor archiveOperationMonitor) throws SystemMessageException
file
and adds it to the archive, saving
it in the encoding specified by encoding
if the isText is
true. placing it in the virtual directory virtualPath
. Pass
the name as the parameter name
. If the virtual path does not
exist in the archive, create it. If file
is a directory,
copy it and its contents into the archive, maintaining the tree
structure.
file
- the file to be added to the archivevirtualPath
- the destination of the filename
- the name of the result virtual filesourceEncoding
- the encoding of the source filetargetEncoding
- the encoding of the result filetypeRegistery
- file transfer mode (binary or text) of this filearchiveOperationMonitor
- the operation progress monitor
SystemMessageException
- in case of an error,
or SystemOperationCancelledException in case of user cancellationvoid add(File[] files, String virtualPath, String[] names, ISystemOperationMonitor archiveOperationMonitor) throws SystemMessageException
files
and adds each of them to the archive, placing them in
the virtual directory virtualPath
. Pass the names of the
files as the parameter names
, where files[i]
has the name names[i]
. If the virtual path does not exist in
the archive, create it.
files
- the list of files to be added to the archivevirtualPath
- the destination of the filenames
- the names of the result virtual filesarchiveOperationMonitor
- the operation progress monitor
SystemMessageException
- in case of an error,
or SystemOperationCancelledException in case of user cancellationvoid add(File[] files, String virtualPath, String[] names, String[] sourceEncodings, String[] targetEncodings, boolean[] isText, ISystemOperationMonitor archiveOperationMonitor) throws SystemMessageException
files
and adds each of them to the archive, placing them in
the virtual directory virtualPath
. Save the i'th file in the
i'th encoding (if isText[i] is true) specified by encodings
.
Pass the names of the files as the parameter names
, where
files[i]
has the name names[i]
. If the virtual
path does not exist in the archive, create it.
files
- the list of files to be added to the archivevirtualPath
- the destination of the filesnames
- the names of the result virtual filessourceEncodings
- the encoding of the source filestargetEncodings
- the encoding of the result filesisText
- file transfer mode (binary or text) of the filesarchiveOperationMonitor
- the operation progress monitor
SystemMessageException
- in case of an error,
or SystemOperationCancelledException in case of user cancellationvoid replace(String fullVirtualName, File file, String name, ISystemOperationMonitor archiveOperationMonitor) throws SystemMessageException
file
and replace the virtual file referred
to by fullVirtualName
with the compressed file. Pass the
name of the file as the parameter name
.
fullVirtualName
- the path of the file to be replacedfile
- the file to be added to the archivename
- the name of the filearchiveOperationMonitor
- the operation progress monitor
SystemMessageException
- in case of an error,
or SystemOperationCancelledException in case of user cancellationvoid replace(String fullVirtualName, InputStream stream, String name, String sourceEncoding, String targetEncoding, boolean isText, ISystemOperationMonitor archiveOperationMonitor) throws SystemMessageException
stream
and replace the virtual file
referred to by fullVirtualName
with the compressed stream.
Pass the name of the new entry as the parameter name
, the
encoding of the entry as encoding
and whether or not the
entry isText
or not.
fullVirtualName
- the path of the file to be replacedstream
- the InputStream to be added as an entry to the archivename
- the name of the result virtual filesourceEncoding
- the encoding of the source streamtargetEncoding
- the encoding of the result fileisText
- is the file a text filearchiveOperationMonitor
- the operation progress monitor
SystemMessageException
- in case of an error,
or SystemOperationCancelledException in case of user cancellationboolean delete(String fullVirtualName, ISystemOperationMonitor archiveOperationMonitor) throws SystemMessageException
fullVirtualName
from the archive, and
returns whether or not the deletion was successful.
fullVirtualName
- the path of the file to be deletedarchiveOperationMonitor
- the operation progress monitor
true
if the deletion is successful,
false
if the file to delete was not found so this was a
successful no-op.
SystemMessageException
- in case of an error,
or SystemOperationCancelledException in case of user cancellationvoid rename(String fullVirtualName, String newName, ISystemOperationMonitor archiveOperationMonitor) throws SystemMessageException
fullVirtualName
to the new name
newName
while still leaving the entry in the same virtual
directory. Returns true if and only if the rename was successful.
fullVirtualName
- the path of the file to be renamedarchiveOperationMonitor
- the operation progress monitor
SystemMessageException
- in case of an error,
or SystemOperationCancelledException in case of user cancellationvoid move(String fullVirtualName, String destinationVirtualPath, ISystemOperationMonitor archiveOperationMonitor) throws SystemMessageException
fullVirtualName
to the location specified by
destinationVirtualPath
, while leaving the entry with the
same name as before.
fullVirtualName
- the path of the file to be renameddestinationVirtualPath
- the destination of the file to move toarchiveOperationMonitor
- the operation progress monitor
SystemMessageException
- in case of an error,
or SystemOperationCancelledException in case of user cancellationvoid fullRename(String fullVirtualName, String newFullVirtualName, ISystemOperationMonitor archiveOperationMonitor) throws SystemMessageException
fullVirtualName
with the new full name and path newFullVirtualName
.
fullVirtualName
- the path of the file to be renamednewFullVirtualName
- the full path of the virtual file namearchiveOperationMonitor
- the operation progress monitor
SystemMessageException
- in case of an error,
or SystemOperationCancelledException in case of user cancellationFile[] getFiles(String[] fullNames, ISystemOperationMonitor archiveOperationMonitor) throws SystemMessageException
fullNames
- The list of files to returnarchiveOperationMonitor
- the operation progress monitor
SystemMessageException
- in case of an error,
or SystemOperationCancelledException in case of user cancellationvoid createFolder(String fullVirtualName, ISystemOperationMonitor archiveOperationMonitor) throws SystemMessageException
fullVirtualName
- The full name and path of the new folder within
the virtual file system.archiveOperationMonitor
- the operation progress monitor
SystemMessageException
- in case of an error,
or SystemOperationCancelledException in case of user cancellationvoid createFile(String fullVirtualName, ISystemOperationMonitor archiveOperationMonitor) throws SystemMessageException
fullVirtualName
- The full name and path of the new file within the
virtual file system.archiveOperationMonitor
- the operation progress monitor
SystemMessageException
- in case of an error,
or SystemOperationCancelledException in case of user cancellationString getStandardName(VirtualChild vc)
vc
. For example, for Zip archives, if vc is a directory,
then the standard name must end with a "/".
vc
- the archive node to use
SystemSearchLineMatch[] search(String fullVirtualName, SystemSearchStringMatcher matcher, ISystemOperationMonitor archiveOperationMonitor) throws SystemMessageException
fullVirtualName
- the virtual file to search.matcher
- the pattern matcher to use.archiveOperationMonitor
- the operation progress monitor
SystemMessageException
- in case of an error,
or SystemOperationCancelledException in case of user cancellationString getCommentFor(String fullVirtualName) throws SystemMessageException
fullVirtualName
- The entry who's comment is desired
SystemMessageException
- in case of an errorlong getCompressedSizeFor(String fullVirtualName) throws SystemMessageException
fullVirtualName
- The entry who's compressed size is desired
SystemMessageException
- in case of an errorString getCompressionMethodFor(String fullVirtualName) throws SystemMessageException
fullVirtualName
- The entry who's compression method is desired
SystemMessageException
- in case of an errorString getArchiveComment() throws SystemMessageException
SystemMessageException
- in case of an errorString getClassification(String fullVirtualName) throws SystemMessageException
fullVirtualName
- the virtual name.
SystemMessageException
- in case of an error
|
RSE Release 3.2 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |