Top Description Constructors Methods
sun.nio.fs

public abstract Class AbstractFileSystemProvider

extends FileSystemProvider
Class Inheritance
Known Direct Subclasses
sun.nio.fs.UnixFileSystemProvider
Imports
java.nio.file.AccessMode, .LinkOption, .Path, java.nio.file.spi.FileSystemProvider, java.io.IOException, java.util.Map

Base implementation class of FileSystemProvider

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public final void
delete(Path
the path to the file to delete
file
)

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

Deletes a file.

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

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

Deletes a file if it exists.

pack-priv abstract DynamicFileAttributeView
getFileAttributeView(Path file, String name, LinkOption... options)

Gets a DynamicFileAttributeView by name.

public abstract byte[]
getSunPathForSocketFile(Path path)

Returns a path name as bytes for a Unix domain socket.

pack-priv abstract boolean
implDelete(Path file, boolean failIfNotExists)

Deletes a file.

public boolean
isExecutable(Path path)

Tests whether a file is executable.

public boolean
isReadable(Path path)

Tests whether a file is readable.

public boolean
isWritable(Path path)

Tests whether a file is writable.

public final Map<String, Object>
readAttributes(Path
the path to the file
file
,
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 final void
setAttribute(Path
the path to the file
file
,
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 static String[]
split(String attribute)

Splits the given attribute name into the name of an attribute view and the attribute.

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

Constructor Detail

AbstractFileSystemProviderback to summary
protected AbstractFileSystemProvider()

Method Detail

deleteback to summary
public final void delete(Path file) 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
file:Path

the path to the file to delete

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs
deleteIfExistsback to summary
public final boolean deleteIfExists(Path file) throws IOException

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

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

Deletes a file if it exists. This method works in exactly the manner specified by the Files#deleteIfExists method.

The default implementation of this method simply invokes delete ignoring the NoSuchFileException when the file does not exist. It may be overridden where appropriate.

Parameters
file:Path

the path to the file to delete

Returns:boolean

true if the file was deleted by this method; false if the file could not be deleted because it did not exist

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs
getFileAttributeViewback to summary
pack-priv abstract DynamicFileAttributeView getFileAttributeView(Path file, String name, LinkOption... options)

Gets a DynamicFileAttributeView by name. Returns null if the view is not available.

getSunPathForSocketFileback to summary
public abstract byte[] getSunPathForSocketFile(Path path)

Returns a path name as bytes for a Unix domain socket. Different encodings may be used for these names on some platforms. If path is empty, then an empty byte[] is returned.

implDeleteback to summary
pack-priv abstract boolean implDelete(Path file, boolean failIfNotExists) throws IOException

Deletes a file. The failIfNotExists parameters determines if an IOException is thrown when the file does not exist.

isExecutableback to summary
public boolean isExecutable(Path path)

Tests whether a file is executable.

isReadableback to summary
public boolean isReadable(Path path)

Tests whether a file is readable.

isWritableback to summary
public boolean isWritable(Path path)

Tests whether a file is writable.

readAttributesback to summary
public final Map<String, Object> readAttributes(Path file, 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
file: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 final void setAttribute(Path file, 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
file: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
splitback to summary
private static String[] split(String attribute)

Splits the given attribute name into the name of an attribute view and the attribute. If the attribute view is not identified then it assumed to be "basic".