|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.globus.util.Util
public class Util
Constructor Summary | |
---|---|
Util()
|
Method Summary | |
---|---|
static java.io.File |
createFile(java.lang.String filename)
Attempts to create a new file in an atomic way. |
static java.lang.String |
decode(java.lang.String s)
The function decodes URL-encoded strings into a regular string. |
static boolean |
destroy(java.io.File file)
Overwrites the contents of the file with a random string and then deletes the file. |
static boolean |
destroy(java.lang.String file)
Overwrites the contents of the file with a random string and then deletes the file. |
static java.lang.String |
formatTimeSec(long time)
Generates string representation of given time specified as long. |
static java.lang.String |
getInput(java.lang.String prompt)
Displays a prompt and then reads in the input from System.in. |
static java.lang.String |
getLocalHostAddress()
Returns the ip address of the local machine. |
static java.lang.String |
getPrivateInput(java.lang.String prompt)
Displays a prompt and then reads in private input from System.in. |
static java.lang.String |
quote(java.lang.String str)
Quotifies a specified string. |
static boolean |
setFilePermissions(java.lang.String file,
int mode)
Sets permissions on a given file. |
static boolean |
setOwnerAccessOnly(java.lang.String file)
Sets permissions on a given file to be only accessible by the current user. |
static java.lang.String |
unquote(java.lang.String str)
Dequotifies a specified string. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Util()
Method Detail |
---|
public static java.io.File createFile(java.lang.String filename) throws java.lang.SecurityException, java.io.IOException
filename
- the name of file to create.
java.lang.SecurityException
- if the existing file cannot be deleted.
java.io.IOException
- if an I/O error occurred.public static boolean setOwnerAccessOnly(java.lang.String file)
setFilePermissions(String, int)
public static boolean setFilePermissions(java.lang.String file, int mode)
file
- the file to set the permissions of.mode
- the Unix style permissions.
public static boolean destroy(java.lang.String file)
file
- file to removepublic static boolean destroy(java.io.File file)
file
- file to removepublic static java.lang.String getInput(java.lang.String prompt)
prompt
- the prompt to be displayed
String
the input read in (entered after the prompt)public static java.lang.String getPrivateInput(java.lang.String prompt)
prompt
- the prompt to be displayed
String
the input read in (entered after the prompt)public static java.lang.String quote(java.lang.String str)
str
- the string to quotify
public static java.lang.String unquote(java.lang.String str) throws java.lang.Exception
str
- the string to dequotify.
java.lang.Exception
public static java.lang.String decode(java.lang.String s)
String
, each character is examined in turn:
%xy
", where xy is the two-digit
hexadecimal representation of the lower 8-bits of the character.
public static java.lang.String formatTimeSec(long time)
public static java.lang.String getLocalHostAddress()
InetAddress
class. In case the lookup
fails, the address 127.0.0.1 is returned.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |