de.unidu.is.util
Class SystemUtilities

java.lang.Object
  extended byde.unidu.is.util.SystemUtilities

public class SystemUtilities
extends java.lang.Object

A collection of system utility methods.

Since:
2003-06-20
Version:
$Revision: 1.19 $, $Date: 2005/02/21 17:29:29 $
Author:
Henrik Nottelmann

Constructor Summary
SystemUtilities()
           
 
Method Summary
static java.lang.String currentISODate()
          Returns the current date in ISO format "yyyymmdd".
static java.io.Reader getConfAsStream(java.lang.String relativePath)
          Returns a reader for the first file with the given name (prefixed with conf/).
static java.io.Reader[] getConfAsStreams(java.lang.String relativePath)
          Returns an array of readers for all files with the given name (prefixed with conf/).
static java.net.URL getConfURL(java.lang.String relativePath)
          Returns a URL for the first file with the given name (prefixed with conf/).
static java.net.URL[] getConfURLs(java.lang.String relativePath)
          Returns an array of URLs for all files with the given name (prefixed with conf/).
static java.io.Reader getResourceAsStream(java.lang.String relativePath)
          Returns a reader for the first file with the given name.
static java.io.Reader[] getResourceAsStreams(java.lang.String relativePath)
          Returns an array of readers for all files with the given name.
static java.net.URL getResourceURL(java.lang.String relativePath)
          Returns a URL for the first file with the given name.
static java.net.URL[] getResourceURLs(java.lang.String relativePath)
          Returns an array of URLs for all files with the given name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SystemUtilities

public SystemUtilities()
Method Detail

getConfAsStream

public static java.io.Reader getConfAsStream(java.lang.String relativePath)
Returns a reader for the first file with the given name (prefixed with conf/).

This method scans the classpath. For each JAR, the file must be located in the beginning (jar:file://...!/file). For each directory, the file must be located in that directoy or in its direct parent directory.

Parameters:
relativePath - relative path, without "conf" prefix
Returns:
corresponding reader

getConfURL

public static java.net.URL getConfURL(java.lang.String relativePath)
Returns a URL for the first file with the given name (prefixed with conf/).

This method scans the classpath. For each JAR, the file must be located in the beginning (jar:file://...!/file). For each directory, the file must be located in that directoy or in its

Parameters:
relativePath - relative path, without "conf" prefix
Returns:
corresponding URL

getConfURLs

public static java.net.URL[] getConfURLs(java.lang.String relativePath)
Returns an array of URLs for all files with the given name (prefixed with conf/).

This method scans the classpath. For each JAR, the file must be located in the beginning (jar:file://...!/file). For each directory, the file must be located in that directoy or in its direct parent directory.

Parameters:
relativePath - relative path, without "conf" prefix
Returns:
array of corresponding URLs

getConfAsStreams

public static java.io.Reader[] getConfAsStreams(java.lang.String relativePath)
Returns an array of readers for all files with the given name (prefixed with conf/).

This method scans the classpath. For each JAR, the file must be located in the beginning (jar:file://...!/file). For each directory, the file must be located in that directoy or in its direct parent directory.

Parameters:
relativePath - relative path, without "conf" prefix
Returns:
array of corresponding readers

getResourceAsStream

public static java.io.Reader getResourceAsStream(java.lang.String relativePath)
Returns a reader for the first file with the given name.

This method scans the classpath. For each JAR, the file must be located in the beginning (jar:file://...!/file). For each directory, the file must be located in that directoy or in its direct parent directory.

Parameters:
relativePath - relative path
Returns:
corresponding reader

getResourceURL

public static java.net.URL getResourceURL(java.lang.String relativePath)
Returns a URL for the first file with the given name.

This method scans the classpath. For each JAR, the file must be located in the beginning (jar:file://...!/file). For each directory, the file must be located in that directoy or in its direct parent directory.

Parameters:
relativePath - relative path
Returns:
corresponding URL

getResourceURLs

public static java.net.URL[] getResourceURLs(java.lang.String relativePath)
Returns an array of URLs for all files with the given name.

This method scans the classpath. For each JAR, the file must be located in the beginning (jar:file://...!/file). For each directory, the file must be located in that directoy or in its direct parent directory.

Parameters:
relativePath - relative path
Returns:
array of corresponding URLs

getResourceAsStreams

public static java.io.Reader[] getResourceAsStreams(java.lang.String relativePath)
Returns an array of readers for all files with the given name.

This method scans the classpath. For each JAR, the file must be located in the beginning (jar:file://...!/file). For each directory, the file must be located in that directoy or in its direct parent directory.

Parameters:
relativePath - relative path
Returns:
array of corresponding readers

currentISODate

public static java.lang.String currentISODate()
Returns the current date in ISO format "yyyymmdd".

Returns:
current date