|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.mucommander.file.AbstractFile
com.mucommander.file.impl.ProxyFile
com.mucommander.file.AbstractArchiveFile
com.mucommander.file.AbstractRWArchiveFile
public abstract class AbstractRWArchiveFile
AbstractRWArchiveFile represents a read-write archive file. This class is abstract and implemented by
all read-write archive files.
In addition to the read-only operations defined by AbstractArchiveFile, it provides
abstract methods for adding and deleting entries from the archive.
The isWritableArchive() method impletemented by this class always returns true. However,
write operations may not always be available depending on the underlying file (e.g. if random file access is
required). In that case, isWritableArchive() should be overridden to return true only when
write operations are available.
| Field Summary |
|---|
| Fields inherited from class com.mucommander.file.AbstractArchiveFile |
|---|
entryTreeDate, entryTreeRoot |
| Fields inherited from class com.mucommander.file.impl.ProxyFile |
|---|
file |
| Fields inherited from class com.mucommander.file.AbstractFile |
|---|
DEFAULT_SEPARATOR, fileURL, IO_BUFFER_SIZE, MUST_HINT, MUST_NOT_HINT, SHOULD_HINT, SHOULD_NOT_HINT, windowsDriveRootPattern |
| Fields inherited from interface com.mucommander.file.PermissionTypes |
|---|
EXECUTE_PERMISSION, READ_PERMISSION, WRITE_PERMISSION |
| Fields inherited from interface com.mucommander.file.PermissionAccesses |
|---|
GROUP_ACCESS, OTHER_ACCESS, USER_ACCESS |
| Constructor Summary | |
|---|---|
protected |
AbstractRWArchiveFile(AbstractFile file)
Creates an AbstractRWArchiveFile on top of the given file. |
| Method Summary | |
|---|---|
abstract java.io.OutputStream |
addEntry(ArchiveEntry entry)
Adds the given entry to the archive and returns an OutputStream to write the entry's contents
if the entry is a regular file, null if the entry is a directory. |
abstract void |
deleteEntry(ArchiveEntry entry)
Deletes the specified entry from the archive. |
boolean |
isWritableArchive()
Returns true: AbstractRWArchiveFile implementations are capable of adding or deleting
entries. |
abstract void |
optimizeArchive()
Processes the archive file to leave it in an optimal form. |
abstract void |
updateEntry(ArchiveEntry entry)
Updates the specified entry in the archive with the attributes containted in the ArchiveEntry object. |
| Methods inherited from class com.mucommander.file.AbstractArchiveFile |
|---|
addToEntriesTree, canRunProcess, checkEntriesTree, createEntriesTree, declareEntriesTreeUpToDate, getArchiveEntryFile, getArchiveEntryFile, getEntries, getEntryInputStream, getFreeSpace, isBrowsable, isDirectory, ls, ls, ls, ls, ls, removeFromEntriesTree, runProcess |
| Methods inherited from class com.mucommander.file.AbstractFile |
|---|
addTrailingSeparator, calculateChecksum, calculateChecksum, calculateChecksum, changePermissions, checkCopyPrerequisites, copyRecursively, deleteRecursively, getAbsolutePath, getAncestor, getAncestor, getCanonicalPath, getChild, getDirectChild, getExtension, getIcon, getIcon, getNameWithoutExtension, getParentArchive, getParentSilently, getTopAncestor, hasAncestor, hasAncestor, isParentOf, mkdir, mkdirs, mkfile, removeTrailingSeparator |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
protected AbstractRWArchiveFile(AbstractFile file)
file - the file on top of which to create the archive| Method Detail |
|---|
public boolean isWritableArchive()
true: AbstractRWArchiveFile implementations are capable of adding or deleting
entries. This method should be overridden if the implementation is capable of providing write access only under
certain conditions, for example if it requires random access to the proxied archive file which may not
always be available depending on the udnderlying file. If that is the case, this method should return
true only when all conditions for providing write operations are met.
isWritableArchive in class AbstractArchiveFile
public abstract java.io.OutputStream addEntry(ArchiveEntry entry)
throws java.io.IOException
OutputStream to write the entry's contents
if the entry is a regular file, null if the entry is a directory.
Throws an IOException if the entry already exists in the archive or if an I/O error occurs.
entry - the entry to add to the archive
java.io.IOException - if the entry already exists in the archive or if an I/O error occurs
public abstract void deleteEntry(ArchiveEntry entry)
throws java.io.IOException
IOException if the entry doesn't exist
in the archive or if an I/O error occurs.
entry - the entry to delete from the archive
java.io.IOException - if the entry doesn't exist in the archive or if an I/O error occurs
public abstract void updateEntry(ArchiveEntry entry)
throws java.io.IOException
ArchiveEntry object.
Throws an IOException if the entry doesn't exist in the archive or if an I/O error occurs.
This methods can be used to update the entry's date and permissions for instance.
entry - the entry to update in the archive
java.io.IOException - if the entry doesn't exist in the archive or if an I/O error occurs
public abstract void optimizeArchive()
throws java.io.IOException
The actual effect of this method on the archive file depends on the kind of archive. It may be implemented
as a no-op if there is no use for it.
To illustrate, in the case of a ZipArchiveFile, this method removes chunks
of free space that are left when entries are deleted.
java.io.IOException - if an I/O error occurs
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
This file is part of muCommander - Copyright (C) 2002-2008 Maxence Bernard