|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object databionics.util.Utils
public class Utils
Some static utility functions
Field Summary | |
---|---|
protected static org.apache.log4j.Logger |
log
logging |
Constructor Summary | |
---|---|
Utils()
|
Method Summary | |
---|---|
static void |
copyFile(java.io.File in,
java.io.File out)
Copy a file and display progress. |
static java.io.Reader |
createReaderByFilename(java.io.File file)
Create a possibly compressed reader based on the filename if the filename ends with ".zip" a ZipInputStream ist used if the filename ends with ".gz" a GZIPInputStream ist used if the filename ends with ".bz2" a CBZip2InputStream ist used otherwise a plain FileInputStream is used |
static java.io.Reader |
createReaderByFilename(java.lang.String file)
Create a possibly compressed reader based on the filename if the filename ends with ".zip" a ZipInputStream ist used if the filename ends with ".gz" a GZIPInputStream ist used if the filename ends with ".bz2" a CBZip2InputStream ist used otherwise a plain FileInputStream is used |
static java.io.Writer |
createWriterByFilename(java.io.File file)
Create a possibly compressed writer based on the filename if the filename ends with ".zip" a ZipOutputStream ist used if the filename ends with ".gz" a GZIPOutputStream ist used if the filename ends with ".bz2" a CBZip2OutputStream ist used otherwise a plain FileOutputStream is used |
static java.io.Writer |
createWriterByFilename(java.lang.String file)
Create a possibly compressed writer based on the filename if the filename ends with ".zip" a ZipOutputStream ist used if the filename ends with ".gz" a GZIPOutputStream ist used if the filename ends with ".bz2" a CBZip2OutputStream ist used otherwise a plain FileOutputStream is used |
static java.util.List |
findClassesInJar(java.lang.String dir,
java.lang.String jar,
java.lang.String pkg,
java.lang.String sclass,
java.lang.String iface)
Find all classes in *.jar files, optionally restrict to a package, direct subclasses of a given class or classes implementing a given interface. |
static java.lang.String |
getEnvironmentVariable(java.lang.String name)
Get value of an environment variable. |
static void |
loadProperties(java.io.File file)
Load properties from a file into System properties |
static java.util.Locale |
stringToLocale(java.lang.String loc)
Convert string to locale |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static org.apache.log4j.Logger log
Constructor Detail |
---|
public Utils()
Method Detail |
---|
public static java.util.Locale stringToLocale(java.lang.String loc)
loc
- Local as string
public static java.lang.String getEnvironmentVariable(java.lang.String name)
name
- Name of variable
public static void loadProperties(java.io.File file) throws java.io.IOException, java.io.FileNotFoundException
file
- Property file
java.io.IOException
java.io.FileNotFoundException
public static void copyFile(java.io.File in, java.io.File out) throws java.io.FileNotFoundException, java.io.IOException
java.io.FileNotFoundException
java.io.IOException
public static java.io.Reader createReaderByFilename(java.lang.String file) throws java.io.FileNotFoundException, java.io.IOException
java.io.FileNotFoundException
java.io.IOException
public static java.io.Reader createReaderByFilename(java.io.File file) throws java.io.FileNotFoundException, java.io.IOException
java.io.FileNotFoundException
java.io.IOException
public static java.io.Writer createWriterByFilename(java.lang.String file) throws java.io.FileNotFoundException, java.io.IOException
java.io.FileNotFoundException
java.io.IOException
public static java.io.Writer createWriterByFilename(java.io.File file) throws java.io.FileNotFoundException, java.io.IOException
java.io.FileNotFoundException
java.io.IOException
public static java.util.List findClassesInJar(java.lang.String dir, java.lang.String jar, java.lang.String pkg, java.lang.String sclass, java.lang.String iface)
dir
- Directory with *.jar file(s)jar
- Beginning of *.jar file name(s) to search, can be null to
search all filespkg
- Restrict search to this package (with / not .)sclass
- Restrict search to direct subclasses of this superclass, can
be nulliface
- Restrict search to classes implementinf this interface, can be
null
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |