@ThreadSafe @PublicApi public final class LsCommand extends AbstractFileSystemCommand
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
IN_ALLUXIO_STATE_DIR |
static java.lang.String |
IN_ALLUXIO_STATE_FILE_FORMAT |
static java.lang.String |
LS_FORMAT |
static java.lang.String |
LS_FORMAT_ALLUXIO_STATE |
static java.lang.String |
LS_FORMAT_FILE_PATH |
static java.lang.String |
LS_FORMAT_FILE_SIZE |
static java.lang.String |
LS_FORMAT_GROUP_NAME |
static java.lang.String |
LS_FORMAT_NO_ACL |
static java.lang.String |
LS_FORMAT_PERMISSION |
static java.lang.String |
LS_FORMAT_PERSISTENCE_STATE |
static java.lang.String |
LS_FORMAT_TIMESTAMP |
static java.lang.String |
LS_FORMAT_USER_NAME |
mFileSystem, mFsContext| Constructor and Description |
|---|
LsCommand(FileSystemContext fsContext)
Constructs a new instance to display information for all directories and files directly under
the path specified in args.
|
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
formatLsString(boolean hSize,
boolean acl,
boolean isFolder,
java.lang.String permission,
java.lang.String userName,
java.lang.String groupName,
long size,
long timestamp,
int inAlluxioPercentage,
java.lang.String persistenceState,
java.lang.String path,
java.lang.String dateFormatPattern)
Formats the ls result string.
|
java.lang.String |
getCommandName() |
java.lang.String |
getDescription() |
org.apache.commons.cli.Options |
getOptions() |
java.lang.String |
getUsage() |
int |
run(org.apache.commons.cli.CommandLine cl) |
protected void |
runPlainPath(AlluxioURI path,
org.apache.commons.cli.CommandLine cl)
Runs the command for a particular URI that does not contain wildcard in its path.
|
void |
validateArgs(org.apache.commons.cli.CommandLine cl) |
processHeader, runWildCardCmdclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclose, getSubCommands, hasSubCommand, parseAndValidateArgspublic static final java.lang.String IN_ALLUXIO_STATE_DIR
public static final java.lang.String IN_ALLUXIO_STATE_FILE_FORMAT
public static final java.lang.String LS_FORMAT_PERMISSION
public static final java.lang.String LS_FORMAT_FILE_SIZE
public static final java.lang.String LS_FORMAT_TIMESTAMP
public static final java.lang.String LS_FORMAT_ALLUXIO_STATE
public static final java.lang.String LS_FORMAT_PERSISTENCE_STATE
public static final java.lang.String LS_FORMAT_USER_NAME
public static final java.lang.String LS_FORMAT_GROUP_NAME
public static final java.lang.String LS_FORMAT_FILE_PATH
public static final java.lang.String LS_FORMAT_NO_ACL
public static final java.lang.String LS_FORMAT
public LsCommand(FileSystemContext fsContext)
fsContext - the filesystem of Alluxiopublic static java.lang.String formatLsString(boolean hSize,
boolean acl,
boolean isFolder,
java.lang.String permission,
java.lang.String userName,
java.lang.String groupName,
long size,
long timestamp,
int inAlluxioPercentage,
java.lang.String persistenceState,
java.lang.String path,
java.lang.String dateFormatPattern)
hSize - print human-readable format sizesacl - whether security is enabledisFolder - whether this path is a file or a folderpermission - permission stringuserName - user namegroupName - group namesize - size of the file in bytestimestamp - the epoch time in msinAlluxioPercentage - whether the file is in AlluxiopersistenceState - the persistence state of the filepath - path of the file or folderdateFormatPattern - the format to follow when printing datespublic java.lang.String getCommandName()
public org.apache.commons.cli.Options getOptions()
protected void runPlainPath(AlluxioURI path, org.apache.commons.cli.CommandLine cl) throws AlluxioException, java.io.IOException
AbstractFileSystemCommandrunPlainPath in class AbstractFileSystemCommandpath - an AlluxioURI that does not contain wildcardcl - object containing the original commandLineAlluxioExceptionjava.io.IOExceptionpublic int run(org.apache.commons.cli.CommandLine cl)
throws AlluxioException,
java.io.IOException
AlluxioExceptionjava.io.IOExceptionpublic java.lang.String getUsage()
public java.lang.String getDescription()
public void validateArgs(org.apache.commons.cli.CommandLine cl)
throws InvalidArgumentException
InvalidArgumentExceptionCopyright © 2022. All Rights Reserved.