static final FileId UNKNOWN
The name used for an unknown file. This is mostly only relevant for unit tests.
static final FileId STDIN
The virtual file ID for standard input.
String getFileName()
String getOriginalPath()
Return the path as it was input by the user. This may be a relative or absolute path.
String getAbsolutePath()
Return an absolute path to this file in its containing file system. If the file is in a zip file, then this returns a path from the zip root, and does not include the path of the zip itself.
String getUriString()
Return a string that looks like a URI pointing to this file.
@Nullable FileId getParentFsPath()
If this file is in a nested filesystem (eg a zip file), return the file ID of the container in the outer file system. Return null if this is in the root file system.
default int compareTo(FileId o)
compareTo
in interface Comparable<FileId>
@Deprecated String toString()
This method is intentionally only meant for debugging, and its output is unspecified. Code that needs a string representation should use one of the named string conversion methods.
static FileId fromPathLikeString(String str)
str
- A string. Should be a valid file system path for the platform (see Paths.get(String, String...)
.
static FileId fromPath(Path path, @Nullable FileId fsPath)
Return a new path id for the given path.
path
- The path
fsPath
- The file id of the containing file system, if it is some Zip file.
static FileId fromPath(Path path)
Return a file ID for the given path. This uses
fromPath(Path, FileId)
and defaults the second parameter to null.
static FileId asChildOf(FileId self, FileId parentFsPath)
Return a file ID whose methods behave the same as the first parameter, and whose
getParentFsPath()
returns the second parameter.
self
- A file id
parentFsPath
- Another file id for the parent.
static FileId fromAbsolutePath(String absPath, @Nullable FileId outer)
Return a file ID which interprets the first parameter as an absolute path. The path must be a valid path for this system (
Paths.get(String, String...)
should not fail). The URI is rebuilt using the outer file ID if it is non-null.
absPath
- Absolute path for the file
outer
- File ID of the outer file system (Zip), if it exists
static FileId fromURI(String uriStr) throws IllegalArgumentException
Return a file ID for a URI. The URI must have scheme
file
or
jar
and be a valid URI (see
URI.create(String)
). If the scheme is
jar
, then the
getParentFsPath()
is populated with the path of the jar.
uriStr
- A uri string
IllegalArgumentException
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4