public class AsadminInput extends Object
Primarily (but not exclusively) for security reasons, it is useful to be able to have asadmin read data from its System.in. This class provides the logic to do so consistently. It also provides a little help for writing data to a stream such that it will be acceptable as input.
The input stream must have the following format:
version=some-version-value (lines as expected by the specified version)
Currently there is only one version supported. The lines following
the version spec must be in the format of a properties file, with the convention
that each property name is (category).(property-within-category)=value
The AsadminInput.InputReader returned will return a MapAsadminInput.InputReader.settings() method. The map will contain one entry for
each category in the input, and the associated Properties object will map each
property-within-category to its value.
| Modifier and Type | Class and Description |
|---|---|
static interface |
AsadminInput.InputReader |
| Modifier and Type | Field and Description |
|---|---|
static String |
CLI_INPUT_OPTION |
static String |
CLI_INPUT_OPTION_NAME |
static String |
SYSTEM_IN_INDICATOR |
| Constructor and Description |
|---|
AsadminInput() |
| Modifier and Type | Method and Description |
|---|---|
static AsadminInput.InputReader |
reader(InputStream is)
Returns a reader that can consume the specified version of asadmin input
|
static AsadminInput.InputReader |
reader(String inputPath)
Returns an asadmin reader for reading from the specified URI.
|
static String |
versionSpecifier()
Returns a string containing a specifier for the current version, suitable
for use as the first line to write to the asadmin System.in stream.
|
public static final String CLI_INPUT_OPTION_NAME
public static final String CLI_INPUT_OPTION
public static final String SYSTEM_IN_INDICATOR
public static String versionSpecifier()
public static AsadminInput.InputReader reader(String inputPath) throws URISyntaxException, IOException
inputPath - a valid file path or the dash indicating to read from system.inIOExceptionURISyntaxExceptionpublic static AsadminInput.InputReader reader(InputStream is) throws IOException
IOExceptionCopyright © 2017–2020 Eclipse Foundation. All rights reserved.