Brooklyn

brooklyn.util.file
[Java] Class ArchiveUtils

java.lang.Object
  brooklyn.util.file.ArchiveUtils

public class ArchiveUtils

Nested Class Summary
static enum ArchiveUtils.ArchiveType

The types of archive that are supported by Brooklyn.

 
Field Summary
static int NUM_RETRIES_FOR_COPYING

Number of attempts when copying a file to a remote server.

 
Method Summary
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.util.Map 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.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 void deploy(java.util.Map props, java.lang.String archiveUrl, SshMachineLocation machine, java.lang.String destDir, java.lang.String destFile)

static void deploy(java.util.Map props, java.lang.String archiveUrl, SshMachineLocation machine, java.lang.String tmpDir, java.lang.String destDir, java.lang.String destFile)

Deploys an archive file to a remote machine and extracts the contents.

static java.util.List 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 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 int install(SshMachineLocation machine, java.lang.String urlToInstall, java.lang.String target)

Installs a URL onto a remote machine.

static int install(java.util.Map props, SshMachineLocation machine, java.lang.String urlToInstall, java.lang.String target, int numAttempts)

Installs a URL onto a remote machine.

static java.util.List 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.

 
Methods inherited from class java.lang.Object
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
 

Field Detail

NUM_RETRIES_FOR_COPYING

public static final int NUM_RETRIES_FOR_COPYING
Number of attempts when copying a file to a remote server.


 
Method Detail

deploy

public 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.


deploy

public static void deploy(java.util.Map props, java.lang.String archiveUrl, SshMachineLocation machine, java.lang.String destDir)
Deploys an archive file to a remote machine and extracts the contents.

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.

See Also:
deploy(String, SshMachineLocation, String, String)
deploy(Map, String, SshMachineLocation, String, String, String)


deploy

public 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.

Copies the archive file from the given URL to a file in the destination directory and extracts the contents.

See Also:
deploy(String, SshMachineLocation, String)
deploy(Map, String, SshMachineLocation, String, String, String)


deploy

public static void deploy(java.util.Map props, java.lang.String archiveUrl, SshMachineLocation machine, java.lang.String destDir, java.lang.String destFile)


deploy

public static void deploy(java.util.Map props, java.lang.String archiveUrl, SshMachineLocation machine, java.lang.String tmpDir, java.lang.String destDir, java.lang.String destFile)
Deploys an archive file to a remote machine and extracts the contents.

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.

See Also:
deploy(String, SshMachineLocation, String)
deploy(Map, String, SshMachineLocation, String, String, String)
install(SshMachineLocation, String, String, int)


extractCommands

public static java.util.List 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.

Optionally, Java archives of type

See Also:
extractCommands(String, String)


extractCommands

public static java.util.List 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.

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.

See Also:
extractCommands(String, String, String, boolean)


install

public static int install(SshMachineLocation machine, java.lang.String urlToInstall, java.lang.String target)
Installs a URL onto a remote machine.
See Also:
install(Map, SshMachineLocation, String, String, int)


install

public static int install(java.util.Map props, SshMachineLocation machine, java.lang.String urlToInstall, java.lang.String target, int numAttempts)
Installs a URL onto a remote machine.
See Also:
install(SshMachineLocation, String, String)
SshMachineLocation#installTo(Map, String, String)#installTo(Map, String, String)


installCommands

public static java.util.List installCommands(java.lang.String fileName)
Returns the list of commands used to install support for an archive with the given name.


readFullyString

public static java.lang.String readFullyString(java.io.File sourceFile)
Copies the entire contents of a file to a String.
See Also:
com.google.common.io.Files#toString(File, java.nio.charset.Charset)


 

Brooklyn Multi-Cloud Application Management Platform
brooklyncentral.github.com. Apache License. © 2012.