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

public Class RootedFileSystem

extends BaseFileSystem<RootedPath>
Class Inheritance
Imports
java.io.IOException, java.nio.file.FileStore, .FileSystem, .Path, java.nio.file.attribute.UserPrincipalLookupService, java.util.List, .Map, .Objects, .Set, org.apache.sshd.common.file.util.BaseFileSystem

Author
Apache MINA SSHD Project

Field Summary

Modifier and TypeField and Description
private final FileSystem
private final Path
Inherited from org.apache.sshd.common.file.util.BaseFileSystem:
log

Constructor Summary

AccessConstructor and Description
public
RootedFileSystem(RootedFileSystemProvider fileSystemProvider, Path root, Map<String, ?> env)

Method Summary

Modifier and TypeMethod and Description
public void
close()

Implements abstract java.nio.file.FileSystem.close.

Implements java.io.Closeable.close.

Closes this file system.

protected RootedPath
public Iterable<FileStore>
getFileStores()

Overrides org.apache.sshd.common.file.util.BaseFileSystem.getFileStores.

Returns an object to iterate over the underlying file stores.

public Path
public FileSystem
public UserPrincipalLookupService
getUserPrincipalLookupService()

Implements abstract java.nio.file.FileSystem.getUserPrincipalLookupService.

Returns the UserPrincipalLookupService for this file system (optional operation).

protected boolean
public boolean
isOpen()

Implements abstract java.nio.file.FileSystem.isOpen.

Tells whether or not this file system is open.

public boolean
isReadOnly()

Overrides org.apache.sshd.common.file.util.BaseFileSystem.isReadOnly.

Tells whether or not this file system allows only read-only access to its file stores.

public RootedFileSystemProvider
provider()

Overrides org.apache.sshd.common.file.util.BaseFileSystem.provider.

Returns the provider that created this file system.

public Set<String>
supportedFileAttributeViews()

Implements abstract java.nio.file.FileSystem.supportedFileAttributeViews.

Returns the set of the names of the file attribute views supported by this FileSystem.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from org.apache.sshd.common.file.util.BaseFileSystem:
appendDedupSepcreatecreategetDefaultDirgetPathgetPathMatchergetRootDirectoriesgetSeparatorglobToRegexhandleWindowsSeparatornewWatchService

Field Detail

rootFsback to summary
private final FileSystem rootFs
rootPathback to summary
private final Path rootPath

Constructor Detail

RootedFileSystemback to summary
public RootedFileSystem(RootedFileSystemProvider fileSystemProvider, Path root, Map<String, ?> env)

Method Detail

closeback to summary
public void close() throws IOException

Implements abstract java.nio.file.FileSystem.close.

Implements java.io.Closeable.close.

Doc from java.nio.file.FileSystem.close.

Closes this file system.

After a file system is closed then all subsequent access to the file system, either by methods defined by this class or on objects associated with this file system, throw ClosedFileSystemException. If the file system is already closed then invoking this method has no effect.

Closing a file system will close all open channels, directory-streams, watch-service, and other closeable objects associated with this file system. The default file system cannot be closed.

Annotations
@Override
Exceptions
IOException:
If an I/O error occurs
createback to summary
protected RootedPath create(String root, List<String> names)

Implements abstract org.apache.sshd.common.file.util.BaseFileSystem.create.

Annotations
@Override
getFileStoresback to summary
public Iterable<FileStore> getFileStores()

Overrides org.apache.sshd.common.file.util.BaseFileSystem.getFileStores.

Doc from java.nio.file.FileSystem.getFileStores.

Returns an object to iterate over the underlying file stores.

The elements of the returned iterator are the FileStores for this file system. The order of the elements is not defined and the file stores may change during the lifetime of the Java virtual machine. When an I/O error occurs, perhaps because a file store is not accessible, then it is not returned by the iterator.

Usage Example: Suppose we want to print the space usage for all file stores:

for (FileStore store: FileSystems.getDefault().getFileStores()) { long total = store.getTotalSpace() / 1024; long used = (store.getTotalSpace() - store.getUnallocatedSpace()) / 1024; long avail = store.getUsableSpace() / 1024; System.out.format("%-20s %12d %12d %12d%n", store, total, used, avail); }
for (FileStore store: FileSystems.getDefault().getFileStores()) {
    long total = store.getTotalSpace() / 1024;
    long used = (store.getTotalSpace() - store.getUnallocatedSpace()) / 1024;
    long avail = store.getUsableSpace() / 1024;
    System.out.format("%-20s %12d %12d %12d%n", store, total, used, avail);
}
Returns:Iterable<FileStore>

An object to iterate over the backing file stores

Annotations
@Override
getRootback to summary
public Path getRoot()
getRootFileSystemback to summary
public FileSystem getRootFileSystem()
getUserPrincipalLookupServiceback to summary
public UserPrincipalLookupService getUserPrincipalLookupService()

Implements abstract java.nio.file.FileSystem.getUserPrincipalLookupService.

Doc from java.nio.file.FileSystem.getUserPrincipalLookupService.

Returns the UserPrincipalLookupService for this file system (optional operation). The resulting lookup service may be used to lookup user or group names.

Usage Example: Suppose we want to make "joe" the owner of a file:

UserPrincipalLookupService lookupService = FileSystems.getDefault().getUserPrincipalLookupService(); Files.setOwner(path, lookupService.lookupPrincipalByName("joe"));
UserPrincipalLookupService lookupService = FileSystems.getDefault().getUserPrincipalLookupService();
Files.setOwner(path, lookupService.lookupPrincipalByName("joe"));
Returns:UserPrincipalLookupService

The UserPrincipalLookupService for this file system

Annotations
@Override
hostFsHasWindowsSeparatorback to summary
protected boolean hostFsHasWindowsSeparator()

Overrides org.apache.sshd.common.file.util.BaseFileSystem.hostFsHasWindowsSeparator.

Annotations
@Override
isOpenback to summary
public boolean isOpen()

Implements abstract java.nio.file.FileSystem.isOpen.

Doc from java.nio.file.FileSystem.isOpen.

Tells whether or not this file system is open.

File systems created by the default provider are always open.

Returns:boolean

true if, and only if, this file system is open

Annotations
@Override
isReadOnlyback to summary
public boolean isReadOnly()

Overrides org.apache.sshd.common.file.util.BaseFileSystem.isReadOnly.

Doc from java.nio.file.FileSystem.isReadOnly.

Tells whether or not this file system allows only read-only access to its file stores.

Returns:boolean

true if, and only if, this file system provides read-only access

Annotations
@Override
providerback to summary
public RootedFileSystemProvider provider()

Overrides org.apache.sshd.common.file.util.BaseFileSystem.provider.

Doc from java.nio.file.FileSystem.provider.

Returns the provider that created this file system.

Returns:RootedFileSystemProvider

The provider that created this file system.

Annotations
@Override
supportedFileAttributeViewsback to summary
public Set<String> supportedFileAttributeViews()

Implements abstract java.nio.file.FileSystem.supportedFileAttributeViews.

Doc from java.nio.file.FileSystem.supportedFileAttributeViews.

Returns the set of the names of the file attribute views supported by this FileSystem.

The BasicFileAttributeView is required to be supported and therefore the set contains at least one element, "basic".

The supportsFileAttributeView(String) method may be used to test if an underlying FileStore supports the file attributes identified by a file attribute view.

Returns:Set<String>

An unmodifiable set of the names of the supported file attribute views

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override