Method from com.sun.tools.javac.file.BaseFileObject Detail: |
protected static URI createJarUri(File jarFile,
String entryName) {
URI jarURI = jarFile.toURI().normalize();
String separator = entryName.startsWith("/") ? "!" : "!/";
try {
// The jar URI convention appears to be not to re-encode the jarURI
return new URI("jar:" + jarURI + separator + entryName);
} catch (URISyntaxException e) {
throw new CannotCreateUriError(jarURI + separator + entryName, e);
}
}
|
abstract public boolean equals(Object other)
|
public Modifier getAccessLevel() {
return null;
}
|
protected CharsetDecoder getDecoder(boolean ignoreEncodingErrors) {
throw new UnsupportedOperationException();
}
|
protected static Kind getKind(String filename) {
return BaseFileManager.getKind(filename);
}
|
public NestingKind getNestingKind() {
return null;
}
|
abstract public String getShortName()
Return a short name for the object, such as for use in raw diagnostics |
public static String getSimpleName(FileObject fo) {
URI uri = fo.toUri();
String s = uri.getSchemeSpecificPart();
return s.substring(s.lastIndexOf("/") + 1); // safe when / not found
}
Return the last component of a presumed hierarchical URI.
From the scheme specific part of the URI, it returns the substring
after the last "/" if any, or everything if no "/" is found. |
abstract public int hashCode()
|
abstract protected String inferBinaryName(Iterable<File> path)
|
public Reader openReader(boolean ignoreEncodingErrors) throws IOException {
return new InputStreamReader(openInputStream(), getDecoder(ignoreEncodingErrors));
}
|
protected static String removeExtension(String fileName) {
int lastDot = fileName.lastIndexOf(".");
return (lastDot == -1 ? fileName : fileName.substring(0, lastDot));
}
|
public String toString() {
return getClass().getSimpleName() + "[" + getName() + "]";
}
|