@InterfaceAudience.Private @InterfaceStability.Evolving public abstract class FilterFs extends AbstractFileSystem
FilterFs contains some other file system, which it uses as its
basic file system, possibly transforming the data along the way or providing
additional functionality. The class FilterFs itself simply
overrides all methods of AbstractFileSystem with versions that
pass all requests to the contained file system. Subclasses of
FilterFs may further override some of these methods and may also
provide additional methods and fields.statistics| Modifier | Constructor and Description |
|---|---|
protected |
FilterFs(AbstractFileSystem fs) |
| Modifier and Type | Method and Description |
|---|---|
void |
checkPath(Path path)
Check that a Path belongs to this FileSystem.
|
FSDataOutputStream |
createInternal(Path f,
EnumSet<CreateFlag> flag,
FsPermission absolutePermission,
int bufferSize,
short replication,
long blockSize,
Progressable progress,
Options.ChecksumOpt checksumOpt,
boolean createParent)
The specification of this method matches that of
AbstractFileSystem.create(Path, EnumSet, Options.CreateOpts...) except that the opts
have been declared explicitly. |
void |
createSymlink(Path target,
Path link,
boolean createParent)
The specification of this method matches that of
FileContext.createSymlink(Path, Path, boolean); |
boolean |
delete(Path f,
boolean recursive)
The specification of this method matches that of
FileContext.delete(Path, boolean) except that Path f must be for
this file system. |
String |
getCanonicalServiceName()
Get a canonical name for this file system.
|
List<Token<?>> |
getDelegationTokens(String renewer)
Get one or more delegation tokens associated with the filesystem.
|
BlockLocation[] |
getFileBlockLocations(Path f,
long start,
long len)
The specification of this method matches that of
FileContext.getFileBlockLocations(Path, long, long) except that
Path f must be for this file system. |
FileChecksum |
getFileChecksum(Path f)
The specification of this method matches that of
FileContext.getFileChecksum(Path) except that Path f must be for
this file system. |
FileStatus |
getFileLinkStatus(Path f)
The specification of this method matches that of
FileContext.getFileLinkStatus(Path)
except that an UnresolvedLinkException may be thrown if a symlink is
encountered in the path leading up to the final path component. |
FileStatus |
getFileStatus(Path f)
The specification of this method matches that of
FileContext.getFileStatus(Path)
except that an UnresolvedLinkException may be thrown if a symlink is
encountered in the path. |
FsStatus |
getFsStatus()
The specification of this method matches that of
FileContext.getFsStatus(Path). |
FsStatus |
getFsStatus(Path f)
The specification of this method matches that of
FileContext.getFsStatus(Path) except that Path f must be for this
file system. |
Path |
getHomeDirectory()
Return the current user's home directory in this file system.
|
Path |
getInitialWorkingDirectory()
Some file systems like LocalFileSystem have an initial workingDir
that is used as the starting workingDir.
|
Path |
getLinkTarget(Path f)
Partially resolves the path.
|
protected AbstractFileSystem |
getMyFs() |
FsServerDefaults |
getServerDefaults()
Return a set of server default configuration values.
|
FileSystem.Statistics |
getStatistics() |
URI |
getUri()
Returns a URI whose scheme and authority identify this FileSystem.
|
int |
getUriDefaultPort()
The default port of this file system.
|
String |
getUriPath(Path p)
Get the path-part of a pathname.
|
boolean |
isValidName(String src)
Returns true if the specified string is considered valid in the path part
of a URI by this file system.
|
RemoteIterator<Path> |
listCorruptFileBlocks(Path path) |
FileStatus[] |
listStatus(Path f)
The specification of this method matches that of
FileContext.Util.listStatus(Path) except that Path f must be
for this file system. |
Path |
makeQualified(Path path)
Make the path fully qualified to this file system
|
void |
mkdir(Path dir,
FsPermission permission,
boolean createParent)
The specification of this method matches that of
FileContext.mkdir(Path, FsPermission, boolean) except that the Path
f must be fully qualified and the permission is absolute (i.e. |
FSDataInputStream |
open(Path f)
The specification of this method matches that of
FileContext.open(Path) except that Path f must be for this
file system. |
FSDataInputStream |
open(Path f,
int bufferSize)
The specification of this method matches that of
FileContext.open(Path, int) except that Path f must be for this
file system. |
void |
renameInternal(Path src,
Path dst)
The specification of this method matches that of
FileContext.rename(Path, Path, Options.Rename...) except that Path
f must be for this file system and NO OVERWRITE is performed. |
void |
renameInternal(Path src,
Path dst,
boolean overwrite)
The specification of this method matches that of
FileContext.rename(Path, Path, Options.Rename...) except that Path
f must be for this file system. |
Path |
resolvePath(Path p)
Return the fully-qualified path of path f resolving the path
through any internal symlinks or mount point
|
void |
setOwner(Path f,
String username,
String groupname)
The specification of this method matches that of
FileContext.setOwner(Path, String, String) except that Path f must
be for this file system. |
void |
setPermission(Path f,
FsPermission permission)
The specification of this method matches that of
FileContext.setPermission(Path, FsPermission) except that Path f
must be for this file system. |
boolean |
setReplication(Path f,
short replication)
The specification of this method matches that of
FileContext.setReplication(Path, short) except that Path f must be
for this file system. |
void |
setTimes(Path f,
long mtime,
long atime)
The specification of this method matches that of
FileContext.setTimes(Path, long, long) except that Path f must be
for this file system. |
void |
setVerifyChecksum(boolean verifyChecksum)
The specification of this method matches that of
FileContext.setVerifyChecksum(boolean, Path) except that Path f
must be for this file system. |
boolean |
supportsSymlinks()
Returns true if the file system supports symlinks, false otherwise.
|
checkScheme, clearStatistics, create, createFileSystem, equals, get, getAllStatistics, getStatistics, hashCode, listLocatedStatus, listStatusIterator, printStatistics, renameprotected FilterFs(AbstractFileSystem fs) throws IOException, URISyntaxException
IOExceptionURISyntaxExceptionprotected AbstractFileSystem getMyFs()
public FileSystem.Statistics getStatistics()
getStatistics in class AbstractFileSystempublic Path makeQualified(Path path)
AbstractFileSystemmakeQualified in class AbstractFileSystempublic Path getInitialWorkingDirectory()
AbstractFileSystemgetInitialWorkingDirectory in class AbstractFileSystempublic Path getHomeDirectory()
AbstractFileSystemgetHomeDirectory in class AbstractFileSystempublic FSDataOutputStream createInternal(Path f, EnumSet<CreateFlag> flag, FsPermission absolutePermission, int bufferSize, short replication, long blockSize, Progressable progress, Options.ChecksumOpt checksumOpt, boolean createParent) throws IOException, UnresolvedLinkException
AbstractFileSystemAbstractFileSystem.create(Path, EnumSet, Options.CreateOpts...) except that the opts
have been declared explicitly.createInternal in class AbstractFileSystemIOExceptionUnresolvedLinkExceptionpublic boolean delete(Path f, boolean recursive) throws IOException, UnresolvedLinkException
AbstractFileSystemFileContext.delete(Path, boolean) except that Path f must be for
this file system.delete in class AbstractFileSystemIOExceptionUnresolvedLinkExceptionpublic BlockLocation[] getFileBlockLocations(Path f, long start, long len) throws IOException, UnresolvedLinkException
AbstractFileSystemFileContext.getFileBlockLocations(Path, long, long) except that
Path f must be for this file system.getFileBlockLocations in class AbstractFileSystemIOExceptionUnresolvedLinkExceptionpublic FileChecksum getFileChecksum(Path f) throws IOException, UnresolvedLinkException
AbstractFileSystemFileContext.getFileChecksum(Path) except that Path f must be for
this file system.getFileChecksum in class AbstractFileSystemIOExceptionUnresolvedLinkExceptionpublic FileStatus getFileStatus(Path f) throws IOException, UnresolvedLinkException
AbstractFileSystemFileContext.getFileStatus(Path)
except that an UnresolvedLinkException may be thrown if a symlink is
encountered in the path.getFileStatus in class AbstractFileSystemIOExceptionUnresolvedLinkExceptionpublic FileStatus getFileLinkStatus(Path f) throws IOException, UnresolvedLinkException
AbstractFileSystemFileContext.getFileLinkStatus(Path)
except that an UnresolvedLinkException may be thrown if a symlink is
encountered in the path leading up to the final path component.
If the file system does not support symlinks then the behavior is
equivalent to AbstractFileSystem.getFileStatus(Path).getFileLinkStatus in class AbstractFileSystemIOExceptionUnresolvedLinkExceptionpublic FsStatus getFsStatus(Path f) throws AccessControlException, FileNotFoundException, UnresolvedLinkException, IOException
AbstractFileSystemFileContext.getFsStatus(Path) except that Path f must be for this
file system.getFsStatus in class AbstractFileSystemAccessControlExceptionFileNotFoundExceptionUnresolvedLinkExceptionIOExceptionpublic FsStatus getFsStatus() throws IOException
AbstractFileSystemFileContext.getFsStatus(Path).getFsStatus in class AbstractFileSystemIOExceptionpublic FsServerDefaults getServerDefaults() throws IOException
AbstractFileSystemgetServerDefaults in class AbstractFileSystemIOException - an I/O error occurredpublic Path resolvePath(Path p) throws FileNotFoundException, UnresolvedLinkException, AccessControlException, IOException
AbstractFileSystemresolvePath in class AbstractFileSystemp - path to be resolvedFileNotFoundExceptionUnresolvedLinkExceptionAccessControlExceptionIOExceptionpublic int getUriDefaultPort()
AbstractFileSystemgetUriDefaultPort in class AbstractFileSystempublic URI getUri()
AbstractFileSystemgetUri in class AbstractFileSystempublic void checkPath(Path path)
AbstractFileSystemcheckPath in class AbstractFileSystempublic String getUriPath(Path p)
AbstractFileSystemgetUriPath in class AbstractFileSystemp - pathpublic FileStatus[] listStatus(Path f) throws IOException, UnresolvedLinkException
AbstractFileSystemFileContext.Util.listStatus(Path) except that Path f must be
for this file system.listStatus in class AbstractFileSystemIOExceptionUnresolvedLinkExceptionpublic RemoteIterator<Path> listCorruptFileBlocks(Path path) throws IOException
listCorruptFileBlocks in class AbstractFileSystemIOExceptionpublic void mkdir(Path dir, FsPermission permission, boolean createParent) throws IOException, UnresolvedLinkException
AbstractFileSystemFileContext.mkdir(Path, FsPermission, boolean) except that the Path
f must be fully qualified and the permission is absolute (i.e.
umask has been applied).mkdir in class AbstractFileSystemIOExceptionUnresolvedLinkExceptionpublic FSDataInputStream open(Path f) throws AccessControlException, FileNotFoundException, UnresolvedLinkException, IOException
AbstractFileSystemFileContext.open(Path) except that Path f must be for this
file system.open in class AbstractFileSystemAccessControlExceptionFileNotFoundExceptionUnresolvedLinkExceptionIOExceptionpublic FSDataInputStream open(Path f, int bufferSize) throws IOException, UnresolvedLinkException
AbstractFileSystemFileContext.open(Path, int) except that Path f must be for this
file system.open in class AbstractFileSystemIOExceptionUnresolvedLinkExceptionpublic void renameInternal(Path src, Path dst) throws IOException, UnresolvedLinkException
AbstractFileSystemFileContext.rename(Path, Path, Options.Rename...) except that Path
f must be for this file system and NO OVERWRITE is performed.
File systems that do not have a built in overwrite need implement only this
method and can take advantage of the default impl of the other
AbstractFileSystem.renameInternal(Path, Path, boolean)renameInternal in class AbstractFileSystemIOExceptionUnresolvedLinkExceptionpublic void renameInternal(Path src, Path dst, boolean overwrite) throws AccessControlException, FileAlreadyExistsException, FileNotFoundException, ParentNotDirectoryException, UnresolvedLinkException, IOException
AbstractFileSystemFileContext.rename(Path, Path, Options.Rename...) except that Path
f must be for this file system.public void setOwner(Path f, String username, String groupname) throws IOException, UnresolvedLinkException
AbstractFileSystemFileContext.setOwner(Path, String, String) except that Path f must
be for this file system.setOwner in class AbstractFileSystemIOExceptionUnresolvedLinkExceptionpublic void setPermission(Path f, FsPermission permission) throws IOException, UnresolvedLinkException
AbstractFileSystemFileContext.setPermission(Path, FsPermission) except that Path f
must be for this file system.setPermission in class AbstractFileSystemIOExceptionUnresolvedLinkExceptionpublic boolean setReplication(Path f, short replication) throws IOException, UnresolvedLinkException
AbstractFileSystemFileContext.setReplication(Path, short) except that Path f must be
for this file system.setReplication in class AbstractFileSystemIOExceptionUnresolvedLinkExceptionpublic void setTimes(Path f, long mtime, long atime) throws IOException, UnresolvedLinkException
AbstractFileSystemFileContext.setTimes(Path, long, long) except that Path f must be
for this file system.setTimes in class AbstractFileSystemIOExceptionUnresolvedLinkExceptionpublic void setVerifyChecksum(boolean verifyChecksum)
throws IOException,
UnresolvedLinkException
AbstractFileSystemFileContext.setVerifyChecksum(boolean, Path) except that Path f
must be for this file system.setVerifyChecksum in class AbstractFileSystemIOExceptionUnresolvedLinkExceptionpublic boolean supportsSymlinks()
AbstractFileSystemsupportsSymlinks in class AbstractFileSystempublic void createSymlink(Path target, Path link, boolean createParent) throws IOException, UnresolvedLinkException
AbstractFileSystemFileContext.createSymlink(Path, Path, boolean);createSymlink in class AbstractFileSystemIOExceptionUnresolvedLinkExceptionpublic Path getLinkTarget(Path f) throws IOException
AbstractFileSystemFSLinkResolver, and differs from the similarly named method
FileContext.getLinkTarget(Path).getLinkTarget in class AbstractFileSystemIOExceptionpublic String getCanonicalServiceName()
AbstractFileSystemgetCanonicalServiceName in class AbstractFileSystempublic List<Token<?>> getDelegationTokens(String renewer) throws IOException
AbstractFileSystemgetDelegationTokens in class AbstractFileSystemrenewer - the account name that is allowed to renew the token.IOExceptionpublic boolean isValidName(String src)
AbstractFileSystemisValidName in class AbstractFileSystemsrc - String source filename to check, path part of the URICopyright © 2013 Apache Software Foundation. All rights reserved.