PathCapabilitiesFtpFs, HarFs, RawLocalFs@Private @Unstable public abstract class DelegateToFileSystem extends AbstractFileSystem
FileSystem.| Modifier and Type | Field | Description |
|---|---|---|
protected FileSystem |
fsImpl |
statistics| Modifier | Constructor | Description |
|---|---|---|
protected |
DelegateToFileSystem(java.net.URI theUri,
FileSystem theFsImpl,
Configuration conf,
java.lang.String supportedScheme,
boolean authorityRequired) |
| Modifier and Type | Method | Description |
|---|---|---|
FSDataOutputStream |
createInternal(Path f,
java.util.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. |
java.lang.String |
getCanonicalServiceName() |
Get a canonical name for this file system.
|
java.util.List<Token<?>> |
getDelegationTokens(java.lang.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.
|
FsServerDefaults |
getServerDefaults() |
Deprecated.
|
FsServerDefaults |
getServerDefaults(Path f) |
Return a set of server default configuration values based on path.
|
int |
getUriDefaultPort() |
The default port of this file system.
|
boolean |
hasPathCapability(Path path,
java.lang.String capability) |
Probe for a specific capability under the given 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. |
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,
int bufferSize) |
The specification of this method matches that of
FileContext.open(Path, int) except that Path f must be for this
file system. |
java.util.concurrent.CompletableFuture<FSDataInputStream> |
openFileWithOptions(Path path,
OpenFileParameters parameters) |
Open a file by delegating to
FileSystem.openFileWithOptions(Path, org.apache.hadoop.fs.impl.OpenFileParameters). |
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 |
setOwner(Path f,
java.lang.String username,
java.lang.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.
|
boolean |
truncate(Path f,
long newLength) |
The specification of this method matches that of
FileContext.truncate(Path, long) except that Path f must be for
this file system. |
access, checkPath, checkScheme, clearStatistics, create, createFileSystem, createMultipartUploader, createSnapshot, deleteSnapshot, equals, get, getAclStatus, getAllStatistics, getAllStoragePolicies, getEnclosingRoot, getStatistics, getStatistics, getStoragePolicy, getUri, getUriPath, getXAttr, getXAttrs, getXAttrs, hashCode, isValidName, listCorruptFileBlocks, listLocatedStatus, listStatusIterator, listXAttrs, makeQualified, methodNotSupported, modifyAclEntries, msync, open, printStatistics, removeAcl, removeAclEntries, removeDefaultAcl, removeXAttr, rename, renameInternal, renameSnapshot, resolvePath, satisfyStoragePolicy, setAcl, setStoragePolicy, setXAttr, setXAttr, unsetStoragePolicyprotected final FileSystem fsImpl
protected DelegateToFileSystem(java.net.URI theUri,
FileSystem theFsImpl,
Configuration conf,
java.lang.String supportedScheme,
boolean authorityRequired)
throws java.io.IOException,
java.net.URISyntaxException
java.io.IOExceptionjava.net.URISyntaxExceptionpublic Path getInitialWorkingDirectory()
AbstractFileSystemgetInitialWorkingDirectory in class AbstractFileSystempublic FSDataOutputStream createInternal(Path f, java.util.EnumSet<CreateFlag> flag, FsPermission absolutePermission, int bufferSize, short replication, long blockSize, Progressable progress, Options.ChecksumOpt checksumOpt, boolean createParent) throws java.io.IOException
AbstractFileSystemAbstractFileSystem.create(Path, EnumSet, Options.CreateOpts...) except that the opts
have been declared explicitly.createInternal in class AbstractFileSystemf - the path.flag - create flag.absolutePermission - absolute permission.bufferSize - buffer size.replication - replications.blockSize - block size.progress - progress.checksumOpt - check sum opt.createParent - create parent.AccessControlException - access control exception.FileAlreadyExistsException - file already exists exception.java.io.FileNotFoundException - file not found exception.ParentNotDirectoryException - parent not directory exception.UnsupportedFileSystemException - unsupported filesystem exception.UnresolvedLinkException - unresolved link exception.java.io.IOException - raised on errors performing I/O.public boolean delete(Path f, boolean recursive) throws java.io.IOException
AbstractFileSystemFileContext.delete(Path, boolean) except that Path f must be for
this file system.delete in class AbstractFileSystemf - the path.recursive - recursive flag.AccessControlException - access control exception.java.io.FileNotFoundException - file not found exception.UnresolvedLinkException - unresolved link exception.java.io.IOException - raised on errors performing I/O.public BlockLocation[] getFileBlockLocations(Path f, long start, long len) throws java.io.IOException
AbstractFileSystemFileContext.getFileBlockLocations(Path, long, long) except that
Path f must be for this file system.getFileBlockLocations in class AbstractFileSystemf - the path.start - start.len - length.AccessControlException - access control exception.java.io.FileNotFoundException - file not found exception.UnresolvedLinkException - unresolved link exception.java.io.IOException - raised on errors performing I/O.public FileChecksum getFileChecksum(Path f) throws java.io.IOException
AbstractFileSystemFileContext.getFileChecksum(Path) except that Path f must be for
this file system.getFileChecksum in class AbstractFileSystemf - the path.AccessControlException - access control exception.java.io.FileNotFoundException - file not found exception.UnresolvedLinkException - unresolved link exception.java.io.IOException - raised on errors performing I/O.public FileStatus getFileStatus(Path f) throws java.io.IOException
AbstractFileSystemFileContext.getFileStatus(Path)
except that an UnresolvedLinkException may be thrown if a symlink is
encountered in the path.getFileStatus in class AbstractFileSystemf - the path.AccessControlException - access control exception.java.io.FileNotFoundException - file not found exception.UnresolvedLinkException - unresolved link exception.java.io.IOException - raised on errors performing I/O.public FileStatus getFileLinkStatus(Path f) throws java.io.IOException
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 AbstractFileSystemf - the path.AccessControlException - access control exception.java.io.FileNotFoundException - file not found exception.UnsupportedFileSystemException - UnSupported File System Exception.java.io.IOException - raised on errors performing I/O.public FsStatus getFsStatus() throws java.io.IOException
AbstractFileSystemFileContext.getFsStatus(Path).getFsStatus in class AbstractFileSystemAccessControlException - access control exception.java.io.FileNotFoundException - file not found exception.java.io.IOException - raised on errors performing I/O.public FsStatus getFsStatus(Path f) throws java.io.IOException
AbstractFileSystemFileContext.getFsStatus(Path) except that Path f must be for this
file system.getFsStatus in class AbstractFileSystemf - the path.AccessControlException - access control exception.java.io.FileNotFoundException - file not found exception.UnresolvedLinkException - unresolved link exception.java.io.IOException - raised on errors performing I/O.@Deprecated public FsServerDefaults getServerDefaults() throws java.io.IOException
AbstractFileSystemgetServerDefaults in class AbstractFileSystemjava.io.IOException - an I/O error occurredpublic FsServerDefaults getServerDefaults(Path f) throws java.io.IOException
AbstractFileSystemgetServerDefaults in class AbstractFileSystemf - path to fetch server defaultsjava.io.IOException - an I/O error occurredpublic Path getHomeDirectory()
AbstractFileSystemgetHomeDirectory in class AbstractFileSystempublic int getUriDefaultPort()
AbstractFileSystemgetUriDefaultPort in class AbstractFileSystempublic FileStatus[] listStatus(Path f) throws java.io.IOException
AbstractFileSystemFileContext.Util.listStatus(Path) except that Path f must be
for this file system.listStatus in class AbstractFileSystemf - the path.AccessControlException - access control exception.java.io.FileNotFoundException - file not found exception.UnresolvedLinkException - unresolved link exception.java.io.IOException - raised on errors performing I/O.public void mkdir(Path dir, FsPermission permission, boolean createParent) throws java.io.IOException
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 AbstractFileSystemdir - directory.permission - permission.createParent - create parent flag.AccessControlException - access control exception.FileAlreadyExistsException - file already exists exception.java.io.FileNotFoundException - file not found exception.UnresolvedLinkException - unresolved link exception.java.io.IOException - raised on errors performing I/O.public FSDataInputStream open(Path f, int bufferSize) throws java.io.IOException
AbstractFileSystemFileContext.open(Path, int) except that Path f must be for this
file system.open in class AbstractFileSystemf - the path.bufferSize - buffer size.AccessControlException - access control exception.java.io.FileNotFoundException - file not found exception.UnresolvedLinkException - unresolved link exception.java.io.IOException - raised on errors performing I/O.public boolean truncate(Path f, long newLength) throws java.io.IOException
AbstractFileSystemFileContext.truncate(Path, long) except that Path f must be for
this file system.truncate in class AbstractFileSystemf - the path.newLength - new length.AccessControlException - access control exception.java.io.FileNotFoundException - file not found exception.UnresolvedLinkException - unresolved link exception.java.io.IOException - raised on errors performing I/O.public void renameInternal(Path src, Path dst) throws java.io.IOException
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 AbstractFileSystemsrc - src.dst - dst.AccessControlException - access control exception.FileAlreadyExistsException - file already exists exception.java.io.FileNotFoundException - file not found exception.ParentNotDirectoryException - parent not directory exception.UnresolvedLinkException - unresolved link exception.java.io.IOException - raised on errors performing I/O.public void setOwner(Path f, java.lang.String username, java.lang.String groupname) throws java.io.IOException
AbstractFileSystemFileContext.setOwner(Path, String, String) except that Path f must
be for this file system.setOwner in class AbstractFileSystemf - the path.username - username.groupname - groupname.AccessControlException - access control exception.java.io.FileNotFoundException - file not found exception.UnresolvedLinkException - unresolved link exception.java.io.IOException - raised on errors performing I/O.public void setPermission(Path f, FsPermission permission) throws java.io.IOException
AbstractFileSystemFileContext.setPermission(Path, FsPermission) except that Path f
must be for this file system.setPermission in class AbstractFileSystemf - the path.permission - permission.AccessControlException - access control exception.java.io.FileNotFoundException - file not found exception.UnresolvedLinkException - unresolved link exception.java.io.IOException - raised on errors performing I/O.public boolean setReplication(Path f, short replication) throws java.io.IOException
AbstractFileSystemFileContext.setReplication(Path, short) except that Path f must be
for this file system.setReplication in class AbstractFileSystemf - the path.replication - replication.AccessControlException - access control exception.java.io.FileNotFoundException - file not found exception.UnresolvedLinkException - unresolved link exception.java.io.IOException - raised on errors performing I/O.public void setTimes(Path f, long mtime, long atime) throws java.io.IOException
AbstractFileSystemFileContext.setTimes(Path, long, long) except that Path f must be
for this file system.setTimes in class AbstractFileSystemf - the path.mtime - modify time.atime - access time.AccessControlException - access control exception.java.io.FileNotFoundException - file not found exception.UnresolvedLinkException - unresolved link exception.java.io.IOException - raised on errors performing I/O.public void setVerifyChecksum(boolean verifyChecksum)
throws java.io.IOException
AbstractFileSystemFileContext.setVerifyChecksum(boolean, Path) except that Path f
must be for this file system.setVerifyChecksum in class AbstractFileSystemverifyChecksum - verify check sum flag.AccessControlException - access control exception.java.io.IOException - raised on errors performing I/O.public boolean supportsSymlinks()
AbstractFileSystemsupportsSymlinks in class AbstractFileSystempublic void createSymlink(Path target, Path link, boolean createParent) throws java.io.IOException
AbstractFileSystemFileContext.createSymlink(Path, Path, boolean);createSymlink in class AbstractFileSystemtarget - target.link - link.createParent - create parent.java.io.IOException - raised on errors performing I/O.UnresolvedLinkException - unresolved link exception.public Path getLinkTarget(Path f) throws java.io.IOException
AbstractFileSystemFSLinkResolver, and differs from the similarly named method
FileContext.getLinkTarget(Path).getLinkTarget in class AbstractFileSystemf - the path.java.io.IOException - subclass implementations may throw IOExceptionpublic java.lang.String getCanonicalServiceName()
AbstractFileSystemgetCanonicalServiceName in class AbstractFileSystempublic java.util.List<Token<?>> getDelegationTokens(java.lang.String renewer) throws java.io.IOException
AbstractFileSystemgetDelegationTokens in class AbstractFileSystemrenewer - the account name that is allowed to renew the token.java.io.IOException - raised on errors performing I/O.public java.util.concurrent.CompletableFuture<FSDataInputStream> openFileWithOptions(Path path, OpenFileParameters parameters) throws java.io.IOException
FileSystem.openFileWithOptions(Path, org.apache.hadoop.fs.impl.OpenFileParameters).openFileWithOptions in class AbstractFileSystempath - path to the fileparameters - open file parameters from the builder.java.io.IOException - failure to resolve the link.java.lang.IllegalArgumentException - unknown mandatory keypublic boolean hasPathCapability(Path path, java.lang.String capability) throws java.io.IOException
PathCapabilitiestrue, this instance is explicitly
declaring that the capability is available.
If the function returns false, it can mean one of:
Implementors: PathCapabilitiesSupport
can be used to help implement this method.
hasPathCapability in interface PathCapabilitieshasPathCapability in class AbstractFileSystempath - path to query the capability of.capability - non-null, non-empty string to query the path for support.java.io.IOException - this should not be raised, except on problems
resolving paths or relaying the call.Copyright © 2008–2025 Apache Software Foundation. All rights reserved.