Firefish 0.5.10

gov.lbl.dsd.p2pio.util
Class Util

java.lang.Object
  extended bygov.lbl.dsd.p2pio.util.Util

public class Util
extends Object

Miscellaneous static utility functions.

Version:
$Revision: 1.6 $, $Date: 2004/01/30 01:18:02 $

Method Summary
static String file2String(File file)
           
static String file2String(InputStream in)
           
static String file2String(String fileName)
           
static String file2StringFromClasspath(String fileName)
           
static String getClassName(Class clazz)
          Returns the unqualified class name of the given class (omitting package name).
static String getClassName(Object obj)
          Returns the unqualified class name of the given object (omitting package name).
static String getLowerClassName(Class clazz)
          Returns the unqualified class name of the given object (omitting package name), with first character in lower case.
static String getLowerClassName(Object obj)
          Returns the unqualified class name of the given object (omitting package name), with first character in lower case.
static InputStream getResourceAsStream(String fileName)
           
static boolean isWindows()
           
static void sleep(int msecs)
          Puts the current thread asleep for the given number of milliseconds.
static void string2File(String input, OutputStream out)
           
static void string2File(String input, String fileName)
           
static String toString(Map map)
           
static String toString(Throwable throwable)
          Returns the stack trace of a Throwable as a String.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

file2String

public static String file2String(InputStream in)
                          throws IOException
Throws:
IOException

file2String

public static String file2String(File file)
                          throws IOException
Throws:
IOException

file2String

public static String file2String(String fileName)
                          throws IOException
Throws:
IOException

file2StringFromClasspath

public static String file2StringFromClasspath(String fileName)
                                       throws IOException
Throws:
IOException

string2File

public static void string2File(String input,
                               String fileName)
                        throws IOException
Throws:
IOException

string2File

public static void string2File(String input,
                               OutputStream out)
                        throws IOException
Throws:
IOException

getResourceAsStream

public static InputStream getResourceAsStream(String fileName)

toString

public static String toString(Throwable throwable)
Returns the stack trace of a Throwable as a String.


toString

public static String toString(Map map)

getClassName

public static String getClassName(Object obj)
Returns the unqualified class name of the given object (omitting package name).


getClassName

public static String getClassName(Class clazz)
Returns the unqualified class name of the given class (omitting package name).


getLowerClassName

public static String getLowerClassName(Class clazz)
Returns the unqualified class name of the given object (omitting package name), with first character in lower case.


getLowerClassName

public static String getLowerClassName(Object obj)
Returns the unqualified class name of the given object (omitting package name), with first character in lower case.


isWindows

public static boolean isWindows()

sleep

public static void sleep(int msecs)
Puts the current thread asleep for the given number of milliseconds.


Firefish 0.5.10

Jump to the Firefish Homepage