com.armatiek.infofuze.stream.filesystem.compression.gzip
Class GzipArchiveFileEntry

java.lang.Object
  extended by com.armatiek.infofuze.stream.filesystem.AbstractFile
      extended by com.armatiek.infofuze.stream.filesystem.ProxyFile
          extended by com.armatiek.infofuze.stream.filesystem.compression.gzip.GzipArchiveFileEntry
All Implemented Interfaces:
FileIf

public class GzipArchiveFileEntry
extends ProxyFile

An representation of a file entry within a GZIP archive file.

Author:
Maarten Kroon

Constructor Summary
GzipArchiveFileEntry(ArchiveFile archiveFile, java.io.InputStream is)
           
 
Method Summary
 java.io.InputStream getInputStream()
          Returns the contents of the file as a byte stream.
 java.lang.String getName()
          Returns the name of the file.
 java.lang.String getParent()
          Returns the path of the parent of the file.
 FileIf getParentFile()
          Returns the parent of the file.
 boolean isDirectory()
          Tests whether the file denoted by this abstract pathname is a directory.
 boolean isFile()
          Tests whether this file is a normal file.
 java.util.Iterator<FileIf> listFiles()
          Returns an iterator of files and directories in the directory denoted by this file.
 
Methods inherited from class com.armatiek.infofuze.stream.filesystem.ProxyFile
canRead, exists, getMimeType, getPath, hasContent, isHidden, lastModified, length
 
Methods inherited from class com.armatiek.infofuze.stream.filesystem.AbstractFile
getCharacterEncoding
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.armatiek.infofuze.stream.filesystem.FileIf
equals
 

Constructor Detail

GzipArchiveFileEntry

public GzipArchiveFileEntry(ArchiveFile archiveFile,
                            java.io.InputStream is)
Method Detail

getName

public java.lang.String getName()
Description copied from interface: FileIf
Returns the name of the file.

Specified by:
getName in interface FileIf
Overrides:
getName in class ProxyFile
Returns:
a String specifying the name of the file.

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.IOException
Description copied from interface: FileIf
Returns the contents of the file as a byte stream.

Specified by:
getInputStream in interface FileIf
Overrides:
getInputStream in class ProxyFile
Returns:
an InputStream providing the contents of the file as a stream of bytes.
Throws:
java.io.IOException

getParent

public java.lang.String getParent()
Description copied from interface: FileIf
Returns the path of the parent of the file. This is just the last name in the pathname's name sequence.

Specified by:
getParent in interface FileIf
Overrides:
getParent in class ProxyFile
Returns:
a String specifying the path of the file's parent

getParentFile

public FileIf getParentFile()
Description copied from interface: FileIf
Returns the parent of the file.

Specified by:
getParentFile in interface FileIf
Overrides:
getParentFile in class ProxyFile
Returns:
the FileIf interface of this file's parent

isDirectory

public boolean isDirectory()
Description copied from interface: FileIf
Tests whether the file denoted by this abstract pathname is a directory.

Specified by:
isDirectory in interface FileIf
Overrides:
isDirectory in class ProxyFile
Returns:
true if and only if this file exists and is a directory; false otherwise

isFile

public boolean isFile()
Description copied from interface: FileIf
Tests whether this file is a normal file. A file is normal if it is not a directory and, in addition, satisfies other system-dependent criteria.

Specified by:
isFile in interface FileIf
Overrides:
isFile in class ProxyFile
Returns:
true if and only if this file is a directory; false otherwise

listFiles

public java.util.Iterator<FileIf> listFiles()
Description copied from interface: FileIf
Returns an iterator of files and directories in the directory denoted by this file. If this file does not denote a directory, then this method returns null. Otherwise an iterator of files is returned, one for each file or directory in the directory. Files denoting the directory itself and the directory's parent directory are not included in the result.

Specified by:
listFiles in interface FileIf
Overrides:
listFiles in class ProxyFile
Returns:
An iterator of FileIf interfaces of the files and directories in the directory denoted by this file. The iterator will be empty if the directory is empty. Returns null if this file does not denote a directory, or if an I/O error occurs.