@NotThreadSafe @DefaultAnnotation(value=edu.umd.cs.findbugs.annotations.NonNull.class) final class TPathScanner extends Object
URIs for prospective archive files with the help
of a TArchiveDetector.
Note that this class has no dependencies on other classes in this package,
so it could get published as a member of the package
de.schlichtherle.truezip.file instead if required.
| Modifier and Type | Field and Description |
|---|---|
private TArchiveDetector |
detector |
(package private) static String |
DOT_DOT_SEPARATOR |
(package private) static URI |
DOT_DOT_URI |
(package private) static URI |
DOT_URI |
private String |
memberQuery |
private FsPath |
root |
(package private) static URI |
SEPARATOR_URI |
private Paths.Splitter |
splitter |
private UriBuilder |
uri |
| Constructor and Description |
|---|
TPathScanner(TArchiveDetector detector)
Constructs a new URI scanner which uses the given
TArchiveDetector. |
| Modifier and Type | Method and Description |
|---|---|
(package private) static URI |
checkFix(URI uri) |
private static URI |
fixChecked(URI uri) |
(package private) static URI |
fixUnchecked(URI uri) |
(package private) static boolean |
isAbsolute(URI uri) |
(package private) static FsPath |
parent(FsPath path)
Returns the parent of the given file system path.
|
(package private) static int |
pathPrefixLength(URI uri) |
(package private) FsPath |
scan(FsPath parent,
URI member)
Constructs a new
FsPath from the given parent and scans
the given member for prospective archive files. |
private FsPath |
scan(String path) |
private final TArchiveDetector detector
static final String DOT_DOT_SEPARATOR
static final URI DOT_DOT_URI
static final URI DOT_URI
private String memberQuery
private FsPath root
static final URI SEPARATOR_URI
private final Paths.Splitter splitter
private final UriBuilder uri
TPathScanner(TArchiveDetector detector)
TArchiveDetector.detector - the archive detector to use.static URI checkFix(URI uri) throws URISyntaxException
URISyntaxExceptionstatic boolean isAbsolute(URI uri)
@Nullable static FsPath parent(FsPath path) throws URISyntaxException
path - a file system path.URISyntaxExceptionstatic int pathPrefixLength(URI uri)
FsPath scan(FsPath parent, URI member)
FsPath from the given parent and scans
the given member for prospective archive files.
member must not be opaque and must not define a fragment
component.
A scheme component gets ignored.
If an authority component or an absolute path is present, the authority
and path components of parent get discarded.
An authority component gets copied to the result.
A path component gets normalized and scanned for prospective archive
files using the TArchiveDetector provided to the constructor and
rewritten according to the syntax constraints for an FsPath.
".." segments at the beginning of the normalized path component
are resolved against the scheme specific part of parent
according to the syntax constraints for an FsPath.
A query component is copied to the result.
parent - the file system path to use as the parent.member - the URI to scan for prospective archive files.parent and
member, possibly decorated as an opaque URI to address
prospective archive files.IllegalArgumentException - if any precondition is violated.private FsPath scan(String path) throws URISyntaxException
URISyntaxExceptionCopyright © 2004-2011 Schlichtherle IT Services. All Rights Reserved.