public interface ExecutionContext
Command
or chain of joined commands. It is passed to
the execute(..)
method providing access to the current directory, environment variables and
other information useful for the commands during their execution.Modifier and Type | Method and Description |
---|---|
ConverterRegistry |
getConverterRegistry() |
File |
getCurrentDirectory()
Returns the current directory, never null.
|
Map<String,String> |
getEnv() |
Locale |
getLocale() |
File |
getRelativeToCurrentDirectory(File file)
Returns the given file but relative to the
current directory if the given file path is not absolute. |
Properties |
getSys() |
File |
getTempDirectory() |
String |
getUser()
Returns the user name, usually defined by the
"user.name" system
property. |
File |
getUserHome()
Returns the user home directory, usually defined by the
"user.home" system property. |
<V> ValueConverter<V> |
getValueConverterFor(Class<V> type) |
VariableContext |
getVariableContext() |
File getCurrentDirectory()
"user.dir"
system property is returned."user.dir"
system
property it has not been set explicitlySystem.getProperties()
File getRelativeToCurrentDirectory(File file)
current directory
if the given file path is not absolute. Most commands
should resolve files through this method since the unix4j current
directory and the Java current directory are not the same.file
- the file to return relative to the current directory if it
denotes a relative pathcurrent directory
String getUser()
"user.name"
system
property."user.name"
system
propertySystem.getProperties()
File getUserHome()
"user.home"
system property."user.home"
system propertySystem.getProperties()
File getTempDirectory()
Properties getSys()
VariableContext getVariableContext()
ConverterRegistry getConverterRegistry()
<V> ValueConverter<V> getValueConverterFor(Class<V> type)
Copyright © 2024. All rights reserved.