Package org.apache.sshd.common.file.util
Class BasePath<T extends BasePath<T,FS>,FS extends BaseFileSystem<T>>
- java.lang.Object
-
- org.apache.sshd.common.file.util.BasePath<T,FS>
-
- All Implemented Interfaces:
java.lang.Comparable<java.nio.file.Path>
,java.lang.Iterable<java.nio.file.Path>
,java.nio.file.Path
,java.nio.file.Watchable
- Direct Known Subclasses:
RootedPath
,SftpPath
public abstract class BasePath<T extends BasePath<T,FS>,FS extends BaseFileSystem<T>> extends java.lang.Object implements java.nio.file.Path
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.String
asString()
protected T
asT()
protected int
calculatedHashCode()
protected T
checkPath(java.nio.file.Path paramPath)
protected int
compare(java.lang.String s1, java.lang.String s2)
int
compareTo(java.nio.file.Path paramPath)
protected T
create(java.lang.String root, java.lang.String... names)
protected T
create(java.lang.String root, java.util.Collection<java.lang.String> names)
protected T
create(java.lang.String root, java.util.List<java.lang.String> names)
boolean
endsWith(java.lang.String other)
boolean
endsWith(java.nio.file.Path other)
protected boolean
endsWith(java.util.List<?> list, java.util.List<?> other)
boolean
equals(java.lang.Object obj)
T
getFileName()
FS
getFileSystem()
T
getName(int index)
int
getNameCount()
T
getParent()
T
getRoot()
int
hashCode()
boolean
isAbsolute()
protected boolean
isNormal()
java.util.Iterator<java.nio.file.Path>
iterator()
T
normalize()
java.nio.file.WatchKey
register(java.nio.file.WatchService watcher, java.nio.file.WatchEvent.Kind<?>... events)
java.nio.file.WatchKey
register(java.nio.file.WatchService watcher, java.nio.file.WatchEvent.Kind<?>[] events, java.nio.file.WatchEvent.Modifier... modifiers)
T
relativize(java.nio.file.Path other)
T
resolve(java.lang.String other)
T
resolve(java.nio.file.Path other)
java.nio.file.Path
resolveSibling(java.lang.String other)
java.nio.file.Path
resolveSibling(java.nio.file.Path other)
boolean
startsWith(java.lang.String other)
boolean
startsWith(java.nio.file.Path other)
protected boolean
startsWith(java.util.List<?> list, java.util.List<?> other)
T
subpath(int beginIndex, int endIndex)
T
toAbsolutePath()
java.io.File
toFile()
java.lang.String
toString()
java.net.URI
toUri()
-
-
-
Field Detail
-
root
protected final java.lang.String root
-
names
protected final java.util.List<java.lang.String> names
-
fileSystem
private final FS extends BaseFileSystem<T> fileSystem
-
strValue
private java.lang.String strValue
-
hashValue
private int hashValue
-
-
Constructor Detail
-
BasePath
protected BasePath(FS fileSystem, java.lang.String root, java.util.List<java.lang.String> names)
-
-
Method Detail
-
asT
protected T asT()
-
create
protected T create(java.lang.String root, java.lang.String... names)
-
create
protected T create(java.lang.String root, java.util.Collection<java.lang.String> names)
-
create
protected T create(java.lang.String root, java.util.List<java.lang.String> names)
-
getFileSystem
public FS getFileSystem()
- Specified by:
getFileSystem
in interfacejava.nio.file.Path
-
isAbsolute
public boolean isAbsolute()
- Specified by:
isAbsolute
in interfacejava.nio.file.Path
-
getRoot
public T getRoot()
- Specified by:
getRoot
in interfacejava.nio.file.Path
-
getFileName
public T getFileName()
- Specified by:
getFileName
in interfacejava.nio.file.Path
-
getParent
public T getParent()
- Specified by:
getParent
in interfacejava.nio.file.Path
-
getNameCount
public int getNameCount()
- Specified by:
getNameCount
in interfacejava.nio.file.Path
-
getName
public T getName(int index)
- Specified by:
getName
in interfacejava.nio.file.Path
-
subpath
public T subpath(int beginIndex, int endIndex)
- Specified by:
subpath
in interfacejava.nio.file.Path
-
startsWith
protected boolean startsWith(java.util.List<?> list, java.util.List<?> other)
-
startsWith
public boolean startsWith(java.nio.file.Path other)
- Specified by:
startsWith
in interfacejava.nio.file.Path
-
startsWith
public boolean startsWith(java.lang.String other)
- Specified by:
startsWith
in interfacejava.nio.file.Path
-
endsWith
protected boolean endsWith(java.util.List<?> list, java.util.List<?> other)
-
endsWith
public boolean endsWith(java.nio.file.Path other)
- Specified by:
endsWith
in interfacejava.nio.file.Path
-
endsWith
public boolean endsWith(java.lang.String other)
- Specified by:
endsWith
in interfacejava.nio.file.Path
-
isNormal
protected boolean isNormal()
-
normalize
public T normalize()
- Specified by:
normalize
in interfacejava.nio.file.Path
-
resolve
public T resolve(java.nio.file.Path other)
- Specified by:
resolve
in interfacejava.nio.file.Path
-
resolve
public T resolve(java.lang.String other)
- Specified by:
resolve
in interfacejava.nio.file.Path
-
resolveSibling
public java.nio.file.Path resolveSibling(java.nio.file.Path other)
- Specified by:
resolveSibling
in interfacejava.nio.file.Path
-
resolveSibling
public java.nio.file.Path resolveSibling(java.lang.String other)
- Specified by:
resolveSibling
in interfacejava.nio.file.Path
-
relativize
public T relativize(java.nio.file.Path other)
- Specified by:
relativize
in interfacejava.nio.file.Path
-
toAbsolutePath
public T toAbsolutePath()
- Specified by:
toAbsolutePath
in interfacejava.nio.file.Path
-
toUri
public java.net.URI toUri()
- Specified by:
toUri
in interfacejava.nio.file.Path
-
toFile
public java.io.File toFile()
- Specified by:
toFile
in interfacejava.nio.file.Path
-
register
public java.nio.file.WatchKey register(java.nio.file.WatchService watcher, java.nio.file.WatchEvent.Kind<?>... events) throws java.io.IOException
- Specified by:
register
in interfacejava.nio.file.Path
- Specified by:
register
in interfacejava.nio.file.Watchable
- Throws:
java.io.IOException
-
register
public java.nio.file.WatchKey register(java.nio.file.WatchService watcher, java.nio.file.WatchEvent.Kind<?>[] events, java.nio.file.WatchEvent.Modifier... modifiers) throws java.io.IOException
- Specified by:
register
in interfacejava.nio.file.Path
- Specified by:
register
in interfacejava.nio.file.Watchable
- Throws:
java.io.IOException
-
iterator
public java.util.Iterator<java.nio.file.Path> iterator()
-
compareTo
public int compareTo(java.nio.file.Path paramPath)
-
compare
protected int compare(java.lang.String s1, java.lang.String s2)
-
checkPath
protected T checkPath(java.nio.file.Path paramPath)
-
hashCode
public int hashCode()
- Specified by:
hashCode
in interfacejava.nio.file.Path
- Overrides:
hashCode
in classjava.lang.Object
-
calculatedHashCode
protected int calculatedHashCode()
-
equals
public boolean equals(java.lang.Object obj)
- Specified by:
equals
in interfacejava.nio.file.Path
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Specified by:
toString
in interfacejava.nio.file.Path
- Overrides:
toString
in classjava.lang.Object
-
asString
protected java.lang.String asString()
-
-