Method from com.sun.tools.javac.file.ZipArchive$ZipFileObject Detail: |
public boolean delete() {
throw new UnsupportedOperationException();
}
|
public boolean equals(Object other) {
if (this == other)
return true;
if (!(other instanceof ZipFileObject))
return false;
ZipFileObject o = (ZipFileObject) other;
return zarch.getAbsoluteFile().equals(o.zarch.getAbsoluteFile())
&& name.equals(o.name);
}
Check if two file objects are equal.
Two ZipFileObjects 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 = zarch.zfile.getInputStream(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);
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.getTime();
}
|
public String getName() {
return zarch.zfile.getName() + "(" + entry.getName() + ")";
}
|
public String getShortName() {
return new File(zarch.zfile.getName()).getName() + "(" + entry + ")";
}
|
public int hashCode() {
return zarch.getAbsoluteFile().hashCode() + name.hashCode();
}
|
protected String inferBinaryName(Iterable<File> path) {
String entryName = entry.getName();
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 {
return zarch.zfile.getInputStream(entry);
}
|
public OutputStream openOutputStream() throws IOException {
throw new UnsupportedOperationException();
}
|
public Writer openWriter() throws IOException {
throw new UnsupportedOperationException();
}
|
public URI toUri() {
File zipFile = new File(zarch.zfile.getName());
return createJarUri(zipFile, entry.getName());
}
|