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.FileSystemProvider
fileSystemProvider
protected org.slf4j.Logger
log
-
Constructor Summary
Constructors Modifier Constructor Description protected
BaseFileSystem(java.nio.file.spi.FileSystemProvider fileSystemProvider)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
appendDedupSep(java.lang.StringBuilder sb, java.lang.CharSequence s)
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 abstract T
create(java.lang.String root, java.util.List<java.lang.String> names)
T
getDefaultDir()
java.lang.Iterable<java.nio.file.FileStore>
getFileStores()
T
getPath(java.lang.String first, java.lang.String... more)
java.nio.file.PathMatcher
getPathMatcher(java.lang.String syntaxAndPattern)
java.lang.Iterable<java.nio.file.Path>
getRootDirectories()
java.lang.String
getSeparator()
protected java.lang.String
globToRegex(java.lang.String pattern)
protected java.lang.String
handleWindowsSeparator(java.lang.String name)
In case we are running on Windows, accept "\\" as a file separator.protected boolean
hostFsHasWindowsSeparator()
boolean
isReadOnly()
java.nio.file.WatchService
newWatchService()
java.nio.file.spi.FileSystemProvider
provider()
-
-
-
Method Detail
-
getDefaultDir
public T getDefaultDir()
-
isReadOnly
public boolean isReadOnly()
- Specified by:
isReadOnly
in classjava.nio.file.FileSystem
-
provider
public java.nio.file.spi.FileSystemProvider provider()
- Specified by:
provider
in classjava.nio.file.FileSystem
-
getSeparator
public java.lang.String getSeparator()
- Specified by:
getSeparator
in classjava.nio.file.FileSystem
-
getRootDirectories
public java.lang.Iterable<java.nio.file.Path> getRootDirectories()
- Specified by:
getRootDirectories
in classjava.nio.file.FileSystem
-
getFileStores
public java.lang.Iterable<java.nio.file.FileStore> getFileStores()
- Specified by:
getFileStores
in classjava.nio.file.FileSystem
-
getPath
public T getPath(java.lang.String first, java.lang.String... more)
- Specified by:
getPath
in 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:
getPathMatcher
in 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:
newWatchService
in 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)
-
-