public class HttpFileSystem extends FileSystem
FileSystem.Statistics
DEFAULT_FS, FS_DEFAULT_NAME_KEY, SHUTDOWN_HOOK_PRIORITY, statistics, TRASH_PREFIX, USER_HOME_PREFIX
Constructor and Description |
---|
HttpFileSystem() |
Modifier and Type | Method and Description |
---|---|
FSDataOutputStream |
append(Path path,
int i,
Progressable progressable)
Append to an existing file (optional operation).
|
FSDataOutputStream |
create(Path path,
FsPermission fsPermission,
boolean b,
int i,
short i1,
long l,
Progressable progressable)
Create an FSDataOutputStream at the indicated Path with write-progress
reporting.
|
boolean |
delete(Path path,
boolean b)
Delete a file.
|
FileStatus |
getFileStatus(Path path)
Return a file status object that represents the path.
|
String |
getScheme()
Return the protocol scheme for this FileSystem.
|
URI |
getUri()
Returns a URI which identifies this FileSystem.
|
Path |
getWorkingDirectory()
Get the current working directory for the given FileSystem
|
void |
initialize(URI name,
Configuration conf)
Initialize a FileSystem.
|
FileStatus[] |
listStatus(Path path)
List the statuses of the files/directories in the given path if the path is
a directory.
|
boolean |
mkdirs(Path path,
FsPermission fsPermission)
Make the given file and all non-existent parents into
directories.
|
FSDataInputStream |
open(Path path,
int bufferSize)
Opens an FSDataInputStream at the indicated Path.
|
boolean |
rename(Path path,
Path path1)
Renames Path src to Path dst.
|
void |
setWorkingDirectory(Path path)
Set the current working directory for the given FileSystem.
|
addDelegationTokens, append, append, appendFile, areSymlinksEnabled, cancelDeleteOnExit, canonicalizeUri, checkPath, clearStatistics, close, closeAll, closeAllForUGI, completeLocalOutput, concat, copyFromLocalFile, copyFromLocalFile, copyFromLocalFile, copyFromLocalFile, copyToLocalFile, copyToLocalFile, copyToLocalFile, create, create, create, create, create, create, create, create, create, create, create, create, createFile, createNewFile, createNonRecursive, createNonRecursive, createNonRecursive, createSnapshot, createSnapshot, createSymlink, delete, deleteOnExit, deleteSnapshot, enableSymlinks, exists, fixRelativePart, get, get, get, getAclStatus, getAllStatistics, getAllStoragePolicies, getBlockSize, getCanonicalServiceName, getCanonicalUri, getContentSummary, getDefaultBlockSize, getDefaultBlockSize, getDefaultPort, getDefaultReplication, getDefaultReplication, getDefaultUri, getFileBlockLocations, getFileBlockLocations, getFileChecksum, getFileChecksum, getFileLinkStatus, getFileSystemClass, getFSofPath, getGlobalStorageStatistics, getHomeDirectory, getInitialWorkingDirectory, getLength, getLinkTarget, getLocal, getName, getNamed, getQuotaUsage, getReplication, getServerDefaults, getServerDefaults, getStatistics, getStatistics, getStatus, getStatus, getStoragePolicy, getStorageStatistics, getTrashRoot, getTrashRoots, getUsed, getUsed, getXAttr, getXAttrs, getXAttrs, globStatus, globStatus, isDirectory, isFile, listCorruptFileBlocks, listFiles, listLocatedStatus, listLocatedStatus, listStatus, listStatus, listStatus, listStatusIterator, listXAttrs, makeQualified, mkdirs, mkdirs, modifyAclEntries, moveFromLocalFile, moveFromLocalFile, moveToLocalFile, msync, newInstance, newInstance, newInstance, newInstanceLocal, open, primitiveCreate, primitiveMkdir, primitiveMkdir, printStatistics, processDeleteOnExit, removeAcl, removeAclEntries, removeDefaultAcl, removeXAttr, rename, renameSnapshot, resolveLink, resolvePath, setAcl, setDefaultUri, setDefaultUri, setOwner, setPermission, setReplication, setStoragePolicy, setTimes, setVerifyChecksum, setWriteChecksum, setXAttr, setXAttr, startLocalOutput, supportsSymlinks, truncate, unsetStoragePolicy
getConf, setConf
public String getScheme()
FileSystem
This implementation throws an UnsupportedOperationException
.
public void initialize(URI name, Configuration conf) throws IOException
FileSystem
initialize
in class FileSystem
name
- a URI whose authority section names the host, port, etc.
for this FileSystemconf
- the configurationIOException
- on any failure to initialize this instance.public URI getUri()
FileSystem
getUri
in class FileSystem
public FSDataInputStream open(Path path, int bufferSize) throws IOException
FileSystem
open
in class FileSystem
path
- the file name to openbufferSize
- the size of the buffer to be used.IOException
- IO failurepublic FSDataOutputStream create(Path path, FsPermission fsPermission, boolean b, int i, short i1, long l, Progressable progressable) throws IOException
FileSystem
create
in class FileSystem
path
- the file name to openfsPermission
- file permissionb
- if a file with this name already exists, then if true,
the file will be overwritten, and if false an error will be thrown.i
- the size of the buffer to be used.i1
- required block replication for the file.l
- block sizeprogressable
- the progress reporterIOException
- IO failureFileSystem.setPermission(Path, FsPermission)
public FSDataOutputStream append(Path path, int i, Progressable progressable) throws IOException
FileSystem
append
in class FileSystem
path
- the existing file to be appended.i
- the size of the buffer to be used.progressable
- for reporting progress if it is not null.IOException
- IO failurepublic boolean rename(Path path, Path path1) throws IOException
FileSystem
rename
in class FileSystem
path
- path to be renamedpath1
- new path after renameIOException
- on failurepublic boolean delete(Path path, boolean b) throws IOException
FileSystem
delete
in class FileSystem
path
- the path to delete.b
- if path is a directory and set to
true, the directory is deleted else throws an exception. In
case of a file the recursive can be set to either true or false.IOException
- IO failurepublic FileStatus[] listStatus(Path path) throws IOException
FileSystem
Does not guarantee to return the List of files/directories status in a sorted order.
listStatus
in class FileSystem
path
- given pathFileNotFoundException
- when the path does not existIOException
- see specific implementationpublic void setWorkingDirectory(Path path)
FileSystem
setWorkingDirectory
in class FileSystem
path
- Path of new working directorypublic Path getWorkingDirectory()
FileSystem
getWorkingDirectory
in class FileSystem
public boolean mkdirs(Path path, FsPermission fsPermission) throws IOException
FileSystem
mkdirs
in class FileSystem
path
- path to createfsPermission
- to apply to fIOException
- IO failurepublic FileStatus getFileStatus(Path path) throws IOException
FileSystem
getFileStatus
in class FileSystem
path
- The path we want information fromFileNotFoundException
- when the path does not existIOException
- see specific implementationCopyright © 2022 Apache Software Foundation. All rights reserved.