com.sun.tools.javac.file
Class ZipFileIndexArchive.ZipFileIndexFileObject

java.lang.Object
  extended by com.sun.tools.javac.file.BaseFileObject
      extended by com.sun.tools.javac.file.ZipFileIndexArchive.ZipFileIndexFileObject
All Implemented Interfaces:
FileObject, JavaFileObject
Enclosing class:
ZipFileIndexArchive

public static class ZipFileIndexArchive.ZipFileIndexFileObject
extends BaseFileObject

A subclass of JavaFileObject representing zip entries using the com.sun.tools.javac.file.ZipFileIndex implementation.


Nested Class Summary
 
Nested classes/interfaces inherited from interface javax.tools.JavaFileObject
JavaFileObject.Kind
 
Field Summary
(package private)  ZipFileIndex.Entry entry
          The underlying zip entry object.
(package private)  java.io.InputStream inputStream
          The InputStream for this zip entry (file.)
private  java.lang.String name
          The entry's name.
(package private)  ZipFileIndex zfIndex
          The zipfile containing the entry.
(package private)  java.lang.String zipName
          The name of the zip file where this entry resides.
 
Fields inherited from class com.sun.tools.javac.file.BaseFileObject
fileManager
 
Constructor Summary
ZipFileIndexArchive.ZipFileIndexFileObject(JavacFileManager fileManager, ZipFileIndex zfIndex, ZipFileIndex.Entry entry, java.lang.String zipFileName)
           
 
Method Summary
 boolean delete()
          Deletes this file object.
 boolean equals(java.lang.Object other)
           
 java.nio.CharBuffer getCharContent(boolean ignoreEncodingErrors)
          Gets the character content of this file object, if available.
protected  java.nio.charset.CharsetDecoder getDecoder(boolean ignoreEncodingErrors)
           
 long getLastModified()
          Gets the time this file object was last modified.
 java.lang.String getName()
          Deprecated. see bug 6410637
 java.lang.String getPath()
          Deprecated. see bug 6410637
 java.lang.String getZipEntryName()
           
 java.lang.String getZipName()
           
 int hashCode()
           
protected  java.lang.String inferBinaryName(java.lang.Iterable<? extends java.io.File> path)
           
 boolean isNameCompatible(java.lang.String cn, JavaFileObject.Kind k)
          Checks if this file object is compatible with the specified simple name and kind.
 java.io.InputStream openInputStream()
          Gets an InputStream for this file object.
 java.io.OutputStream openOutputStream()
          Gets an OutputStream for this file object.
 java.io.Writer openWriter()
          Gets a Writer for this file object.
private  byte[] read()
           
 java.net.URI toUri()
          Returns a URI identifying this file object.
 
Methods inherited from class com.sun.tools.javac.file.BaseFileObject
getAccessLevel, getKind, getNestingKind, openReader, removeExtension, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

name

private java.lang.String name
The entry's name.


zfIndex

ZipFileIndex zfIndex
The zipfile containing the entry.


entry

ZipFileIndex.Entry entry
The underlying zip entry object.


inputStream

java.io.InputStream inputStream
The InputStream for this zip entry (file.)


zipName

java.lang.String zipName
The name of the zip file where this entry resides.

Constructor Detail

ZipFileIndexArchive.ZipFileIndexFileObject

ZipFileIndexArchive.ZipFileIndexFileObject(JavacFileManager fileManager,
                                           ZipFileIndex zfIndex,
                                           ZipFileIndex.Entry entry,
                                           java.lang.String zipFileName)
Method Detail

openInputStream

public java.io.InputStream openInputStream()
                                    throws java.io.IOException
Description copied from interface: FileObject
Gets an InputStream for this file object.

Returns:
an InputStream
Throws:
java.io.IOException - if an I/O error occurred

getDecoder

protected java.nio.charset.CharsetDecoder getDecoder(boolean ignoreEncodingErrors)
Overrides:
getDecoder in class BaseFileObject

openOutputStream

public java.io.OutputStream openOutputStream()
                                      throws java.io.IOException
Description copied from interface: FileObject
Gets an OutputStream for this file object.

Returns:
an OutputStream
Throws:
java.io.IOException - if an I/O error occurred

openWriter

public java.io.Writer openWriter()
                          throws java.io.IOException
Description copied from interface: FileObject
Gets a Writer for this file object.

Returns:
a Writer
Throws:
java.io.IOException - if an I/O error occurred

getName

@Deprecated
public java.lang.String getName()
Deprecated. see bug 6410637

Description copied from interface: FileObject
Gets a user-friendly name for this file object. The exact value returned is not specified but implementations should take care to preserve names as given by the user. For example, if the user writes the filename "BobsApp\Test.java" on the command line, this method should return "BobsApp\Test.java" whereas the toUri method might return file:///C:/Documents%20and%20Settings/UncleBob/BobsApp/Test.java.

Specified by:
getName in interface FileObject
Specified by:
getName in class BaseFileObject
Returns:
a user-friendly name

isNameCompatible

public boolean isNameCompatible(java.lang.String cn,
                                JavaFileObject.Kind k)
Description copied from interface: JavaFileObject
Checks if this file object is compatible with the specified simple name and kind. A simple name is a single identifier (not qualified) as defined in the Java Language Specification 3rd ed., section 6.2 "Names and Identifiers".

Parameters:
cn - a simple name of a class
k - a kind
Returns:
true if this file object is compatible; false otherwise

getPath

@Deprecated
public java.lang.String getPath()
Deprecated. see bug 6410637

Overrides:
getPath in class BaseFileObject

getLastModified

public long getLastModified()
Description copied from interface: FileObject
Gets the time this file object was last modified. The time is measured in milliseconds since the epoch (00:00:00 GMT, January 1, 1970).

Returns:
the time this file object was last modified; or 0 if the file object does not exist, if an I/O error occurred, or if the operation is not supported

delete

public boolean delete()
Description copied from interface: FileObject
Deletes this file object. In case of errors, returns false.

Returns:
true if and only if this file object is successfully deleted; false otherwise

equals

public boolean equals(java.lang.Object other)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

getZipName

public java.lang.String getZipName()

getZipEntryName

public java.lang.String getZipEntryName()

toUri

public java.net.URI toUri()
Description copied from interface: FileObject
Returns a URI identifying this file object.

Returns:
a URI

read

private byte[] read()
             throws java.io.IOException
Throws:
java.io.IOException

getCharContent

public java.nio.CharBuffer getCharContent(boolean ignoreEncodingErrors)
                                   throws java.io.IOException
Description copied from interface: FileObject
Gets the character content of this file object, if available. Any byte that cannot be decoded will be replaced by the default translation character. In addition, a diagnostic may be reported unless ignoreEncodingErrors is true.

Parameters:
ignoreEncodingErrors - ignore encoding errors if true
Returns:
a CharSequence if available; null otherwise
Throws:
java.io.IOException - if an I/O error occurred

inferBinaryName

protected java.lang.String inferBinaryName(java.lang.Iterable<? extends java.io.File> path)
Specified by:
inferBinaryName in class BaseFileObject