|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.hadoop.fs.FileContext.Util
public class FileContext.Util
Utility/library methods built over the basic FileContext methods. Since this are library functions, the oprtation are not atomic and some of them may partially complete if other threads are making changes to the same part of the name space.
Constructor Summary | |
---|---|
FileContext.Util()
|
Method Summary | |
---|---|
boolean |
copy(Path src,
Path dst)
Copy file from src to dest. |
boolean |
copy(Path src,
Path dst,
boolean deleteSource,
boolean overwrite)
Copy from src to dst, optionally deleting src and overwriting dst. |
boolean |
exists(Path f)
Does the file exist? Note: Avoid using this method if you already have FileStatus in hand. |
ContentSummary |
getContentSummary(Path f)
Return the ContentSummary of path f. |
FileStatus[] |
globStatus(Path pathPattern)
Return all the files that match filePattern and are not checksum files. |
FileStatus[] |
globStatus(Path pathPattern,
PathFilter filter)
Return an array of FileStatus objects whose path names match pathPattern and is accepted by the user-supplied path filter. |
RemoteIterator<LocatedFileStatus> |
listFiles(Path f,
boolean recursive)
List the statuses and block locations of the files in the given path. |
FileStatus[] |
listStatus(Path f)
List the statuses of the files/directories in the given path if the path is a directory. |
FileStatus[] |
listStatus(Path[] files)
See listStatus(Path[], PathFilter) |
FileStatus[] |
listStatus(Path[] files,
PathFilter filter)
Filter files/directories in the given list of paths using user-supplied path filter. |
FileStatus[] |
listStatus(Path f,
PathFilter filter)
Filter files/directories in the given path using the user-supplied path filter. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FileContext.Util()
Method Detail |
---|
public boolean exists(Path f) throws org.apache.hadoop.security.AccessControlException, UnsupportedFileSystemException, IOException
f
- the file or dir to be checked
org.apache.hadoop.security.AccessControlException
- If access is denied
IOException
- If an I/O error occurred
UnsupportedFileSystemException
- If file system for f
is
not supported
Exceptions applicable to file systems accessed over RPC:
RpcClientException
- If an exception occurred in the RPC client
RpcServerException
- If an exception occurred in the RPC server
UnexpectedServerException
- If server implementation throws
undeclared exception to RPC serverpublic ContentSummary getContentSummary(Path f) throws org.apache.hadoop.security.AccessControlException, FileNotFoundException, UnsupportedFileSystemException, IOException
ContentSummary
of path f.
f
- path
ContentSummary
of path f.
org.apache.hadoop.security.AccessControlException
- If access is denied
FileNotFoundException
- If f
does not exist
UnsupportedFileSystemException
- If file system for
f
is not supported
IOException
- If an I/O error occurred
Exceptions applicable to file systems accessed over RPC:
RpcClientException
- If an exception occurred in the RPC client
RpcServerException
- If an exception occurred in the RPC server
UnexpectedServerException
- If server implementation throws
undeclared exception to RPC serverpublic FileStatus[] listStatus(Path[] files) throws org.apache.hadoop.security.AccessControlException, FileNotFoundException, IOException
listStatus(Path[], PathFilter)
org.apache.hadoop.security.AccessControlException
FileNotFoundException
IOException
public FileStatus[] listStatus(Path f, PathFilter filter) throws org.apache.hadoop.security.AccessControlException, FileNotFoundException, UnsupportedFileSystemException, IOException
f
- is the path namefilter
- is the user-supplied path filter
org.apache.hadoop.security.AccessControlException
- If access is denied
FileNotFoundException
- If f
does not exist
UnsupportedFileSystemException
- If file system for
pathPattern
is not supported
IOException
- If an I/O error occurred
Exceptions applicable to file systems accessed over RPC:
RpcClientException
- If an exception occurred in the RPC client
RpcServerException
- If an exception occurred in the RPC server
UnexpectedServerException
- If server implementation throws
undeclared exception to RPC serverpublic FileStatus[] listStatus(Path[] files, PathFilter filter) throws org.apache.hadoop.security.AccessControlException, FileNotFoundException, IOException
files
- is a list of pathsfilter
- is the filter
org.apache.hadoop.security.AccessControlException
- If access is denied
FileNotFoundException
- If a file in files
does not
exist
IOException
- If an I/O error occurred
Exceptions applicable to file systems accessed over RPC:
RpcClientException
- If an exception occurred in the RPC client
RpcServerException
- If an exception occurred in the RPC server
UnexpectedServerException
- If server implementation throws
undeclared exception to RPC serverpublic FileStatus[] listStatus(Path f) throws org.apache.hadoop.security.AccessControlException, FileNotFoundException, UnsupportedFileSystemException, IOException
f
- is the path
org.apache.hadoop.security.AccessControlException
- If access is denied
FileNotFoundException
- If f
does not exist
UnsupportedFileSystemException
- If file system for f
is
not supported
IOException
- If an I/O error occurred
Exceptions applicable to file systems accessed over RPC:
RpcClientException
- If an exception occurred in the RPC client
RpcServerException
- If an exception occurred in the RPC server
UnexpectedServerException
- If server implementation throws
undeclared exception to RPC serverpublic RemoteIterator<LocatedFileStatus> listFiles(Path f, boolean recursive) throws org.apache.hadoop.security.AccessControlException, FileNotFoundException, UnsupportedFileSystemException, IOException
f
- is the pathrecursive
- if the subdirectories need to be traversed recursively
org.apache.hadoop.security.AccessControlException
- If access is denied
FileNotFoundException
- If f
does not exist
UnsupportedFileSystemException
- If file system for f
is not supported
IOException
- If an I/O error occurred
Exceptions applicable to file systems accessed over RPC:
RpcClientException
- If an exception occurred in the RPC client
RpcServerException
- If an exception occurred in the RPC server
UnexpectedServerException
- If server implementation throws
undeclared exception to RPC serverpublic FileStatus[] globStatus(Path pathPattern) throws org.apache.hadoop.security.AccessControlException, UnsupportedFileSystemException, IOException
Return all the files that match filePattern and are not checksum files. Results are sorted by their names.
A filename pattern is composed of regular characters and special pattern matching characters, which are:
pathPattern
- a regular expression specifying a pth pattern
org.apache.hadoop.security.AccessControlException
- If access is denied
UnsupportedFileSystemException
- If file system for
pathPattern
is not supported
IOException
- If an I/O error occurred
Exceptions applicable to file systems accessed over RPC:
RpcClientException
- If an exception occurred in the RPC client
RpcServerException
- If an exception occurred in the RPC server
UnexpectedServerException
- If server implementation throws
undeclared exception to RPC serverpublic FileStatus[] globStatus(Path pathPattern, PathFilter filter) throws org.apache.hadoop.security.AccessControlException, UnsupportedFileSystemException, IOException
pathPattern
- regular expression specifying the path patternfilter
- user-supplied path filter
org.apache.hadoop.security.AccessControlException
- If access is denied
UnsupportedFileSystemException
- If file system for
pathPattern
is not supported
IOException
- If an I/O error occurred
Exceptions applicable to file systems accessed over RPC:
RpcClientException
- If an exception occurred in the RPC client
RpcServerException
- If an exception occurred in the RPC server
UnexpectedServerException
- If server implementation throws
undeclared exception to RPC serverpublic boolean copy(Path src, Path dst) throws org.apache.hadoop.security.AccessControlException, FileAlreadyExistsException, FileNotFoundException, ParentNotDirectoryException, UnsupportedFileSystemException, IOException
copy(Path, Path, boolean, boolean)
org.apache.hadoop.security.AccessControlException
FileAlreadyExistsException
FileNotFoundException
ParentNotDirectoryException
UnsupportedFileSystemException
IOException
public boolean copy(Path src, Path dst, boolean deleteSource, boolean overwrite) throws org.apache.hadoop.security.AccessControlException, FileAlreadyExistsException, FileNotFoundException, ParentNotDirectoryException, UnsupportedFileSystemException, IOException
src
- dst
- deleteSource
- - delete src if trueoverwrite
- overwrite dst if true; throw IOException if dst exists
and overwrite is false.
org.apache.hadoop.security.AccessControlException
- If access is denied
FileAlreadyExistsException
- If dst
already exists
FileNotFoundException
- If src
does not exist
ParentNotDirectoryException
- If parent of dst
is not
a directory
UnsupportedFileSystemException
- If file system for
src
or dst
is not supported
IOException
- If an I/O error occurred
Exceptions applicable to file systems accessed over RPC:
RpcClientException
- If an exception occurred in the RPC client
RpcServerException
- If an exception occurred in the RPC server
UnexpectedServerException
- If server implementation throws
undeclared exception to RPC server
RuntimeExceptions:
InvalidPathException
- If path dst
is invalid
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |