public class ArchiveUtils
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
ArchiveUtils.ArchiveType
The types of archive that are supported by Brooklyn.
|
Modifier and Type | Field and Description |
---|---|
static int |
NUM_RETRIES_FOR_COPYING
Number of attempts when copying a file to a remote server.
|
Constructor and Description |
---|
ArchiveUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
deploy(java.util.Map<java.lang.String,?> props,
java.lang.String archiveUrl,
SshMachineLocation machine,
java.lang.String destDir)
Deploys an archive file to a remote machine and extracts the contents.
|
static void |
deploy(java.util.Map<java.lang.String,?> props,
java.lang.String archiveUrl,
SshMachineLocation machine,
java.lang.String destDir,
java.lang.String destFile) |
static void |
deploy(java.util.Map<java.lang.String,?> props,
java.lang.String archiveUrl,
SshMachineLocation machine,
java.lang.String tmpDir,
java.lang.String destDir,
java.lang.String destFile) |
static boolean |
deploy(ResourceUtils resolver,
java.util.Map<java.lang.String,?> props,
java.lang.String archiveUrl,
SshMachineLocation machine,
java.lang.String destDir,
boolean keepArchiveAfterUnpacking,
java.lang.String optionalTmpDir,
java.lang.String optionalDestFile)
Deploys an archive file to a remote machine and extracts the contents.
|
static void |
deploy(java.lang.String archiveUrl,
SshMachineLocation machine,
java.lang.String destDir)
Deploys an archive file to a remote machine and extracts the contents.
|
static void |
deploy(java.lang.String archiveUrl,
SshMachineLocation machine,
java.lang.String destDir,
java.lang.String destFile)
Deploys an archive file to a remote machine and extracts the contents.
|
static java.util.List<java.lang.String> |
extractCommands(java.lang.String fileName,
java.lang.String sourceDir)
Returns the list of commands used to extract the contents of the archive with the given name.
|
static java.util.List<java.lang.String> |
extractCommands(java.lang.String fileName,
java.lang.String sourceDir,
java.lang.String targetDir,
boolean extractJar)
Returns the list of commands used to extract the contents of the archive with the given name.
|
static java.util.List<java.lang.String> |
extractCommands(java.lang.String fileName,
java.lang.String sourceDir,
java.lang.String targetDir,
boolean extractJar,
boolean keepOriginal)
as
extractCommands(String, String, String, boolean) , but also with option to keep the original |
static int |
install(java.util.Map<java.lang.String,?> props,
SshMachineLocation machine,
java.lang.String urlToInstall,
java.lang.String target,
int numAttempts)
Installs a URL onto a remote machine.
|
static int |
install(ResourceUtils resolver,
java.util.Map<java.lang.String,?> props,
SshMachineLocation machine,
java.lang.String urlToInstall,
java.lang.String target,
int numAttempts) |
static int |
install(SshMachineLocation machine,
java.lang.String urlToInstall,
java.lang.String target)
Installs a URL onto a remote machine.
|
static java.util.List<java.lang.String> |
installCommands(java.lang.String fileName)
Returns the list of commands used to install support for an archive with the given name.
|
static java.lang.String |
readFullyString(java.io.File sourceFile)
Copies the entire contents of a file to a String.
|
public static final int NUM_RETRIES_FOR_COPYING
public static java.util.List<java.lang.String> installCommands(java.lang.String fileName)
public static java.util.List<java.lang.String> extractCommands(java.lang.String fileName, java.lang.String sourceDir, java.lang.String targetDir, boolean extractJar)
Optionally, Java archives of type
extractCommands(String, String)
public static java.util.List<java.lang.String> extractCommands(java.lang.String fileName, java.lang.String sourceDir, java.lang.String targetDir, boolean extractJar, boolean keepOriginal)
extractCommands(String, String, String, boolean)
, but also with option to keep the originalpublic static java.util.List<java.lang.String> extractCommands(java.lang.String fileName, java.lang.String sourceDir)
The archive will be extracted in its current directory unless it is a Java archive of type .jar
,
.war
or .ear
, which will be left as is.
public static void deploy(java.lang.String archiveUrl, SshMachineLocation machine, java.lang.String destDir)
public static void deploy(java.util.Map<java.lang.String,?> props, java.lang.String archiveUrl, SshMachineLocation machine, java.lang.String destDir)
Copies the archive file from the given URL to the destination directory and extracts the contents. If the URL is a local directory, the contents are packaged as a Zip archive first.
public static void deploy(java.lang.String archiveUrl, SshMachineLocation machine, java.lang.String destDir, java.lang.String destFile)
Copies the archive file from the given URL to a file in the destination directory and extracts the contents.
public static void deploy(java.util.Map<java.lang.String,?> props, java.lang.String archiveUrl, SshMachineLocation machine, java.lang.String destDir, java.lang.String destFile)
public static void deploy(java.util.Map<java.lang.String,?> props, java.lang.String archiveUrl, SshMachineLocation machine, java.lang.String tmpDir, java.lang.String destDir, java.lang.String destFile)
public static boolean deploy(ResourceUtils resolver, java.util.Map<java.lang.String,?> props, java.lang.String archiveUrl, SshMachineLocation machine, java.lang.String destDir, boolean keepArchiveAfterUnpacking, java.lang.String optionalTmpDir, java.lang.String optionalDestFile)
Copies the archive file from the given URL to a file in a temporary directory and extracts
the contents in the destination directory. For Java archives of type .jar
,
.war
or .ear
the file is simply copied.
deploy(String, SshMachineLocation, String)
,
deploy(Map, String, SshMachineLocation, String, String, String)
,
#install(SshMachineLocation, String, String, int)
public static int install(SshMachineLocation machine, java.lang.String urlToInstall, java.lang.String target)
public static int install(java.util.Map<java.lang.String,?> props, SshMachineLocation machine, java.lang.String urlToInstall, java.lang.String target, int numAttempts)
public static int install(ResourceUtils resolver, java.util.Map<java.lang.String,?> props, SshMachineLocation machine, java.lang.String urlToInstall, java.lang.String target, int numAttempts)
public static java.lang.String readFullyString(java.io.File sourceFile)
Files.toString(File, java.nio.charset.Charset)