Package org.apache.hadoop.fs
Class Stat
java.lang.Object
org.apache.hadoop.util.Shell
org.apache.hadoop.fs.Stat
Wrapper for the Unix stat(1) command. Used to workaround the lack of
lstat(2) in Java 6.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.hadoop.util.Shell
Shell.CommandExecutor, Shell.ExitCodeException, Shell.OSType, Shell.ShellCommandExecutor -
Field Summary
Fields inherited from class org.apache.hadoop.util.Shell
ENV_HADOOP_HOME, ENV_NAME_REGEX, FREEBSD, inheritParentEnv, isSetsidAvailable, LINK_COMMAND, LINUX, LOG, MAC, osType, OTHER, PPC_64, READ_LINK_COMMAND, SET_GROUP_COMMAND, SET_OWNER_COMMAND, SET_PERMISSION_COMMAND, SOLARIS, SYSPROP_HADOOP_HOME_DIR, timeOutInterval, TOKEN_SEPARATOR_REGEX, USER_NAME_COMMAND, WINDOWS, WINDOWS_MAX_SHELL_LENGHT, WINDOWS_MAX_SHELL_LENGTH, WindowsProcessLaunchLock, WINUTILS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected String[]return an array containing the command name and its parameters.static booleanWhether Stat is supported on the current platform.protected voidparseExecResult(BufferedReader lines) Parse the execution result.Methods inherited from class org.apache.hadoop.util.Shell
appendScriptExtension, appendScriptExtension, bashQuote, checkIsBashSupported, checkWindowsCommandLineLength, destroyAllShellProcesses, execCommand, execCommand, execCommand, getAllShells, getCheckProcessIsAliveCommand, getEnvironment, getEnvironmentVariableRegex, getExitCode, getGetPermissionCommand, getGroupsCommand, getGroupsForUserCommand, getGroupsIDForUserCommand, getHadoopHome, getMemlockLimit, getProcess, getQualifiedBin, getQualifiedBinPath, getReadlinkCommand, getRunScriptCommand, getSetOwnerCommand, getSetPermissionCommand, getSetPermissionCommand, getSignalKillCommand, getSymlinkCommand, getUsersForNetgroupCommand, getWaitingThread, getWinUtilsFile, getWinUtilsPath, hasWinutilsPath, isJava7OrAbove, isJavaVersionAtLeast, isTimedOut, run, setEnvironment, setWorkingDirectory
-
Constructor Details
-
Stat
- Throws:
IOException
-
-
Method Details
-
getFileStatus
- Throws:
IOException
-
isAvailable
public static boolean isAvailable()Whether Stat is supported on the current platform.- Returns:
- if is available true, not false.
-
getExecString
Description copied from class:Shellreturn an array containing the command name and its parameters.- Specified by:
getExecStringin classShell- Returns:
- exec string array.
-
parseExecResult
Description copied from class:ShellParse the execution result.- Specified by:
parseExecResultin classShell- Parameters:
lines- lines.- Throws:
IOException- raised on errors performing I/O.
-