Static Public Member Functions | Static Public Attributes | Static Package Functions
roboearth.wp5.util.Util Class Reference

List of all members.

Static Public Member Functions

static void createZipFromFiles (Set< String > filenames, String target)
static boolean deleteFolderRec (File path, boolean alsoDeleteGivenFolder)
static boolean extractZipFile (String filename, String targetFolder)
static String getClassFromUID (String uid)
static String getFilenameFromURL (String url)
static String getIDFromUID (String uid)
static String getLocalRosPackagePath (String rosPackageName)
static String getRemoteRosPackagePath (String hostname, String rosPackageName)
static String getSimpleFilename (String longFilename)
static String getURIforService (String service)
static void main (String[] args)
static double[] matrixToQuaternion (float[] m)
static boolean sshCopyFromRemote (String remotefile, String remoteHost, String localdir)
static boolean sshCopyToRemote (String localfile, String remoteHost, String remotedir)
static boolean writeFile (String targetPath, String filename, byte[] content)
static boolean writeRosFile (String targetPath, RosFile content)

Static Public Attributes

static final String modelDir
static final String re_commDir
static final String tmpDir

Static Package Functions

 [static initializer]

Detailed Description

Util is a utility class that provides methods to create/extract zip files, copy files to and from a remote computer and retrieving the IP/URI of the computer offering a given ROS service.

Author:
Moritz Tenorth, tenorth@cs.tum.edu
Alexander Perzylo, perzylo@cs.tum.edu

Definition at line 88 of file Util.java.


Member Function Documentation

roboearth.wp5.util.Util.[static initializer] ( ) [inline, static, package]
static void roboearth.wp5.util.Util.createZipFromFiles ( Set< String >  filenames,
String  target 
) [inline, static]

Creates a ZIP archive from a list of files.

Parameters:
filenamesList of files to be zipped
targetFile name of the resulting zip archive

Definition at line 355 of file Util.java.

static boolean roboearth.wp5.util.Util.deleteFolderRec ( File  path,
boolean  alsoDeleteGivenFolder 
) [inline, static]

This function will recursively delete directories and files.

Parameters:
pathDirectory to be deleted
alsoDeleteGivenFolderFlag, indicating whether the directory that was passed in as first argument shall be deleted along with its contents or not.
Returns:
true if deletion was successfully completed,
false otherwise. Parts of the given folder might already be deleted.

Definition at line 477 of file Util.java.

static boolean roboearth.wp5.util.Util.extractZipFile ( String  filename,
String  targetFolder 
) [inline, static]

Extracts files from a ZIP archive into a folder.

Parameters:
filenameFilename of the ZIP file to be extracted
targetFolderTarget directory into which the files are to be extracted

Definition at line 391 of file Util.java.

static String roboearth.wp5.util.Util.getClassFromUID ( String  uid) [inline, static]

Extracts the CLASS from an UID starting from index 0 to the index of the last occurrence of '.' (excluded).

Parameters:
uida unique identifier
Returns:
the class part of the uid

Definition at line 313 of file Util.java.

static String roboearth.wp5.util.Util.getFilenameFromURL ( String  url) [inline, static]

Retrieves the last part of the given URL that starts at the index of the last occurrence of '/' + 1. If no '/' was found, the input string gets returned.

Parameters:
urla URL
Returns:
the part of the URL after the last occurrence of '/'

Definition at line 457 of file Util.java.

static String roboearth.wp5.util.Util.getIDFromUID ( String  uid) [inline, static]

Extracts the ID from an UID (starting from the index of the last occurrence of '.' + 1)

Parameters:
uida unique identifier
Returns:
the last part of the uid (also called the id)

Definition at line 337 of file Util.java.

static String roboearth.wp5.util.Util.getLocalRosPackagePath ( String  rosPackageName) [inline, static]

Searches for the absolute path of the given ROS package on the local host.

Parameters:
rosPackageNamename of ROS package to search for
Returns:
Absolute path of the given ROS package or null if the package wasn't found

Definition at line 276 of file Util.java.

static String roboearth.wp5.util.Util.getRemoteRosPackagePath ( String  hostname,
String  rosPackageName 
) [inline, static]

Searches for the absolute path of the given ROS package on a given host.

Parameters:
hostnamehost name, which is to be searched
rosPackageNamename of ROS package to search for
Returns:
Absolute path of the given ROS package on the remote host, or null if the host or package wasn't found

Definition at line 240 of file Util.java.

static String roboearth.wp5.util.Util.getSimpleFilename ( String  longFilename) [inline, static]

Retrieves the simple file name from a long file name containing the path by searching for the last index of the system dependent file separator and returning a substring starting from that index + 1. If no file separator was found, the input string gets returned.

Parameters:
longFilenamelong file name
Returns:
simple file name (without path)

Definition at line 440 of file Util.java.

static String roboearth.wp5.util.Util.getURIforService ( String  service) [inline, static]

Reads the IP address/URI of the computer offering a service.

Returns:
URI of the computer

Definition at line 109 of file Util.java.

static void roboearth.wp5.util.Util.main ( String[]  args) [inline, static]

Main method for testing purposes.

Parameters:
argsarguments get ignored

Definition at line 580 of file Util.java.

static double [] roboearth.wp5.util.Util.matrixToQuaternion ( float[]  m) [inline, static]

Definition at line 503 of file Util.java.

static boolean roboearth.wp5.util.Util.sshCopyFromRemote ( String  remotefile,
String  remoteHost,
String  localdir 
) [inline, static]

Copies a remote file via scp into a local directory.

Parameters:
remotefileAbsolute path and filename on the remote computer
remoteHostRemote host to copy from
localdirLocal directory to copy into

Definition at line 143 of file Util.java.

static boolean roboearth.wp5.util.Util.sshCopyToRemote ( String  localfile,
String  remoteHost,
String  remotedir 
) [inline, static]

Copies a local file via scp into a remote directory on the computer hostname.

Parameters:
localfileAbsolute path and filename on the local host
remoteHostremote host
remoteDirdirectory on remote host to copy into

Definition at line 191 of file Util.java.

static boolean roboearth.wp5.util.Util.writeFile ( String  targetPath,
String  filename,
byte[]  content 
) [inline, static]

Definition at line 539 of file Util.java.

static boolean roboearth.wp5.util.Util.writeRosFile ( String  targetPath,
RosFile  content 
) [inline, static]

Writes a file contained in a re_msgs/RosFile message to the given local path.

Parameters:
targetPathpath to store file in
contentthe RosFile message

Definition at line 527 of file Util.java.


Member Data Documentation

final String roboearth.wp5.util.Util.modelDir [static]

Definition at line 90 of file Util.java.

final String roboearth.wp5.util.Util.re_commDir [static]

Definition at line 92 of file Util.java.

final String roboearth.wp5.util.Util.tmpDir [static]

Definition at line 91 of file Util.java.


The documentation for this class was generated from the following file:


re_comm
Author(s): Alexander Perzylo
autogenerated on Sun Jan 5 2014 11:29:48