Package org.apache.sshd.common.file.util
Class BaseFileSystem<T extends java.nio.file.Path>
- java.lang.Object
-
- java.nio.file.FileSystem
-
- org.apache.sshd.common.file.util.BaseFileSystem<T>
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
- Direct Known Subclasses:
RootedFileSystem,SftpFileSystem
public abstract class BaseFileSystem<T extends java.nio.file.Path> extends java.nio.file.FileSystem
-
-
Field Summary
Fields Modifier and Type Field Description private java.nio.file.spi.FileSystemProviderfileSystemProviderprotected org.slf4j.Loggerlog
-
Constructor Summary
Constructors Modifier Constructor Description protectedBaseFileSystem(java.nio.file.spi.FileSystemProvider fileSystemProvider)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidappendDedupSep(java.lang.StringBuilder sb, java.lang.CharSequence s)protected Tcreate(java.lang.String root, java.lang.String... names)protected Tcreate(java.lang.String root, java.util.Collection<java.lang.String> names)protected abstract Tcreate(java.lang.String root, java.util.List<java.lang.String> names)TgetDefaultDir()java.lang.Iterable<java.nio.file.FileStore>getFileStores()TgetPath(java.lang.String first, java.lang.String... more)java.nio.file.PathMatchergetPathMatcher(java.lang.String syntaxAndPattern)java.lang.Iterable<java.nio.file.Path>getRootDirectories()java.lang.StringgetSeparator()protected java.lang.StringglobToRegex(java.lang.String pattern)protected java.lang.StringhandleWindowsSeparator(java.lang.String name)In case we are running on Windows, accept "\\" as a file separator.protected booleanhostFsHasWindowsSeparator()booleanisReadOnly()java.nio.file.WatchServicenewWatchService()java.nio.file.spi.FileSystemProviderprovider()
-
-
-
Method Detail
-
getDefaultDir
public T getDefaultDir()
-
isReadOnly
public boolean isReadOnly()
- Specified by:
isReadOnlyin classjava.nio.file.FileSystem
-
provider
public java.nio.file.spi.FileSystemProvider provider()
- Specified by:
providerin classjava.nio.file.FileSystem
-
getSeparator
public java.lang.String getSeparator()
- Specified by:
getSeparatorin classjava.nio.file.FileSystem
-
getRootDirectories
public java.lang.Iterable<java.nio.file.Path> getRootDirectories()
- Specified by:
getRootDirectoriesin classjava.nio.file.FileSystem
-
getFileStores
public java.lang.Iterable<java.nio.file.FileStore> getFileStores()
- Specified by:
getFileStoresin classjava.nio.file.FileSystem
-
getPath
public T getPath(java.lang.String first, java.lang.String... more)
- Specified by:
getPathin classjava.nio.file.FileSystem
-
appendDedupSep
protected void appendDedupSep(java.lang.StringBuilder sb, java.lang.CharSequence s)
-
handleWindowsSeparator
protected java.lang.String handleWindowsSeparator(java.lang.String name)
In case we are running on Windows, accept "\\" as a file separator. Ignore in *nix as "\\" is a valid filename- Parameters:
name- the name to fix the separator for if running on Windows- Returns:
- the fixed name
-
hostFsHasWindowsSeparator
protected boolean hostFsHasWindowsSeparator()
-
getPathMatcher
public java.nio.file.PathMatcher getPathMatcher(java.lang.String syntaxAndPattern)
- Specified by:
getPathMatcherin classjava.nio.file.FileSystem
-
globToRegex
protected java.lang.String globToRegex(java.lang.String pattern)
-
newWatchService
public java.nio.file.WatchService newWatchService() throws java.io.IOException- Specified by:
newWatchServicein classjava.nio.file.FileSystem- Throws:
java.io.IOException
-
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 abstract T create(java.lang.String root, java.util.List<java.lang.String> names)
-
-