Method from com.sun.tools.javac.file.ZipFileIndexArchive$ZipFileIndexFileObject Detail: |
public boolean delete() {
throw new UnsupportedOperationException();
}
|
public boolean equals(Object other) {
if (this == other)
return true;
if (!(other instanceof ZipFileIndexFileObject))
return false;
ZipFileIndexFileObject o = (ZipFileIndexFileObject) other;
return zfIndex.getAbsoluteFile().equals(o.zfIndex.getAbsoluteFile())
&& name.equals(o.name);
}
Check if two file objects are equal.
Two ZipFileIndexFileObjects are equal if the absolute paths of the underlying
zip files are equal and if the paths within those zip files are equal. |
public CharBuffer getCharContent(boolean ignoreEncodingErrors) throws IOException {
CharBuffer cb = fileManager.getCachedContent(this);
if (cb == null) {
InputStream in = new ByteArrayInputStream(zfIndex.read(entry));
try {
ByteBuffer bb = fileManager.makeByteBuffer(in);
JavaFileObject prev = fileManager.log.useSource(this);
try {
cb = fileManager.decode(bb, ignoreEncodingErrors);
} finally {
fileManager.log.useSource(prev);
}
fileManager.recycleByteBuffer(bb); // save for next time
if (!ignoreEncodingErrors)
fileManager.cache(this, cb);
} finally {
in.close();
}
}
return cb;
}
|
protected CharsetDecoder getDecoder(boolean ignoreEncodingErrors) {
return fileManager.getDecoder(fileManager.getEncodingName(), ignoreEncodingErrors);
}
|
public Kind getKind() {
return getKind(entry.getName());
}
|
public long getLastModified() {
return entry.getLastModified();
}
|
public String getName() {
return zipName + "(" + getPrefixedEntryName() + ")";
}
|
public String getShortName() {
return zipName.getName() + "(" + entry.getName() + ")";
}
|
public int hashCode() {
return zfIndex.getAbsoluteFile().hashCode() + name.hashCode();
}
|
protected String inferBinaryName(Iterable<File> path) {
String entryName = entry.getName();
if (zfIndex.symbolFilePrefix != null) {
String prefix = zfIndex.symbolFilePrefix.path;
if (entryName.startsWith(prefix))
entryName = entryName.substring(prefix.length());
}
return removeExtension(entryName).replace('/', '.');
}
|
public boolean isNameCompatible(String cn,
Kind k) {
cn.getClass(); // null check
if (k == Kind.OTHER && getKind() != k)
return false;
return name.equals(cn + k.extension);
}
|
public InputStream openInputStream() throws IOException {
if (inputStream == null) {
Assert.checkNonNull(entry); // see constructor
inputStream = new ByteArrayInputStream(zfIndex.read(entry));
}
return inputStream;
}
|
public OutputStream openOutputStream() throws IOException {
throw new UnsupportedOperationException();
}
|
public Writer openWriter() throws IOException {
throw new UnsupportedOperationException();
}
|
public URI toUri() {
return createJarUri(zipName, getPrefixedEntryName());
}
|