public final class CliFile extends Object implements org.jboss.creaper.core.online.OnlineCommand
Apply a list of CLI operations (a CLI script) read from a file. The file is treated as UTF-8 text.
The connect operations in the script are handled specially: bare connect operations without
arguments are simply ignored, as we are already connected, and connect host:port operations (with an argument
that specifies the host and port to connect to) are considered a failure. The script is scanned for the forbidden
connect operations before is it executed, so if this error happens, no operation from the script
has been performed yet.
| Constructor and Description |
|---|
CliFile(Class clazz)
Apply a CLI script from the classpath.
|
CliFile(File file)
Apply a CLI script from the filesystem (
file). |
| Modifier and Type | Method and Description |
|---|---|
void |
apply(org.jboss.creaper.core.online.OnlineCommandContext ctx) |
String |
toString() |
public CliFile(File file)
file).file - an existing file on the filesystemIllegalArgumentException - if file is null or the file doesn't existpublic CliFile(Class clazz)
clazz and have the .cli extension. On the classpath, the script file must live along
the class file.clazz - the class that will be used for loading the script and also for discovering its nameIllegalArgumentException - if the clazz is nullpublic void apply(org.jboss.creaper.core.online.OnlineCommandContext ctx)
throws IOException,
org.jboss.creaper.core.online.CliException,
org.jboss.creaper.core.CommandFailedException
apply in interface org.jboss.creaper.core.online.OnlineCommandIOExceptionorg.jboss.creaper.core.online.CliExceptionorg.jboss.creaper.core.CommandFailedExceptionCopyright © 2015. All rights reserved.