|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--sam.entry.Entry
This class is a basic abstraction over files for the purpose of archiving.
Instances of this class are fully immutable.
Note also that this class has no public constructor as it should only
be instantiated through an Enumerator
sub-class.
Enumerator
,
FileSystem
Field Summary | |
long |
date
Actual last access time of this entry. |
static sam.entry.Entry |
DUMMY
Dummy entry for testing/debugging purposes |
long |
length
Actual total number of bytes contained by this entry. |
java.lang.String |
name
Actual name of this entry. |
Method Summary | |
java.io.OutputStream |
compare(sam.event.FileEventNotifier notifier,
java.io.File actualDirectory)
Gets an OutputStream ready for comparing this entry to the file stored into specific directory. |
java.io.OutputStream |
freshen(sam.event.FileEventNotifier notifier,
java.io.File actualDirectory)
Gets an OutputStream ready for freshening this entry into specific directory. |
java.io.InputStream |
getInputStream()
Returns an InputStream for reading this entry, assumed it is a local file. |
boolean |
isOlderThanIn(java.io.File outputDirectory)
Wether this entry denotes a file which is older than an already existing file ins specified directory. |
java.lang.String |
list(sam.rules.ModusOperandi modusOperandi)
Lists this entry in Unix-like format. |
protected static java.lang.String |
mangleFileName(java.lang.String fileName,
java.io.File basePath)
Mangles a native file name to an |
java.io.OutputStream |
overwrite(sam.event.FileEventNotifier notifier,
java.io.File actualDirectory)
Gets an OutputStream ready for writing this entry into specific directory. |
java.io.InputStream |
read(sam.event.FileEventNotifier notifier)
Gets an InputStream ready for reading the file corresponding the this entry. |
java.io.OutputStream |
skip(sam.event.FileEventNotifier notifier,
java.io.File actualDirectory)
Gets an OutputStream ready for skipping this entry. |
java.io.File |
toFile()
Unmangles this |
java.io.File |
toFile(java.io.File basePath)
Unmangles this |
java.lang.String |
toString()
Returns a human-readable description of this entry |
java.lang.String |
verbose()
Makes a verbose description of this entry including its name and size. |
java.io.OutputStream |
write(sam.event.FileEventNotifier notifier,
java.io.File actualDirectory)
Gets an OutputStream ready for writing this entry into specific directory. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final sam.entry.Entry DUMMY
public final long length
public final java.lang.String name
ArchiveLayout.ENTRY_PATH_SEPARATOR
Warning: native File
s should not be created with this field
as a parameter but through the toFile
method instead.
public final long date
Method Detail |
public java.lang.String list(sam.rules.ModusOperandi modusOperandi)
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String verbose()
"./foo" (25kb)
public java.io.InputStream getInputStream() throws java.io.IOException
InputStream
for reading this entry, assumed it is a local file.
java.io.IOException
public boolean isOlderThanIn(java.io.File outputDirectory)
outputDirectory
- the output directory to place the file in.
protected static java.lang.String mangleFileName(java.lang.String fileName, java.io.File basePath)
basePath
- the base path, or null
ArchiveLayout.ENTRY_PATH_SEPARATOR
public java.io.File toFile()
ArchiveLayout.ENTRY_PATH_SEPARATOR
public java.io.File toFile(java.io.File basePath)
basePath
- the base path, or null
ArchiveLayout.ENTRY_PATH_SEPARATOR
public java.io.InputStream read(sam.event.FileEventNotifier notifier)
InputStream
ready for reading the file corresponding the this entry.
This entry is supposed to either have an absolute path or to designate a path relative
to the current working directory.
notifier
- the FileEvent
notifier to report events throughpublic java.io.OutputStream write(sam.event.FileEventNotifier notifier, java.io.File actualDirectory)
OutputStream
ready for writing this entry into specific directory.
If the target file already exists, this will ask the user wether it should be overwritten.
notifier
- the FileEvent
notifier to report events throughactualDirectory
- the base directory to extract the file into (relative path
is preserved).public java.io.OutputStream freshen(sam.event.FileEventNotifier notifier, java.io.File actualDirectory)
OutputStream
ready for freshening this entry into specific directory.
If the target file already exists and is older then it will be overwritten.
notifier
- the FileEvent
notifier to report events throughactualDirectory
- the base directory to extract the file into (relative path
is preserved).public java.io.OutputStream skip(sam.event.FileEventNotifier notifier, java.io.File actualDirectory)
OutputStream
ready for skipping this entry.
notifier
- the FileEvent
notifier to report events throughactualDirectory
- the base directory to extract the file into (relative path
is preserved).public java.io.OutputStream overwrite(sam.event.FileEventNotifier notifier, java.io.File actualDirectory)
OutputStream
ready for writing this entry into specific directory.
The target file is overwritten if it already exists.
notifier
- the FileEvent
notifier to report events throughactualDirectory
- the base directory to extract the file into (relative path
is preserved).public java.io.OutputStream compare(sam.event.FileEventNotifier notifier, java.io.File actualDirectory)
OutputStream
ready for comparing this entry to the file stored into specific directory.
notifier
- the FileEvent
notifier to report events throughactualDirectory
- the base directory where the file to compared against is stored (relative path
is preserved).
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |