org.apache.aries.application.utils.filesystem.impl
Class ZipFileImpl

java.lang.Object
  extended by org.apache.aries.application.utils.filesystem.impl.ZipFileImpl
All Implemented Interfaces:
IFile
Direct Known Subclasses:
ZipDirectory

public class ZipFileImpl
extends Object
implements IFile

An implementation of IFile that represents a file entry in a zip.


Field Summary
protected  ZipEntry entry
          The entry in the zip this IFile represents
protected  File zip
          The zip file this is contained in
 
Constructor Summary
protected ZipFileImpl(File zip1, File fs)
          This is called to construct the root directory of the zip.
  ZipFileImpl(File zip1, ZipEntry entry1, ZipDirectory parent1)
          This constructor is used to create a file entry within the zip.
 
Method Summary
 IDirectory convert()
           
 boolean equals(Object obj)
           
 long getLastModified()
           
 String getName()
           
 IDirectory getParent()
           
 IDirectory getRoot()
           
 long getSize()
           
 int hashCode()
           
 boolean isDirectory()
           
 boolean isFile()
           
 InputStream open()
           
 String toString()
           
 URL toURL()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

zip

protected File zip
The zip file this is contained in


entry

protected ZipEntry entry
The entry in the zip this IFile represents

Constructor Detail

ZipFileImpl

public ZipFileImpl(File zip1,
                   ZipEntry entry1,
                   ZipDirectory parent1)
This constructor is used to create a file entry within the zip.

Parameters:
zip1 - the zip file the entry is in.
entry1 - the entry this IFile represents.
parent1 - the parent directory.

ZipFileImpl

protected ZipFileImpl(File zip1,
                      File fs)
               throws MalformedURLException
This is called to construct the root directory of the zip.

Parameters:
zip1 - the zip file this represents.
fs - the file on the fs.
Throws:
MalformedURLException
Method Detail

convert

public IDirectory convert()
Specified by:
convert in interface IFile

getLastModified

public long getLastModified()
Specified by:
getLastModified in interface IFile

getName

public String getName()
Specified by:
getName in interface IFile

getParent

public IDirectory getParent()
Specified by:
getParent in interface IFile

getSize

public long getSize()
Specified by:
getSize in interface IFile

isDirectory

public boolean isDirectory()
Specified by:
isDirectory in interface IFile

isFile

public boolean isFile()
Specified by:
isFile in interface IFile

open

public InputStream open()
                 throws IOException
Specified by:
open in interface IFile
Throws:
IOException

getRoot

public IDirectory getRoot()
Specified by:
getRoot in interface IFile

toURL

public URL toURL()
          throws MalformedURLException
Specified by:
toURL in interface IFile
Throws:
MalformedURLException

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2009-2011 The Apache Software Foundation. All Rights Reserved.