Top Description Fields Constructors Methods
org.apache.sshd.common.file.root

public Class RootedFileSystemProvider

extends FileSystemProvider
Class Inheritance
Imports
java.io.FileNotFoundException, .IOException, .InputStream, .OutputStream, java.net.URI, .URISyntaxException, java.nio.channels.AsynchronousFileChannel, .FileChannel, .SeekableByteChannel, java.nio.file.AccessDeniedException, .AccessMode, .AtomicMoveNotSupportedException, .CopyOption, .DirectoryNotEmptyException, .DirectoryStream, .FileAlreadyExistsException, .FileStore, .FileSystem, .FileSystemAlreadyExistsException, .FileSystemException, .FileSystemLoopException, .FileSystemNotFoundException, .Files, .InvalidPathException, .LinkOption, .NoSuchFileException, .NotDirectoryException, .NotLinkException, .OpenOption, .Path, .Paths, .ProviderMismatchException, .SecureDirectoryStream, java.nio.file.attribute.BasicFileAttributes, .FileAttribute, .FileAttributeView, java.nio.file.spi.FileSystemProvider, java.util.HashMap, .Map, .Objects, .Set, java.util.concurrent.ExecutorService, org.apache.sshd.common.util.io.IoUtils, org.slf4j.Logger, .LoggerFactory

File system provider which provides a rooted file system. The file system only gives access to files under the root directory.
Author
Apache MINA SSHD Project

Field Summary

Modifier and TypeField and Description
private final Map<Path, RootedFileSystem>
protected final Logger

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
checkAccess(Path
the path to the file to check
path
,
AccessMode...
The access modes to check; may have zero elements
modes
)

Implements abstract java.nio.file.spi.FileSystemProvider.checkAccess.

Checks the existence, and optionally the accessibility, of a file.

public void
copy(Path
the path to the file to copy
source
,
Path
the path to the target file
target
,
CopyOption...
options specifying how the copy should be done
options
)

Implements abstract java.nio.file.spi.FileSystemProvider.copy.

Copy a file to a target file.

public void
createDirectory(Path
the directory to create
dir
,
FileAttribute<?>...
an optional list of file attributes to set atomically when creating the directory
attrs
)

Implements abstract java.nio.file.spi.FileSystemProvider.createDirectory.

Creates a new directory.

public void
delete(Path
the path to the file to delete
path
)

Implements abstract java.nio.file.spi.FileSystemProvider.delete.

Deletes a file.

public boolean
deleteIfExists(Path
the path to the file to delete
path
)

Overrides java.nio.file.spi.FileSystemProvider.deleteIfExists.

Deletes a file if it exists.

private static Path
private String
fixExceptionFileName(Path root, Path rootedPath, String fileName)

public <V extends FileAttributeView> V
getFileAttributeView(Path
the path to the file
path
,
Class<V>
the Class object corresponding to the file attribute view
type
,
LinkOption...
options indicating how symbolic links are handled
options
)

Implements abstract java.nio.file.spi.FileSystemProvider.getFileAttributeView.

Returns a file attribute view of a given type.

public FileStore
getFileStore(Path
the path to the file
path
)

Implements abstract java.nio.file.spi.FileSystemProvider.getFileStore.

Returns the FileStore representing the file store where a file is located.

public FileSystem
getFileSystem(URI
URI reference
uri
)

Implements abstract java.nio.file.spi.FileSystemProvider.getFileSystem.

Returns an existing FileSystem created by this provider.

protected RootedFileSystem
public Path
getPath(URI
The URI to convert
uri
)

Implements abstract java.nio.file.spi.FileSystemProvider.getPath.

Return a Path object by converting the given URI.

public String
getScheme()

Implements abstract java.nio.file.spi.FileSystemProvider.getScheme.

Returns the URI scheme that identifies this provider.

public boolean
isHidden(Path
the path to the file to test
path
)

Implements abstract java.nio.file.spi.FileSystemProvider.isHidden.

Tells whether or not a file is considered hidden.

public boolean
isSameFile(Path
one path to the file
path
,
Path
the other path
path2
)

Implements abstract java.nio.file.spi.FileSystemProvider.isSameFile.

Tests if two paths locate the same file.

public void
move(Path
the path to the file to move
source
,
Path
the path to the target file
target
,
CopyOption...
options specifying how the move should be done
options
)

Implements abstract java.nio.file.spi.FileSystemProvider.move.

Move or rename a file to a target file.

public AsynchronousFileChannel
newAsynchronousFileChannel(Path
the path of the file to open or create
path
,
Set<? extends OpenOption>
options specifying how the file is opened
options
,
ExecutorService
the thread pool or null to associate the channel with the default thread pool
executor
,
FileAttribute<?>...
an optional list of file attributes to set atomically when creating the file
attrs
)

Overrides java.nio.file.spi.FileSystemProvider.newAsynchronousFileChannel.

Opens or creates a file for reading and/or writing, returning an asynchronous file channel to access the file.

public SeekableByteChannel
newByteChannel(Path
the path to the file to open or create
path
,
Set<? extends OpenOption>
options specifying how the file is opened
options
,
FileAttribute<?>...
an optional list of file attributes to set atomically when creating the file
attrs
)

Implements abstract java.nio.file.spi.FileSystemProvider.newByteChannel.

Opens or creates a file, returning a seekable byte channel to access the file.

public DirectoryStream<Path>
newDirectoryStream(Path
the path to the directory
dir
,
DirectoryStream.Filter<? super Path>
the directory stream filter
filter
)

Implements abstract java.nio.file.spi.FileSystemProvider.newDirectoryStream.

Opens a directory, returning a DirectoryStream to iterate over the entries in the directory.

public FileChannel
newFileChannel(Path
the path of the file to open or create
path
,
Set<? extends OpenOption>
options specifying how the file is opened
options
,
FileAttribute<?>...
an optional list of file attributes to set atomically when creating the file
attrs
)

Overrides java.nio.file.spi.FileSystemProvider.newFileChannel.

Opens or creates a file for reading and/or writing, returning a file channel to access the file.

public FileSystem
newFileSystem(URI
URI reference
uri
,
Map<String, ?>
A map of provider specific properties to configure the file system; may be empty
env
)

Implements abstract java.nio.file.spi.FileSystemProvider.newFileSystem.

Constructs a new FileSystem object identified by a URI.

public FileSystem
newFileSystem(Path
The path to the file
path
,
Map<String, ?>
A map of provider specific properties to configure the file system; may be empty
env
)

Overrides java.nio.file.spi.FileSystemProvider.newFileSystem.

Constructs a new FileSystem to access the contents of a file as a file system.

protected FileSystem
newFileSystem(Object src, Path path, Map<String, ?> env)

public InputStream
newInputStream(Path
the path to the file to open
path
,
OpenOption...
options specifying how the file is opened
options
)

Overrides java.nio.file.spi.FileSystemProvider.newInputStream.

Opens a file, returning an input stream to read from the file.

public OutputStream
newOutputStream(Path
the path to the file to open or create
path
,
OpenOption...
options specifying how the file is opened
options
)

Overrides java.nio.file.spi.FileSystemProvider.newOutputStream.

Opens or creates a file, returning an output stream that may be used to write bytes to the file.

protected FileSystemProvider
provider(Path path)

public <A extends BasicFileAttributes> A
readAttributes(Path
the path to the file
path
,
Class<A>
the Class of the file attributes required to read
type
,
LinkOption...
options indicating how symbolic links are handled
options
)

Implements abstract java.nio.file.spi.FileSystemProvider.readAttributes.

Reads a file's attributes as a bulk operation.

public Map<String, Object>
readAttributes(Path
the path to the file
path
,
String
the attributes to read
attributes
,
LinkOption...
options indicating how symbolic links are handled
options
)

Implements abstract java.nio.file.spi.FileSystemProvider.readAttributes.

Reads a set of file attributes as a bulk operation.

protected Path

Returns:

The actual absolute local Path represented by the rooted one
resolveLocalPath
(RootedPath
The original RootedPath - never null
path
)

protected DirectoryStream<Path>
protected Path
public void
setAttribute(Path
the path to the file
path
,
String
the attribute to set
attribute
,
Object
the attribute value
value
,
LinkOption...
options indicating how symbolic links are handled
options
)

Implements abstract java.nio.file.spi.FileSystemProvider.setAttribute.

Sets the value of a file attribute.

private IOException
protected Path

Returns:

The actual absolute local Path represented by the rooted one
unroot
(Path
The original (rooted) Path
path
)

protected Path
Inherited from java.nio.file.spi.FileSystemProvider:
existsinstalledProvidersreadAttributesIfExists