Package io.quarkus.fs.util.base
Class DelegatingPath
- java.lang.Object
-
- io.quarkus.fs.util.base.DelegatingPath
-
- Direct Known Subclasses:
PathWrapper
public abstract class DelegatingPath extends Object implements Path
Base Implementation of a Path delegating most operations to another Path.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedDelegatingPath(Path delegate)
-
Method Summary
-
-
-
Field Detail
-
delegate
protected final Path delegate
-
-
Constructor Detail
-
DelegatingPath
protected DelegatingPath(Path delegate)
- Parameters:
delegate- the Path to delegate to. May not be null.
-
-
Method Detail
-
unwrap
public static Path unwrap(Path path)
Helper method to unwrap aDelegatingPathto the specific Path implementation. Some providers do internal checks to make sure that a Path is compatible with a FS. E.g. a WindowsFileSystem only works with WindowsPaths- Parameters:
path-- Returns:
- unwrapped path, or the original one if not an instance of DelegatingPath
-
getDelegate
public Path getDelegate()
-
startsWith
public boolean startsWith(String other)
- Specified by:
startsWithin interfacePath
-
resolveSibling
public Path resolveSibling(Path other)
- Specified by:
resolveSiblingin interfacePath
-
resolveSibling
public Path resolveSibling(String other)
- Specified by:
resolveSiblingin interfacePath
-
register
public WatchKey register(WatchService watcher, WatchEvent.Kind<?>... events) throws IOException
- Specified by:
registerin interfacePath- Specified by:
registerin interfaceWatchable- Throws:
IOException
-
getFileSystem
public FileSystem getFileSystem()
- Specified by:
getFileSystemin interfacePath
-
isAbsolute
public boolean isAbsolute()
- Specified by:
isAbsolutein interfacePath
-
getFileName
public Path getFileName()
- Specified by:
getFileNamein interfacePath
-
getNameCount
public int getNameCount()
- Specified by:
getNameCountin interfacePath
-
startsWith
public boolean startsWith(Path other)
- Specified by:
startsWithin interfacePath
-
relativize
public Path relativize(Path other)
- Specified by:
relativizein interfacePath
-
toAbsolutePath
public Path toAbsolutePath()
- Specified by:
toAbsolutePathin interfacePath
-
toRealPath
public Path toRealPath(LinkOption... options) throws IOException
- Specified by:
toRealPathin interfacePath- Throws:
IOException
-
register
public WatchKey register(WatchService watcher, WatchEvent.Kind<?>[] events, WatchEvent.Modifier... modifiers) throws IOException
- Specified by:
registerin interfacePath- Specified by:
registerin interfaceWatchable- Throws:
IOException
-
compareTo
public int compareTo(Path other)
- Specified by:
compareToin interfaceComparable<Path>- Specified by:
compareToin interfacePath
-
toString
public String toString()
-
spliterator
public Spliterator<Path> spliterator()
- Specified by:
spliteratorin interfaceIterable<Path>
-
equals
public boolean equals(Object o)
-
-