| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(Path other)
Compares two abstract paths lexicographically.
|
boolean |
endsWith(Path other)
Tests if this path ends with the given path.
|
boolean |
endsWith(String other)
Tests if this path ends with the provided string.
|
boolean |
equals(Object other)
Tests this path for equality with the given object.
|
Path |
getFileName()
|
FileSystem |
getFileSystem()
Getter for
SMBFileSystem this SMBPath belongs to. |
Path |
getName(int index)
|
int |
getNameCount()
Returns the number of path components in the current
SMBPath's path. |
Path |
getParent()
|
Path |
getRoot()
Returns the root component of this
SMBPath or null, if the path is relative. |
boolean |
isAbsolute()
SMBPath is always absolute! |
boolean |
isFolder()
Checks whether the current
SMBPath is a folder. |
Iterator<Path> |
iterator()
Returns an iterator over the name elements of this
SMBPath. |
Path |
normalize()
Returns a path that is this path with redundant name elements, like "." or ".." eliminated.
|
WatchKey |
register(WatchService watcher,
WatchEvent.Kind<?>... events) |
WatchKey |
register(WatchService watcher,
WatchEvent.Kind<?>[] events,
WatchEvent.Modifier... modifiers) |
Path |
relativize(Path other)
Constructs a relative path between this path and a given path.
|
Path |
resolve(Path other)
Resolve the given path against this
SMBPath. |
Path |
resolve(String other)
Resolve the given path string against this
SMBPath. |
Path |
resolveSibling(Path other)
Resolve the given path against this
SMBPath's parent. |
Path |
resolveSibling(String other)
Resolve the given path string against this
SMBPath. |
boolean |
startsWith(Path other)
Tests if this path starts with the given path.
|
boolean |
startsWith(String other)
Tests if this path starts with the provided string.
|
Path |
subpath(int beginIndex,
int endIndex)
Returns a relative Path that is a subsequence of the name elements of this path.
|
Path |
toAbsolutePath()
If this
SMBPath is absolute then the method returns this. |
File |
toFile() |
Path |
toRealPath(LinkOption... options) |
String |
toString()
Default toString() method.
|
URI |
toUri()
Returns a URI to represent this
SMBPath. |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitforEach, spliteratorpublic final FileSystem getFileSystem()
SMBFileSystem this SMBPath belongs to.getFileSystem in interface PathSMBFileSystempublic final boolean isAbsolute()
SMBPath is always absolute!isAbsolute in interface Pathpublic Path getRoot()
SMBPath or null, if the path is relative.public Path getFileName()
SMBPath instance that just contains the last path component of the current SMBPath's path.getFileName in interface PathSMBPath for the file name.public Path getParent()
public int getNameCount()
SMBPath's path.getNameCount in interface Pathpublic Path getName(int index)
public Path subpath(int beginIndex, int endIndex)
subpath in interface PathbeginIndex - The index of the first element, inclusiveendIndex - The index of the last element, exclusiveIllegalArgumentException - If beginIndex is negative, or greater than or equal to the number of elements. If endIndex is less than or equal to beginIndex, or larger than the number of elements.public boolean startsWith(Path other)
FileSystem then this
method always returns false. Otherwise, a string comparison is performed.startsWith in interface Pathother - The given pathpublic boolean startsWith(String other)
startsWith in interface Pathother - The given pathpublic boolean endsWith(Path other)
FileSystem then this
method always returns false. Otherwise, a string comparison is performed.public boolean endsWith(String other)
public Path normalize()
public Path resolve(Path other)
SMBPath.
If the other parameter is an absolute path then this method trivially returns other. If other is an empty path then this method trivially returns this path.resolve in interface Pathother - The path to resolve against this pathSMBPathIllegalArgumentException - If other path is not a SMBPath OR does not belong to the same SMBFileSystem OR if this path points to a file.public Path resolve(String other)
SMBPath.
If the other parameter is an absolute path then this method trivially returns other. If other is an empty path then this method trivially returns this path.resolve in interface Pathother - The path to resolve against this pathSMBPathIllegalArgumentException - If other path is not a SMBPath OR does not belong to the same SMBFileSystem OR if this path points to a file.public Path resolveSibling(Path other)
SMBPath's parent.
If the other parameter is an absolute path then this method trivially returns other. If other is an empty path then this method trivially returns this path.resolveSibling in interface Pathother - The path to resolve against this pathSMBPathIllegalArgumentException - If other path is not a SMBPath OR does not belong to the same SMBFileSystem.public Path resolveSibling(String other)
SMBPath.
If the other parameter is an absolute path then this method trivially returns other. If other is an empty path then this method trivially returns this path.resolveSibling in interface Pathother - The path to resolve against this pathSMBPathIllegalArgumentException - If other path is not a SMBPath OR does not belong to the same SMBFileSystem OR if this path points to a file.public Path relativize(Path other)
relativize in interface Pathother - The other path.IllegalArgumentException - If other path is not a SMBPath OR does not belong to the same SMBFileSystem OR if this path points to a file.public Path toAbsolutePath()
SMBPath is absolute then the method returns this. Otherwise, the given path is resolved against the top-level directory.toAbsolutePath in interface PathSMBPathpublic Iterator<Path> iterator()
SMBPath.
The first element returned by the iterator represents the name element that is closest to the root in the directory hierarchy, the second element is the next closest,
and so on. The last element returned is the name of the file or directory denoted by this path. The root component, if present, is not returned by the iterator.public int compareTo(Path other)
compareTo in interface Comparable<Path>compareTo in interface Pathother - The path compared to this SMBPath.public String toString()
public boolean equals(Object other)
SMBPath, or is a SMBPath associated with a
different SMBFileSystem, then this method returns false.public boolean isFolder()
SMBPath is a folder.SMBPath is a folder.public Path toRealPath(LinkOption... options) throws IOException
toRealPath in interface PathIOExceptionpublic WatchKey register(WatchService watcher, WatchEvent.Kind<?>[] events, WatchEvent.Modifier... modifiers) throws IOException
register in interface Pathregister in interface WatchableIOExceptionpublic WatchKey register(WatchService watcher, WatchEvent.Kind<?>... events) throws IOException
register in interface Pathregister in interface WatchableIOExceptionCopyright © 2020 pontius software GmbH. All rights reserved.