Package com.mastfrog.util.path
Class ComponentUPath
java.lang.Object
com.mastfrog.util.path.ComponentUPath
- Author:
- Tim Boudreau
-
Method Summary
Modifier and TypeMethodDescriptionintProvides consistent, platform-indepenedent ordering: absolute is greater than non-absolute; greater name count is greater than lesser name count; if same name count, name elements are compared as case-sensitive strings.booleanbooleanbooleangetName(int index) intgetRoot()inthashCode()booleanbooleanisEmpty()booleanisExtension(String ext) booleanDetermine if this path contains no "." or ".." elements.iterator()rawName()register(WatchService watcher, WatchEvent.Kind<?>... events) register(WatchService watcher, WatchEvent.Kind<?>[] events, WatchEvent.Modifier... modifiers) relativize(Path other) resolveSibling(String other) resolveSibling(Path other) booleanstartsWith(String other) booleanstartsWith(Path other) subpath(int beginIndex, int endIndex) toFile()Convert this path to the native equivalent retrieved from Paths.get() (if this involves Windows drive letters, all bets are off).toRealPath(LinkOption... options) toString()toString(char sep) toUri()intvisitNames(Consumer<String> consumer) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
toRelativePath
- Specified by:
toRelativePathin interfaceUnixPath
-
toString
-
iterator
-
toString
-
toRealPath
- Specified by:
toRealPathin interfacePath- Throws:
IOException
-
toAbsolutePath
- Specified by:
toAbsolutePathin interfacePath- Specified by:
toAbsolutePathin interfaceUnixPath
-
isEmpty
public boolean isEmpty() -
relativize
- Specified by:
relativizein interfacePath- Specified by:
relativizein interfaceUnixPath
-
toNativePath
Description copied from interface:UnixPathConvert this path to the native equivalent retrieved from Paths.get() (if this involves Windows drive letters, all bets are off).- Specified by:
toNativePathin interfaceUnixPath- Returns:
- A native path suitable for use with Files
-
isNormalized
public boolean isNormalized()Description copied from interface:UnixPathDetermine if this path contains no "." or ".." elements.- Specified by:
isNormalizedin interfaceUnixPath- Returns:
- True if the path is normalized
-
extension
-
rawName
-
isExtension
- Specified by:
isExtensionin interfaceUnixPath
-
resolveSibling
- Specified by:
resolveSiblingin interfacePath- Specified by:
resolveSiblingin interfaceUnixPath
-
resolve
-
resolve
-
normalize
-
resolveSibling
- Specified by:
resolveSiblingin interfacePath- Specified by:
resolveSiblingin interfaceUnixPath
-
subpath
-
getName
-
getParent
-
getRoot
-
getFileSystem
- Specified by:
getFileSystemin interfacePath
-
isAbsolute
public boolean isAbsolute()- Specified by:
isAbsolutein interfacePath
-
getFileName
- Specified by:
getFileNamein interfacePath- Specified by:
getFileNamein interfaceUnixPath
-
getNameCount
public int getNameCount()- Specified by:
getNameCountin interfacePath
-
startsWith
- Specified by:
startsWithin interfacePath
-
startsWith
- Specified by:
startsWithin interfacePath
-
endsWith
-
endsWith
-
toUri
-
toFile
-
register
public WatchKey register(WatchService watcher, WatchEvent.Kind<?>[] events, WatchEvent.Modifier... modifiers) throws IOException - Specified by:
registerin interfacePath- Specified by:
registerin interfaceWatchable- Throws:
IOException
-
register
- Specified by:
registerin interfacePath- Specified by:
registerin interfaceWatchable- Throws:
IOException
-
visitNames
- Specified by:
visitNamesin interfaceUnixPath
-
compareTo
Description copied from interface:UnixPathProvides consistent, platform-indepenedent ordering: absolute is greater than non-absolute; greater name count is greater than lesser name count; if same name count, name elements are compared as case-sensitive strings. -
equals
-
hashCode
public int hashCode()
-