Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.vrspace.util
Class Util  view Util download Util.java

java.lang.Object
  extended byorg.vrspace.util.Util

public class Util
extends java.lang.Object

Miscelanous usefull methods


Field Summary
private static java.util.Stack stack
           
 
Constructor Summary
Util()
           
 
Method Summary
static java.lang.String checkPath(java.lang.String path)
          Changes ":" to "\" in path;
static java.io.FileOutputStream createFileOutputStream(java.lang.String destPath)
          Creates FileOutputStream in destPath, with directiories as needed
static java.lang.String getClassName(java.lang.Class cls)
           
static java.lang.String getClassName(java.lang.Object obj)
           
static java.lang.String getDir(java.lang.String path)
          Returns directory part of a file name
static java.net.URL getLocation(java.lang.Object obj)
          Returns the location of the class file
static java.lang.String getPackageName(java.lang.Class cls)
          Returns package name for a class
static java.lang.String getPackageName(java.lang.Object obj)
           
static java.util.Properties loadProperties(java.util.Properties props, java.lang.String file)
          Loads properties from file into props
static java.lang.Object pop()
          pop from static Stack
static void push(java.lang.Object obj)
          push obj to static Stack
static void setDefaultProperty(java.util.Properties props, java.lang.String name, java.lang.String defaultValue)
          Sets the property name to defaultValue if not null, or to the system property if exists, only if it does not already exist in props
static void sleep(long millis)
          I hate catching InterruptedException!
static void storeProperties(java.util.Properties props, java.lang.String file)
          Stores the properties from props to file
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

stack

private static java.util.Stack stack
Constructor Detail

Util

public Util()
Method Detail

push

public static void push(java.lang.Object obj)
push obj to static Stack


pop

public static java.lang.Object pop()
pop from static Stack


getLocation

public static java.net.URL getLocation(java.lang.Object obj)
Returns the location of the class file


getDir

public static java.lang.String getDir(java.lang.String path)
Returns directory part of a file name


loadProperties

public static java.util.Properties loadProperties(java.util.Properties props,
                                                  java.lang.String file)
                                           throws java.io.FileNotFoundException,
                                                  java.io.IOException
Loads properties from file into props


storeProperties

public static void storeProperties(java.util.Properties props,
                                   java.lang.String file)
                            throws java.io.FileNotFoundException,
                                   java.io.IOException
Stores the properties from props to file


setDefaultProperty

public static void setDefaultProperty(java.util.Properties props,
                                      java.lang.String name,
                                      java.lang.String defaultValue)
Sets the property name to defaultValue if not null, or to the system property if exists, only if it does not already exist in props


createFileOutputStream

public static java.io.FileOutputStream createFileOutputStream(java.lang.String destPath)
                                                       throws java.io.IOException
Creates FileOutputStream in destPath, with directiories as needed


sleep

public static void sleep(long millis)
I hate catching InterruptedException!


checkPath

public static java.lang.String checkPath(java.lang.String path)
Changes ":" to "\" in path;


getPackageName

public static java.lang.String getPackageName(java.lang.Class cls)
Returns package name for a class


getPackageName

public static java.lang.String getPackageName(java.lang.Object obj)

getClassName

public static java.lang.String getClassName(java.lang.Class cls)

getClassName

public static java.lang.String getClassName(java.lang.Object obj)