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.StringasString()protected TasT()protected intcalculatedHashCode()protected TcheckPath(java.nio.file.Path paramPath)protected intcompare(java.lang.String s1, java.lang.String s2)intcompareTo(java.nio.file.Path paramPath)protected Tcreate(java.lang.String root, java.lang.String... names)protected Tcreate(java.lang.String root, java.util.Collection<java.lang.String> names)protected Tcreate(java.lang.String root, java.util.List<java.lang.String> names)booleanendsWith(java.lang.String other)booleanendsWith(java.nio.file.Path other)protected booleanendsWith(java.util.List<?> list, java.util.List<?> other)booleanequals(java.lang.Object obj)TgetFileName()FSgetFileSystem()TgetName(int index)intgetNameCount()TgetParent()TgetRoot()inthashCode()booleanisAbsolute()protected booleanisNormal()java.util.Iterator<java.nio.file.Path>iterator()Tnormalize()java.nio.file.WatchKeyregister(java.nio.file.WatchService watcher, java.nio.file.WatchEvent.Kind<?>... events)java.nio.file.WatchKeyregister(java.nio.file.WatchService watcher, java.nio.file.WatchEvent.Kind<?>[] events, java.nio.file.WatchEvent.Modifier... modifiers)Trelativize(java.nio.file.Path other)Tresolve(java.lang.String other)Tresolve(java.nio.file.Path other)java.nio.file.PathresolveSibling(java.lang.String other)java.nio.file.PathresolveSibling(java.nio.file.Path other)booleanstartsWith(java.lang.String other)booleanstartsWith(java.nio.file.Path other)protected booleanstartsWith(java.util.List<?> list, java.util.List<?> other)Tsubpath(int beginIndex, int endIndex)TtoAbsolutePath()java.io.FiletoFile()java.lang.StringtoString()java.net.URItoUri()
-
-
-
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
public 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:
getFileSystemin interfacejava.nio.file.Path
-
isAbsolute
public boolean isAbsolute()
- Specified by:
isAbsolutein interfacejava.nio.file.Path
-
getRoot
public T getRoot()
- Specified by:
getRootin interfacejava.nio.file.Path
-
getFileName
public T getFileName()
- Specified by:
getFileNamein interfacejava.nio.file.Path
-
getParent
public T getParent()
- Specified by:
getParentin interfacejava.nio.file.Path
-
getNameCount
public int getNameCount()
- Specified by:
getNameCountin interfacejava.nio.file.Path
-
getName
public T getName(int index)
- Specified by:
getNamein interfacejava.nio.file.Path
-
subpath
public T subpath(int beginIndex, int endIndex)
- Specified by:
subpathin 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:
startsWithin interfacejava.nio.file.Path
-
startsWith
public boolean startsWith(java.lang.String other)
- Specified by:
startsWithin 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:
endsWithin interfacejava.nio.file.Path
-
endsWith
public boolean endsWith(java.lang.String other)
- Specified by:
endsWithin interfacejava.nio.file.Path
-
isNormal
protected boolean isNormal()
-
normalize
public T normalize()
- Specified by:
normalizein interfacejava.nio.file.Path
-
resolve
public T resolve(java.nio.file.Path other)
- Specified by:
resolvein interfacejava.nio.file.Path
-
resolve
public T resolve(java.lang.String other)
- Specified by:
resolvein interfacejava.nio.file.Path
-
resolveSibling
public java.nio.file.Path resolveSibling(java.nio.file.Path other)
- Specified by:
resolveSiblingin interfacejava.nio.file.Path
-
resolveSibling
public java.nio.file.Path resolveSibling(java.lang.String other)
- Specified by:
resolveSiblingin interfacejava.nio.file.Path
-
relativize
public T relativize(java.nio.file.Path other)
- Specified by:
relativizein interfacejava.nio.file.Path
-
toAbsolutePath
public T toAbsolutePath()
- Specified by:
toAbsolutePathin interfacejava.nio.file.Path
-
toUri
public java.net.URI toUri()
- Specified by:
toUriin interfacejava.nio.file.Path
-
toFile
public java.io.File toFile()
- Specified by:
toFilein 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:
registerin interfacejava.nio.file.Path- Specified by:
registerin 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:
registerin interfacejava.nio.file.Path- Specified by:
registerin 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:
hashCodein interfacejava.nio.file.Path- Overrides:
hashCodein classjava.lang.Object
-
calculatedHashCode
protected int calculatedHashCode()
-
equals
public boolean equals(java.lang.Object obj)
- Specified by:
equalsin interfacejava.nio.file.Path- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Specified by:
toStringin interfacejava.nio.file.Path- Overrides:
toStringin classjava.lang.Object
-
asString
protected java.lang.String asString()
-
-