Class NestedZipFile
- java.lang.Object
-
- org.apache.aries.util.filesystem.impl.NestedZipFile
-
- All Implemented Interfaces:
IFile
- Direct Known Subclasses:
NestedZipDirectory
public class NestedZipFile extends Object implements IFile
-
-
Constructor Summary
Constructors Constructor Description NestedZipFile(IFile archive)NestedZipFile(IFile archive, String pathInZip, NestedZipDirectory parent, NestedCloseableDirectory cache)NestedZipFile(IFile archive, ZipEntry entry, NestedZipDirectory parent, NestedCloseableDirectory cache)Construct a nested zip fileNestedZipFile(NestedZipFile other, NestedCloseableDirectory cache)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IDirectoryconvert()IDirectoryconvertNested()booleanequals(Object obj)longgetLastModified()StringgetName()StringgetNameInZip()IDirectorygetParent()IDirectorygetRoot()longgetSize()inthashCode()booleanisDirectory()booleanisFile()InputStreamopen()The input stream returned by this method should always be closed after use.StringtoString()URLtoURL()
-
-
-
Constructor Detail
-
NestedZipFile
public NestedZipFile(IFile archive, ZipEntry entry, NestedZipDirectory parent, NestedCloseableDirectory cache)
Construct a nested zip file- Parameters:
archive-entry-parent-
-
NestedZipFile
public NestedZipFile(IFile archive, String pathInZip, NestedZipDirectory parent, NestedCloseableDirectory cache)
-
NestedZipFile
public NestedZipFile(IFile archive)
-
NestedZipFile
public NestedZipFile(NestedZipFile other, NestedCloseableDirectory cache)
-
-
Method Detail
-
getNameInZip
public String getNameInZip()
-
getName
public String getName()
-
isDirectory
public boolean isDirectory()
- Specified by:
isDirectoryin interfaceIFile- Returns:
- true iff this IFile is also an IDirectory
-
isFile
public boolean isFile()
-
getLastModified
public long getLastModified()
- Specified by:
getLastModifiedin interfaceIFile- Returns:
- the last modified date of the file.
-
getSize
public long getSize()
-
convert
public IDirectory convert()
-
convertNested
public IDirectory convertNested()
- Specified by:
convertNestedin interfaceIFile- Returns:
- if this is a directory or an archive, returns the opened IDirectory
-
getParent
public IDirectory getParent()
-
open
public InputStream open() throws IOException, UnsupportedOperationException
Description copied from interface:IFileThe input stream returned by this method should always be closed after use.- Specified by:
openin interfaceIFile- Returns:
- An InputStream to read the file from.
- Throws:
IOExceptionUnsupportedOperationException- If the IFile is also an IDirectory.
-
getRoot
public IDirectory getRoot()
-
toURL
public URL toURL() throws MalformedURLException
- Specified by:
toURLin interfaceIFile- Returns:
- a URL that can be used to get at this file at a later date.
- Throws:
MalformedURLException
-
-