|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.kuali.common.util.UnixUtils
public class UnixUtils
Execute Unix utilities using java.
Field Summary | |
---|---|
static int |
SUCCESS
|
Constructor Summary | |
---|---|
UnixUtils()
|
Method Summary | |
---|---|
static int |
execute(org.codehaus.plexus.util.cli.Commandline cl)
|
static String |
getLocation(String user,
String hostname,
String filename)
|
protected static List<String> |
getRsyncDirOptions(List<String> options)
Return a list containing the options --recursive , --archive , and --delete as the first 3
elements, with additional options coming after. |
static int |
rsync(List<String> options,
File source,
String destination)
rsync [options] source [user@]hostname:destination |
static int |
rsync(List<String> options,
String source,
String destination)
rsync [options] source destination rsync [options] source [user@]hostname:destination rsync [options] [user@]hostname:source destination |
static int |
rsync(String source,
String destination)
rsync source destination rsync source [user@]hostname:destination rsync [user@]hostname:source destination |
static int |
rsyncdirs(File source,
File destination)
rsync source destination |
static int |
rsyncdirs(File source,
String destination)
rsync source [user@]hostname:destination |
static int |
rsyncdirs(List<String> options,
File source,
File destination)
rsync [options] source destination |
static int |
rsyncdirs(List<String> options,
String source,
File destination)
rsync [options] [user@]hostname:source destination |
static int |
rsyncdirs(List<String> options,
String source,
String destination)
rsync [options] source destination rsync [options] source [user@]hostname:destination rsync [options] [user@]hostname:source destination |
static int |
rsyncdirs(String source,
File destination)
rsync [user@]hostname:source destination |
static int |
rsyncdirs(String source,
String destination)
rsync [options] source destination rsync [options] source [user@]hostname:destination rsync [options] [user@]hostname:source destination |
static int |
scp(File source,
String destination)
scp source destination |
static int |
scp(List<String> args,
File source,
String destination)
scp [args] source destination |
static int |
scp(List<String> args,
String source,
File destination)
scp [args] source destination |
static int |
scp(List<String> args,
String source,
String destination)
scp [args] source destination |
static int |
scp(String source,
File destination)
scp source destination |
static int |
scp(String source,
String destination)
scp source destination |
static int |
ssh(List<String> args,
String hostname,
String command)
ssh [args] hostname command |
static int |
ssh(List<String> args,
String user,
String hostname,
String command)
ssh [args] [user@]hostname command |
static int |
ssh(String hostname,
String command)
ssh hostname command |
static int |
ssh(String user,
String hostname,
String command)
ssh [user@]hostname command |
static int |
sshchmod(List<String> args,
String user,
String hostname,
String mode,
String path)
ssh [args] [user@]hostname chmod mode file |
static int |
sshchmod(String user,
String hostname,
String mode,
String file)
ssh [user@]hostname chmod mode file |
static int |
sshchown(List<String> args,
String user,
String hostname,
List<String> options,
String owner,
String group,
String file)
ssh [args] [user@]hostname chown [chownargs] owner:group file |
static int |
sshchown(List<String> args,
String hostname,
String owner,
String group,
String file)
ssh [args] hostname chown owner:group file |
static int |
sshchown(List<String> args,
String user,
String hostname,
String owner,
String group,
String file)
ssh [args] [user@]hostname chown owner:group file |
static int |
sshchown(String hostname,
String owner,
String group,
String file)
ssh hostname chown owner:group file |
static int |
sshchown(String user,
String hostname,
String owner,
String group,
String file)
ssh [user@]hostname chown owner:group file |
static int |
sshchownr(List<String> args,
String hostname,
String owner,
String group,
String file)
ssh [args] hostname chown -R owner:group file |
static int |
sshchownr(List<String> args,
String user,
String hostname,
String owner,
String group,
String file)
ssh [args] [user@]hostname chown -R owner:group file |
static int |
sshchownr(String hostname,
String owner,
String group,
String file)
ssh hostname chown -R owner:group file |
static int |
sshchownr(String user,
String hostname,
String owner,
String group,
String file)
ssh [user@]hostname chown -R owner:group file |
static int |
sshmkdir(List<String> args,
String hostname,
String path)
ssh [args] hostname mkdir -p directory |
static int |
sshmkdir(List<String> args,
String user,
String hostname,
String path)
ssh [args] [user@]hostname mkdir -p directory |
static int |
sshmkdir(String hostname,
String path)
ssh hostname mkdir -p directory |
static int |
sshmkdir(String user,
String hostname,
String path)
ssh [user@]hostname mkdir -p directory |
static int |
sshrm(List<String> args,
String hostname,
List<String> paths)
ssh [args] hostname rm -rf file ... |
static int |
sshrm(List<String> args,
String hostname,
String file)
ssh [args] hostname rm -rf file |
static int |
sshrm(List<String> args,
String user,
String hostname,
List<String> paths)
ssh [args] [user@]hostname rm -rf file ... |
static int |
sshrm(List<String> args,
String user,
String hostname,
List<String> options,
List<String> paths)
ssh [args] [user@]hostname rm [rmargs] file ... |
static int |
sshrm(List<String> args,
String user,
String hostname,
String file)
ssh [args] [user@]hostname rm -rf file |
static int |
sshrm(String hostname,
List<String> paths)
ssh hostname rm -rf file ... |
static int |
sshrm(String hostname,
String file)
ssh hostname rm -rf file |
static int |
sshrm(String user,
String hostname,
List<String> paths)
ssh [user@]hostname rm -rf file ... |
static int |
sshrm(String user,
String hostname,
String file)
ssh [user@]hostname rm -rf file |
static int |
sshsu(List<String> args,
String hostname,
String login,
String command)
ssh [args] hostname su - login command |
static int |
sshsu(List<String> args,
String user,
String hostname,
String login,
String command)
ssh [args] [user@]hostname su - login command |
static int |
sshsu(String hostname,
String login,
String command)
ssh hostname su - login command |
static int |
sshsu(String user,
String hostname,
String login,
String command)
ssh [user@]hostname su - login command |
static void |
validate(int exitValue,
String message)
|
static void |
validate(int exitValue,
String message,
Mode mode)
|
protected static String |
validateRsyncDestinationDir(File dir)
|
protected static String |
validateRsyncSourceDir(File dir)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int SUCCESS
Constructor Detail |
---|
public UnixUtils()
Method Detail |
---|
public static final int rsyncdirs(File source, File destination)
rsync source destinationWhere
source
and destination
are both directories on the local file system. source
must
already exist. destination
will be created if it does not exist.
public static final int rsyncdirs(File source, String destination)
rsync source [user@]hostname:destinationWhere
source
is a directory on the local file system. source
must already exist.
public static final int rsyncdirs(String source, File destination)
rsync [user@]hostname:source destinationWhere
destination
is a directory on the local file system. destination
will be created if it does not exist
public static final int rsyncdirs(List<String> options, File source, File destination)
rsync [options] source destinationWhere
source
and destination
are both directories on the local file system. source
must
already exist. destination
will be created if it does not exist.
public static final int rsync(List<String> options, File source, String destination)
rsync [options] source [user@]hostname:destinationWhere
source
is a directory on the local file system. source
must already exist.
public static final int rsyncdirs(List<String> options, String source, File destination)
rsync [options] [user@]hostname:source destinationWhere
destination
is a directory on the local file system. destination
will be created if it does not exist
public static final int rsyncdirs(List<String> options, String source, String destination)
rsync [options] source destination rsync [options] source [user@]hostname:destination rsync [options] [user@]hostname:source destinationAlways add a trailing slash to source when sync'ing directories.
cp
cp -R /tmp/foo/bar /tmp/xyz - creates files in /tmp/xyz rsync /tmp/foo/bar/ /tmp/xyz - creates files in /tmp/xyz rsync /tmp/foo/bar /tmp/xyz - creates files in /tmp/xyz/bar
public static final int rsyncdirs(String source, String destination)
rsync [options] source destination rsync [options] source [user@]hostname:destination rsync [options] [user@]hostname:source destination
public static final int rsync(String source, String destination)
rsync source destination rsync source [user@]hostname:destination rsync [user@]hostname:source destination
public static final int rsync(List<String> options, String source, String destination)
rsync [options] source destination rsync [options] source [user@]hostname:destination rsync [options] [user@]hostname:source destination
public static final int sshchown(List<String> args, String user, String hostname, List<String> options, String owner, String group, String file)
ssh [args] [user@]hostname chown [chownargs] owner:group file
public static final int sshchownr(String hostname, String owner, String group, String file)
ssh hostname chown -R owner:group file
public static final int sshchownr(String user, String hostname, String owner, String group, String file)
ssh [user@]hostname chown -R owner:group file
public static final int sshchownr(List<String> args, String hostname, String owner, String group, String file)
ssh [args] hostname chown -R owner:group file
public static final int sshchownr(List<String> args, String user, String hostname, String owner, String group, String file)
ssh [args] [user@]hostname chown -R owner:group file
public static final int sshchown(List<String> args, String hostname, String owner, String group, String file)
ssh [args] hostname chown owner:group file
public static final int sshchown(List<String> args, String user, String hostname, String owner, String group, String file)
ssh [args] [user@]hostname chown owner:group file
public static final int sshchown(String user, String hostname, String owner, String group, String file)
ssh [user@]hostname chown owner:group file
public static final int sshchown(String hostname, String owner, String group, String file)
ssh hostname chown owner:group file
public static final int sshrm(String hostname, String file)
ssh hostname rm -rf file
public static final int sshrm(String user, String hostname, String file)
ssh [user@]hostname rm -rf file
public static final int sshrm(List<String> args, String hostname, String file)
ssh [args] hostname rm -rf file
public static final int sshrm(List<String> args, String user, String hostname, String file)
ssh [args] [user@]hostname rm -rf file
public static final int sshrm(String hostname, List<String> paths)
ssh hostname rm -rf file ...
public static final int sshrm(String user, String hostname, List<String> paths)
ssh [user@]hostname rm -rf file ...
public static final int sshrm(List<String> args, String hostname, List<String> paths)
ssh [args] hostname rm -rf file ...
public static final int sshrm(List<String> args, String user, String hostname, List<String> paths)
ssh [args] [user@]hostname rm -rf file ...
public static final int sshrm(List<String> args, String user, String hostname, List<String> options, List<String> paths)
ssh [args] [user@]hostname rm [rmargs] file ...
public static final int sshchmod(List<String> args, String user, String hostname, String mode, String path)
ssh [args] [user@]hostname chmod mode file
public static final int sshchmod(String user, String hostname, String mode, String file)
ssh [user@]hostname chmod mode file
public static final int sshmkdir(String user, String hostname, String path)
ssh [user@]hostname mkdir -p directory
public static final int sshmkdir(List<String> args, String user, String hostname, String path)
ssh [args] [user@]hostname mkdir -p directory
public static final int sshmkdir(String hostname, String path)
ssh hostname mkdir -p directory
public static final int sshmkdir(List<String> args, String hostname, String path)
ssh [args] hostname mkdir -p directory
public static final int sshsu(String hostname, String login, String command)
ssh hostname su - login command
public static final int sshsu(List<String> args, String hostname, String login, String command)
ssh [args] hostname su - login command
public static final int sshsu(String user, String hostname, String login, String command)
ssh [user@]hostname su - login command
public static final int sshsu(List<String> args, String user, String hostname, String login, String command)
ssh [args] [user@]hostname su - login command
public static final int ssh(String hostname, String command)
ssh hostname command
public static final int ssh(String user, String hostname, String command)
ssh [user@]hostname command
public static final int ssh(List<String> args, String hostname, String command)
ssh [args] hostname command
public static final int ssh(List<String> args, String user, String hostname, String command)
ssh [args] [user@]hostname command
public static final int scp(String source, String destination)
scp source destinationWhere both
source
and destination
are in the format
[[user@]host:]file
public static final int scp(List<String> args, String source, String destination)
scp [args] source destinationWhere both
source
and destination
are in the format
[[user@]host:]file
public static final int scp(List<String> args, File source, String destination)
scp [args] source destinationWhere
source
is a file on the local file system and destination
is in the format
[[user@]host:]file
public static final int scp(List<String> args, String source, File destination)
scp [args] source destinationWhere
destination
is a file on the local file system and source
is in the format
[[user@]host:]file
public static final int scp(File source, String destination)
scp source destinationWhere
source
is a file on the local file system and destination
is in the format
[[user@]host:]file
public static final int scp(String source, File destination)
scp source destinationWhere
destination
is a file on the local file system and source
is in the format
[[user@]host:]file
public static final void validate(int exitValue, String message, Mode mode)
public static final void validate(int exitValue, String message)
public static final int execute(org.codehaus.plexus.util.cli.Commandline cl)
public static final String getLocation(String user, String hostname, String filename)
protected static final String validateRsyncSourceDir(File dir)
protected static final String validateRsyncDestinationDir(File dir)
protected static final List<String> getRsyncDirOptions(List<String> options)
--recursive
, --archive
, and --delete
as the first 3
elements, with additional options coming after.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |