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

public Class NoneFileSystemProvider

extends FileSystemProvider
Class Inheritance
Imports
java.io.IOException, java.net.URI, java.nio.channels.SeekableByteChannel, java.nio.file.AccessMode, .CopyOption, .DirectoryStream, .DirectoryStream.Filter, .FileStore, .FileSystem, .LinkOption, .NoSuchFileException, .OpenOption, .Path, java.nio.file.attribute.BasicFileAttributes, .FileAttribute, .FileAttributeView, java.nio.file.spi.FileSystemProvider, java.util.Map, .Objects, .Set

Provides an "empty" FileSystemProvider that has no files of any type.
Author
Apache MINA SSHD Project

Field Summary

Modifier and TypeField and Description
public static final NoneFileSystemProvider
public static final String

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 <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.

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
path1
,
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 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 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 <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.

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.

Inherited from java.nio.file.spi.FileSystemProvider:
createLinkcreateSymbolicLinkdeleteIfExistsexistsinstalledProvidersnewAsynchronousFileChannelnewFileChannelnewFileSystemnewInputStreamnewOutputStreamreadAttributesIfExistsreadSymbolicLink

Field Detail

INSTANCEback to summary
public static final NoneFileSystemProvider INSTANCE
SCHEMEback to summary
public static final String SCHEME

Constructor Detail

NoneFileSystemProviderback to summary
public NoneFileSystemProvider()

Method Detail

checkAccessback to summary
public void checkAccess(Path path, AccessMode... modes) throws IOException

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

Doc from java.nio.file.spi.FileSystemProvider.checkAccess.

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

This method may be used by the isReadable, isWritable and isExecutable methods to check the accessibility of a file.

This method checks the existence of a file and that this Java virtual machine has appropriate privileges that would allow it access the file according to all of access modes specified in the modes parameter as follows:

Access Modes
Value Description
READ Checks that the file exists and that the Java virtual machine has permission to read the file.
WRITE Checks that the file exists and that the Java virtual machine has permission to write to the file,
EXECUTE Checks that the file exists and that the Java virtual machine has permission to execute the file. The semantics may differ when checking access to a directory. For example, on UNIX systems, checking for EXECUTE access checks that the Java virtual machine has permission to search the directory in order to access file or subdirectories.

If the modes parameter is of length zero, then the existence of the file is checked.

This method follows symbolic links if the file referenced by this object is a symbolic link. Depending on the implementation, this method may require to read file permissions, access control lists, or other file attributes in order to check the effective access to the file. To determine the effective access to a file may require access to several attributes and so in some implementations this method may not be atomic with respect to other file system operations.

Parameters
path:Path

the path to the file to check

modes:AccessMode[]

The access modes to check; may have zero elements

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs
copyback to summary
public void copy(Path source, Path target, CopyOption... options) throws IOException

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

Doc from java.nio.file.spi.FileSystemProvider.copy.

Copy a file to a target file. This method works in exactly the manner specified by the Files#copy(Path, Path, CopyOption[]) method except that both the source and target paths must be associated with this provider.

Parameters
source:Path

the path to the file to copy

target:Path

the path to the target file

options:CopyOption[]

options specifying how the copy should be done

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs
createDirectoryback to summary
public void createDirectory(Path dir, FileAttribute<?>... attrs) throws IOException

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

Doc from java.nio.file.spi.FileSystemProvider.createDirectory.

Creates a new directory. This method works in exactly the manner specified by the Files#createDirectory method.

Parameters
dir:Path

the directory to create

attrs:FileAttribute<?>[]

an optional list of file attributes to set atomically when creating the directory

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs or the parent directory does not exist
deleteback to summary
public void delete(Path path) throws IOException

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

Doc from java.nio.file.spi.FileSystemProvider.delete.

Deletes a file. This method works in exactly the manner specified by the Files#delete method.

Parameters
path:Path

the path to the file to delete

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs
getFileAttributeViewback to summary
public <V extends FileAttributeView> V getFileAttributeView(Path path, Class<V> type, LinkOption... options)

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

Doc from java.nio.file.spi.FileSystemProvider.getFileAttributeView.

Returns a file attribute view of a given type. This method works in exactly the manner specified by the Files#getFileAttributeView method.

Parameters
<V>
The FileAttributeView type
path:Path

the path to the file

type:Class<V>

the Class object corresponding to the file attribute view

options:LinkOption[]

options indicating how symbolic links are handled

Returns:V

a file attribute view of the specified type, or null if the attribute view type is not available

Annotations
@Override
getFileStoreback to summary
public FileStore getFileStore(Path path) throws IOException

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

Doc from java.nio.file.spi.FileSystemProvider.getFileStore.

Returns the FileStore representing the file store where a file is located. This method works in exactly the manner specified by the Files#getFileStore method.

Parameters
path:Path

the path to the file

Returns:FileStore

the file store where the file is stored

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs
getFileSystemback to summary
public FileSystem getFileSystem(URI uri)

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

Doc from java.nio.file.spi.FileSystemProvider.getFileSystem.

Returns an existing FileSystem created by this provider.

This method returns a reference to a FileSystem that was created by invoking the newFileSystem(URI,Map) method. File systems created the newFileSystem(Path,Map) method are not returned by this method. The file system is identified by its URI. Its exact form is highly provider dependent. In the case of the default provider the URI's path component is "/" and the authority, query and fragment components are undefined (Undefined components are represented by null).

Once a file system created by this provider is closed it is provider-dependent if this method returns a reference to the closed file system or throws FileSystemNotFoundException. If the provider allows a new file system to be created with the same URI as a file system it previously created then this method throws the exception if invoked after the file system is closed (and before a new instance is created by the newFileSystem method).

Parameters
uri:URI

URI reference

Returns:FileSystem

The file system

Annotations
@Override
getPathback to summary
public Path getPath(URI uri)

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

Doc from java.nio.file.spi.FileSystemProvider.getPath.

Return a Path object by converting the given URI. The resulting Path is associated with a FileSystem that already exists or is constructed automatically.

The exact form of the URI is file system provider dependent. In the case of the default provider, the URI scheme is "file" and the given URI has a non-empty path component, and undefined query, and fragment components. The resulting Path is associated with the default default FileSystem.

Parameters
uri:URI

The URI to convert

Returns:Path

The resulting Path

Annotations
@Override
getSchemeback to summary
public String getScheme()

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

Doc from java.nio.file.spi.FileSystemProvider.getScheme.

Returns the URI scheme that identifies this provider.

Returns:String

The URI scheme

Annotations
@Override
isHiddenback to summary
public boolean isHidden(Path path) throws IOException

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

Doc from java.nio.file.spi.FileSystemProvider.isHidden.

Tells whether or not a file is considered hidden. This method works in exactly the manner specified by the Files#isHidden method.

This method is invoked by the isHidden method.

Parameters
path:Path

the path to the file to test

Returns:boolean

true if the file is considered hidden

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs
isSameFileback to summary
public boolean isSameFile(Path path1, Path path2) throws IOException

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

Doc from java.nio.file.spi.FileSystemProvider.isSameFile.

Tests if two paths locate the same file. This method works in exactly the manner specified by the Files#isSameFile method.

Parameters
path1:Path

one path to the file

path2:Path

the other path

Returns:boolean

true if, and only if, the two paths locate the same file

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs
moveback to summary
public void move(Path source, Path target, CopyOption... options) throws IOException

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

Doc from java.nio.file.spi.FileSystemProvider.move.

Move or rename a file to a target file. This method works in exactly the manner specified by the Files#move method except that both the source and target paths must be associated with this provider.

Parameters
source:Path

the path to the file to move

target:Path

the path to the target file

options:CopyOption[]

options specifying how the move should be done

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs
newByteChannelback to summary
public SeekableByteChannel newByteChannel(Path path, Set<? extends OpenOption> options, FileAttribute<?>... attrs) throws IOException

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

Doc from java.nio.file.spi.FileSystemProvider.newByteChannel.

Opens or creates a file, returning a seekable byte channel to access the file. This method works in exactly the manner specified by the Files#newByteChannel(Path, Set, FileAttribute[]) method.

Parameters
path:Path

the path to the file to open or create

options:Set<? extends OpenOption>

options specifying how the file is opened

attrs:FileAttribute<?>[]

an optional list of file attributes to set atomically when creating the file

Returns:SeekableByteChannel

a new seekable byte channel

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs
newDirectoryStreamback to summary
public DirectoryStream<Path> newDirectoryStream(Path dir, DirectoryStream.Filter<? super Path> filter) throws IOException

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

Doc from java.nio.file.spi.FileSystemProvider.newDirectoryStream.

Opens a directory, returning a DirectoryStream to iterate over the entries in the directory. This method works in exactly the manner specified by the Files#newDirectoryStream(java.nio.file.Path, java.nio.file.DirectoryStream.Filter) method.

Parameters
dir:Path

the path to the directory

filter:DirectoryStream.Filter<? super Path>

the directory stream filter

Returns:DirectoryStream<Path>

a new and open DirectoryStream object

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs
newFileSystemback to summary
public FileSystem newFileSystem(URI uri, Map<String, ?> env) throws IOException

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

Doc from java.nio.file.spi.FileSystemProvider.newFileSystem.

Constructs a new FileSystem object identified by a URI. This method is invoked by the FileSystems#newFileSystem(URI, Map) method to open a new file system identified by a URI.

The uri parameter is an absolute, hierarchical URI, with a scheme equal (without regard to case) to the scheme supported by this provider. The exact form of the URI is highly provider dependent. The env parameter is a map of provider specific properties to configure the file system.

This method throws FileSystemAlreadyExistsException if the file system already exists because it was previously created by an invocation of this method. Once a file system is closed it is provider-dependent if the provider allows a new file system to be created with the same URI as a file system it previously created.

Parameters
uri:URI

URI reference

env:Map<String, ?>

A map of provider specific properties to configure the file system; may be empty

Returns:FileSystem

A new file system

Annotations
@Override
Exceptions
IOException:
An I/O error occurs creating the file system
readAttributesback to summary
public <A extends BasicFileAttributes> A readAttributes(Path path, Class<A> type, LinkOption... options) throws IOException

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

Doc from java.nio.file.spi.FileSystemProvider.readAttributes.

Reads a file's attributes as a bulk operation. This method works in exactly the manner specified by the Files#readAttributes(Path, Class, LinkOption[]) method.

Parameters
<A>
The BasicFileAttributes type
path:Path

the path to the file

type:Class<A>

the Class of the file attributes required to read

options:LinkOption[]

options indicating how symbolic links are handled

Returns:A

the file attributes

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs
readAttributesback to summary
public Map<String, Object> readAttributes(Path path, String attributes, LinkOption... options) throws IOException

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

Doc from java.nio.file.spi.FileSystemProvider.readAttributes.

Reads a set of file attributes as a bulk operation. This method works in exactly the manner specified by the Files#readAttributes(Path, String, LinkOption[]) method.

Parameters
path:Path

the path to the file

attributes:String

the attributes to read

options:LinkOption[]

options indicating how symbolic links are handled

Returns:Map<String, Object>

a map of the attributes returned; may be empty. The map's keys are the attribute names, its values are the attribute values

Annotations
@Override
Exceptions
IOException:
If an I/O error occurs
setAttributeback to summary
public void setAttribute(Path path, String attribute, Object value, LinkOption... options) throws IOException

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

Doc from java.nio.file.spi.FileSystemProvider.setAttribute.

Sets the value of a file attribute. This method works in exactly the manner specified by the Files#setAttribute method.

Parameters
path:Path

the path to the file

attribute:String

the attribute to set

value:Object

the attribute value

options:LinkOption[]

options indicating how symbolic links are handled

Annotations
@Override
Exceptions
IOException:
If an I/O error occurs