Package org.uberfire.java.nio.base
Class AbstractPath<FS extends FileSystem>
- java.lang.Object
-
- org.uberfire.java.nio.base.AbstractPath<FS>
-
- All Implemented Interfaces:
Comparable<Path>,Iterable<Path>,AttrHolder,Path,Watchable
- Direct Known Subclasses:
GeneralPathImpl
public abstract class AbstractPath<FS extends FileSystem> extends Object implements Path, AttrHolder
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAbstractPath.RootInfo
-
Field Summary
Fields Modifier and Type Field Description protected AttrsStorageattrsStoragestatic StringDEFAULT_WINDOWS_DRIVERprotected Filefileprotected FSfsprotected Stringhostprotected booleanisAbsoluteprotected booleanisNormalizedprotected booleanisRealPathprotected booleanisRootprotected List<org.uberfire.commons.data.Pair<Integer,Integer>>offsetsprotected byte[]pathprotected StringtoStringFormatprotected booleanusesWindowsFormatstatic PatternWINDOWS_DRIVER
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractPath(FS fs, File file)protectedAbstractPath(FS fs, String path, String host, boolean isRoot, boolean isRealPath, boolean isNormalized)
-
Method Summary
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Field Detail
-
WINDOWS_DRIVER
public static final Pattern WINDOWS_DRIVER
-
DEFAULT_WINDOWS_DRIVER
public static final String DEFAULT_WINDOWS_DRIVER
- See Also:
- Constant Field Values
-
fs
protected final FS extends FileSystem fs
-
usesWindowsFormat
protected final boolean usesWindowsFormat
-
isAbsolute
protected final boolean isAbsolute
-
path
protected final byte[] path
-
isRoot
protected final boolean isRoot
-
isRealPath
protected final boolean isRealPath
-
isNormalized
protected final boolean isNormalized
-
host
protected final String host
-
attrsStorage
protected final AttrsStorage attrsStorage
-
toStringFormat
protected String toStringFormat
-
file
protected File file
-
-
Method Detail
-
newPath
protected abstract Path newPath(FS fs, String substring, String host, boolean realPath, boolean isNormalized)
-
setupRoot
protected abstract AbstractPath.RootInfo setupRoot(FS fs, String path, String host, boolean isRoot)
-
getFileSystem
public FS 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
-
getName
public Path getName(int index) throws IllegalArgumentException
- Specified by:
getNamein interfacePath- Throws:
IllegalArgumentException
-
subpath
public Path subpath(int beginIndex, int endIndex) throws IllegalArgumentException
- Specified by:
subpathin interfacePath- Throws:
IllegalArgumentException
-
toUri
public URI toUri() throws IOException, SecurityException
- Specified by:
toUriin interfacePath- Throws:
IOExceptionSecurityException
-
toAbsolutePath
public Path toAbsolutePath() throws IOException, SecurityException
- Specified by:
toAbsolutePathin interfacePath- Throws:
IOExceptionSecurityException
-
defaultDirectory
protected abstract String defaultDirectory()
-
toRealPath
public Path toRealPath(LinkOption... options) throws IOException, SecurityException
- Specified by:
toRealPathin interfacePath- Throws:
IOExceptionSecurityException
-
iterator
public Iterator<Path> iterator()
- Specified by:
iteratorin interfaceIterable<FS extends FileSystem>
-
startsWith
public boolean startsWith(Path other)
- Specified by:
startsWithin interfacePath
-
startsWith
public boolean startsWith(String other) throws InvalidPathException
- Specified by:
startsWithin interfacePath- Throws:
InvalidPathException
-
endsWith
public boolean endsWith(String other) throws InvalidPathException
- Specified by:
endsWithin interfacePath- Throws:
InvalidPathException
-
resolve
public Path resolve(String other) throws InvalidPathException
- Specified by:
resolvein interfacePath- Throws:
InvalidPathException
-
resolveSibling
public Path resolveSibling(Path other)
- Specified by:
resolveSiblingin interfacePath
-
resolveSibling
public Path resolveSibling(String other) throws InvalidPathException
- Specified by:
resolveSiblingin interfacePath- Throws:
InvalidPathException
-
relativize
public Path relativize(Path otherx) throws IllegalArgumentException
- Specified by:
relativizein interfacePath- Throws:
IllegalArgumentException
-
compareTo
public int compareTo(Path other)
- Specified by:
compareToin interfaceComparable<FS extends FileSystem>
-
register
public WatchKey register(WatchService watcher, WatchEvent.Kind<?>[] events, WatchEvent.Modifier... modifiers) throws UnsupportedOperationException, IllegalArgumentException, ClosedWatchServiceException, IOException, SecurityException
- Specified by:
registerin interfaceWatchable- Throws:
UnsupportedOperationExceptionIllegalArgumentExceptionClosedWatchServiceExceptionIOExceptionSecurityException
-
register
public WatchKey register(WatchService watcher, WatchEvent.Kind<?>... events) throws UnsupportedOperationException, IllegalArgumentException, ClosedWatchServiceException, IOException, SecurityException
- Specified by:
registerin interfaceWatchable- Throws:
UnsupportedOperationExceptionIllegalArgumentExceptionClosedWatchServiceExceptionIOExceptionSecurityException
-
toString
public String toString(boolean addHost)
-
clearCache
public void clearCache()
-
getHost
public String getHost()
-
isRealPath
public boolean isRealPath()
-
getAttrStorage
public AttrsStorage getAttrStorage()
- Specified by:
getAttrStoragein interfaceAttrHolder
-
addAttrView
public <V extends AttributeView> void addAttrView(V view)
- Specified by:
addAttrViewin interfaceAttrHolder
-
getAttrView
public <V extends AttributeView> V getAttrView(Class<V> type)
- Specified by:
getAttrViewin interfaceAttrHolder
-
getAttrView
public <V extends AttributeView> V getAttrView(String name)
- Specified by:
getAttrViewin interfaceAttrHolder
-
-