public abstract class AbstractCollectInfoCommand extends Object implements Command
Modifier and Type | Field and Description |
---|---|
protected FileSystemContext |
mFsContext |
protected String |
mWorkingDirPath |
Constructor and Description |
---|
AbstractCollectInfoCommand(FileSystemContext fsContext)
Creates an instance of
AbstractCollectInfoCommand . |
Modifier and Type | Method and Description |
---|---|
File |
generateOutputFile(String workingDirPath,
String fileName)
Generates the output file for the command to write printouts to.
|
String |
getWorkingDirectory(org.apache.commons.cli.CommandLine cl)
Gets the directory that this command should output to.
|
void |
validateArgs(org.apache.commons.cli.CommandLine cl)
Checks if the arguments are valid or throw InvalidArgumentException.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close, getCommandName, getDescription, getOptions, getSubCommands, getUsage, hasSubCommand, parseAndValidateArgs, run
protected FileSystemContext mFsContext
protected String mWorkingDirPath
public AbstractCollectInfoCommand(FileSystemContext fsContext)
AbstractCollectInfoCommand
.fsContext
- FileSystemContext
the context to run inpublic void validateArgs(org.apache.commons.cli.CommandLine cl) throws InvalidArgumentException
Command
validateArgs
in interface Command
cl
- the parsed command line for the argumentsInvalidArgumentException
- when arguments are not validpublic String getWorkingDirectory(org.apache.commons.cli.CommandLine cl)
cl
- the parsed CommandLine
public File generateOutputFile(String workingDirPath, String fileName) throws IOException
workingDirPath
- the base directory this command should output tofileName
- name of the output fileIOException
Copyright © 2023. All Rights Reserved.