org.entityfs.zip
Class ZipFileSystemAdapter

java.lang.Object
  extended by org.entityfs.impl.impl.adapter.AbstractFileSystemAdapter
      extended by org.entityfs.zip.ZipFileSystemAdapter
All Implemented Interfaces:
FileSystemAdapter

public class ZipFileSystemAdapter
extends AbstractFileSystemAdapter


Constructor Summary
ZipFileSystemAdapter(LogAdapterHolder lah, Map<AbsoluteLocation,org.entityfs.zip.ZipFileDirectoryNode> nodeLocationMap, ZipFile zf, int bufSize)
           
 
Method Summary
 void close()
          The default implementation does nothing.
 boolean containsNode(AbsoluteLocation loc)
           
protected  void finalize()
           
 AbsoluteLocation getDirectoryAdapterLocation(ZipDirectoryAdapter da)
           
 org.entityfs.zip.ZipFileDirectoryNode getDirectoryNode(AbsoluteLocation loc)
          This is used by the FSACZipEntries capability.
 EntityType getEntityType(AbsoluteLocation loc)
          Get the type of the entity at the specified location.
 ZipEntry getZipEntry(AbsoluteLocation loc)
          Get the ZipEntry for the supplied location.
 ZipFile getZipFile()
           
 boolean isCaseSensitive()
          Is the file system backend case sensitive?
 void registerDirectoryAdapter(ZipDirectoryAdapter da, AbsoluteLocation loc)
          When a directory adapter is created, it is registered (through the FSACZipEntries capability) so that its location can be looked up when creating its child entity adapters.
 
Methods inherited from class org.entityfs.impl.impl.adapter.AbstractFileSystemAdapter
getBufferSize, getLogAdapter, init, validateEntityName
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ZipFileSystemAdapter

public ZipFileSystemAdapter(LogAdapterHolder lah,
                            Map<AbsoluteLocation,org.entityfs.zip.ZipFileDirectoryNode> nodeLocationMap,
                            ZipFile zf,
                            int bufSize)
Method Detail

isCaseSensitive

public boolean isCaseSensitive()
Description copied from interface: FileSystemAdapter
Is the file system backend case sensitive?

Returns:
true if the file system is case sensitive.

getDirectoryNode

public org.entityfs.zip.ZipFileDirectoryNode getDirectoryNode(AbsoluteLocation loc)
This is used by the FSACZipEntries capability.

Returns:
The Zip file tree node that corresponds to the given location. This may be null for a non-existing node.

containsNode

public boolean containsNode(AbsoluteLocation loc)

getZipFile

public ZipFile getZipFile()

getEntityType

public EntityType getEntityType(AbsoluteLocation loc)
Get the type of the entity at the specified location. If the ZipFile does not contain any entry at the supplied location, this is interpreted as a directory entry.

Parameters:
loc - The location of the entity.

getZipEntry

public ZipEntry getZipEntry(AbsoluteLocation loc)
Get the ZipEntry for the supplied location. For directories, this may return null.

Parameters:
loc - The location to get the ZipEntry for.
Returns:
The ZipEntry or null.

registerDirectoryAdapter

public void registerDirectoryAdapter(ZipDirectoryAdapter da,
                                     AbsoluteLocation loc)
When a directory adapter is created, it is registered (through the FSACZipEntries capability) so that its location can be looked up when creating its child entity adapters.

Parameters:
da - The directory adapter
loc - The directory adapter's location

getDirectoryAdapterLocation

public AbsoluteLocation getDirectoryAdapterLocation(ZipDirectoryAdapter da)

close

public void close()
Description copied from class: AbstractFileSystemAdapter
The default implementation does nothing. Override if needed.

Specified by:
close in interface FileSystemAdapter
Overrides:
close in class AbstractFileSystemAdapter

finalize

protected void finalize()
                 throws Throwable
Overrides:
finalize in class Object
Throws:
Throwable