public final class CdArguments extends Object implements Arguments<CdArguments>
cd
command.Constructor and Description |
---|
CdArguments()
Constructor to use if no options are specified.
|
Modifier and Type | Method and Description |
---|---|
File |
getFile()
Returns the
<file> operand value: the file to use as input; relative paths are not resolved (use the
string path argument to enable relative path resolving based on the
current working directory). |
CdArguments |
getForContext(ExecutionContext context)
Returns an arguments object for the given execution context with resolved
variables if necessary and possible.
|
String |
getPath()
Returns the
<path> operand value (variables are NOT resolved): the directory to become the new current working directory;
wildcards * and ? are supported; relative paths are resolved on the
basis of the current working directory. |
String |
getPath(ExecutionContext context)
Returns the
<path> (variables are resolved): the directory to become the new current working directory;
wildcards * and ? are supported; relative paths are resolved on the
basis of the current working directory. |
boolean |
isFileSet()
Returns true if the
<file> operand has been set. |
boolean |
isPathSet()
Returns true if the
<path> operand has been set. |
void |
setFile(File file)
Sets
<file> : the file to use as input; relative paths are not resolved (use the
string path argument to enable relative path resolving based on the
current working directory). |
void |
setPath(String path)
Sets
<path> : the directory to become the new current working directory;
wildcards * and ? are supported; relative paths are resolved on the
basis of the current working directory. |
String |
toString()
Returns a string representation of the command arguments and options.
|
public CdArguments()
public CdArguments getForContext(ExecutionContext context)
Arguments
this
arguments instance is simply returned.
If variables are present, they are resolved if such a variable is defined
in the VariableContext
returned by
context.
getVariableContext()
.
Values are converted if necessary with the ValueConverter
s
returned by
context.
getValueConverterFor(Class)
.
getForContext
in interface Arguments<CdArguments>
context
- the execution context providing access to variables and
converterspublic File getFile()
<file>
operand value: the file to use as input; relative paths are not resolved (use the
string path argument to enable relative path resolving based on the
current working directory).<file>
operand value (variables are not resolved)IllegalStateException
- if this operand has never been setpublic boolean isFileSet()
<file>
operand has been set.
Note that this method returns true even if null
was passed to the
setFile(java.io.File)
method.
<file>
operand has
been called at least oncepublic void setFile(File file)
<file>
: the file to use as input; relative paths are not resolved (use the
string path argument to enable relative path resolving based on the
current working directory).file
- the value for the <file>
operandpublic String getPath()
<path>
operand value (variables are NOT resolved): the directory to become the new current working directory;
wildcards * and ? are supported; relative paths are resolved on the
basis of the current working directory.<path>
operand value (variables are not resolved)IllegalStateException
- if this operand has never been setgetPath(ExecutionContext)
public String getPath(ExecutionContext context)
<path>
(variables are resolved): the directory to become the new current working directory;
wildcards * and ? are supported; relative paths are resolved on the
basis of the current working directory.context
- the execution context used to resolve variables<path>
operand value after resolving variablesIllegalStateException
- if this operand has never been setgetPath()
public boolean isPathSet()
<path>
operand has been set.
Note that this method returns true even if null
was passed to the
setPath(String)
method.
<path>
operand has
been called at least oncepublic void setPath(String path)
<path>
: the directory to become the new current working directory;
wildcards * and ? are supported; relative paths are resolved on the
basis of the current working directory.path
- the value for the <path>
operandpublic String toString()
Arguments
toString
in interface Arguments<CdArguments>
toString
in class Object
Copyright © 2024. All rights reserved.