PathFileObjects are, for the most part, straightforward wrappers around immutable absolute Path objects. Different subtypes are used to provide specialized implementations of "inferBinaryName" and "getName" that capture additional information available at the time the object is created.
In general, JavaFileManager#isSameFile should be used to
determine whether two file objects refer to the same file on disk.
PathFileObject also supports the standard equals and hashCode
methods, primarily for convenience when working with collections.
All of these operations delegate to the equivalent operations on the
underlying Path object.
This is NOT part of any supported API. If you write code that depends on this, you do so at your own risk. This code and its internal interfaces are subject to change or deletion without notice.
| Modifier and Type | Class and Description |
|---|---|
| public static class | PathFileObject.
Used when URLSyntaxException is thrown unexpectedly during implementations of FileObject.toURI(). |
| private static class | |
| private static class | |
| private static class | |
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private static final FileSystem | |
| protected final BaseFileManager | |
| private boolean | |
| private static final boolean | |
| protected final Path |
| Access | Constructor and Description |
|---|---|
| protected | PathFileObject(BaseFileManager
the file manager creating this file object fileManager, Path the path contained in this file object. path)Create a PathFileObject, for a specified path, in the context of a given file manager. |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | |
| private void | |
| public boolean | equals(Object other)
Overrides java. Indicates whether some other object is "equal to" this one. |
| pack-priv static PathFileObject | forDirectoryPath(BaseFileManager
the file manager creating this file object fileManager, Path the absolute path referred to by this file object path, Path the path of the directory containing the
root of the package hierarchy userPackageRootDir, RelativePath the path of this file relative to relativePath)userPackageRootDirCreate a PathFileObject for a file within a directory, such that the binary name can be inferred from the relationship to an enclosing directory. |
| public static PathFileObject | Returns: the file objectthe file manager creating this file object fileManager, Path the path referred to by this file object path, Path the path of the jar file containing the file system. userJarPath)Create a PathFileObject for a file in a file system such as a jar file, such that the binary name can be inferred from its position within the file system. |
| public static PathFileObject | Returns: the file objectthe file manager creating this file object fileManager, final Path the path referred to by this file object path)Create a PathFileObject for a file in a modular file system, such as jrt:, such that the binary name can be inferred from its position within the filesystem. |
| pack-priv static PathFileObject | forSimplePath(BaseFileManager
the file manager creating this file object fileManager, Path the path referred to by this file object path, Path the "user-friendly" name for this path. userPath)Create a PathFileObject for a file whose binary name must be inferred from its position on a search path. |
| public Modifier | getAccessLevel()
Implements javax. Provides a hint about the access level of the class represented by this file object. |
| public CharSequence | getCharContent(boolean ignoreEncodingErrors)
Implements javax. Returns the character content of this file object, if available. |
| public JavaFileObject. | |
| public long | getLastModified()
Implements javax. Returns the time this file object was last modified. |
| public NestingKind | getNestingKind()
Implements javax. Provides a hint about the nesting level of the class represented by this file object. |
| public Path | |
| public String | Returns: the last component of the pathThe short name is used when generating raw diagnostics. |
| pack-priv abstract PathFileObject | |
| public static String | Returns: the simple name of the file objectthe file object fo)Return the last component of a presumed hierarchical URI. |
| public int | |
| pack-priv abstract String | |
| pack-priv boolean | |
| public boolean | isNameCompatible(String simpleName, JavaFileObject.
Implements javax. Checks if this file object is compatible with the specified simple name and kind. |
| protected boolean | |
| pack-priv boolean | |
| public InputStream | openInputStream()
Implements javax. Returns an InputStream for this file object. |
| public OutputStream | openOutputStream()
Implements javax. Returns an OutputStream for this file object. |
| public Reader | openReader(boolean ignoreEncodingErrors)
Implements javax. Returns a reader for this object. |
| public Writer | |
| private static String | |
| protected static String | |
| protected static String | |
| private static String | |
| public String | |
| public URI |