|
||||||||||
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 File |
createFile(String filename)
Attempts to create a new file in an atomic way. |
static String |
decode(String s)
The function decodes URL-encoded strings into a regular string. |
static boolean |
destroy(File file)
Overwrites the contents of the file with a random string and then deletes the file. |
static boolean |
destroy(String file)
Overwrites the contents of the file with a random string and then deletes the file. |
static String |
formatTimeSec(long time)
Generates string representation of given time specified as long. |
static String |
getInput(String prompt)
Displays a prompt and then reads in the input from System.in. |
static String |
getLocalHostAddress()
Returns the ip address of the local machine. |
static String |
getPrivateInput(String prompt)
Displays a prompt and then reads in private input from System.in. |
static String |
quote(String str)
Quotifies a specified string. |
static boolean |
setFilePermissions(String file,
int mode)
Sets permissions on a given file. |
static boolean |
setOwnerAccessOnly(String file)
Sets permissions on a given file to be only accessible by the current user. |
static String |
unquote(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 File createFile(String filename) throws SecurityException, IOException
filename
- the name of file to create.
SecurityException
- if the existing file cannot be deleted.
IOException
- if an I/O error occurred.public static boolean setOwnerAccessOnly(String file)
setFilePermissions(String, int)
public static boolean setFilePermissions(String file, int mode)
file
- the file to set the permissions of.mode
- the Unix style permissions.
public static boolean destroy(String file)
file
- file to removepublic static boolean destroy(File file)
file
- file to removepublic static String getInput(String prompt)
prompt
- the prompt to be displayed
String
the input read in (entered after the prompt)public static String getPrivateInput(String prompt)
prompt
- the prompt to be displayed
String
the input read in (entered after the prompt)public static String quote(String str)
str
- the string to quotify
public static String unquote(String str) throws Exception
str
- the string to dequotify.
Exception
public static String decode(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 String formatTimeSec(long time)
public static 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 |