org.n52.oxf.util
Class JavaHelper

java.lang.Object
  extended by org.n52.oxf.util.JavaHelper

public class JavaHelper
extends Object

Author:
Arne Broering

Constructor Summary
JavaHelper()
           
 
Method Summary
static byte[] addArrayElements(byte[] toArray, byte[] fromArray)
          adds the elements of the fromArray to the toArray.
static String[] addArrayElements(String[] toArray, String[] fromArray)
          adds the elements of the fromArray to the toArray.
static void cleanUpDir(String dirToClean, int olderThanTimeMillis)
          deletes all files in the specified directory which are older than olderThanTimeMillis.
static void cleanUpDir(String dirToClean, int olderThanTimeMillis, String postFix)
          deletes all files in the specified directory which are older than olderThanTimeMillis and have the defined postFix.
static File genFile(String parentPath, String midPart, String postfix)
          genreates a file name with the specified parent path, midPart and postFix.
static File genRndFile(String parentPath, String midPart, String postfix)
          genreates a random file name with the specified parent path, midPart and postFix.
static void main(String[] args)
           
static String normalize(String toNormalize)
           
static String[] toStringArray(Object[] oArray)
          transforms the oArray to a String[]
static Color transformToColor(String hexString)
          transforms a hexadecimal to a Color object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaHelper

public JavaHelper()
Method Detail

toStringArray

public static String[] toStringArray(Object[] oArray)
transforms the oArray to a String[]


addArrayElements

public static byte[] addArrayElements(byte[] toArray,
                                      byte[] fromArray)
adds the elements of the fromArray to the toArray.


addArrayElements

public static String[] addArrayElements(String[] toArray,
                                        String[] fromArray)
adds the elements of the fromArray to the toArray.


transformToColor

public static Color transformToColor(String hexString)
transforms a hexadecimal to a Color object.

e.g.: '#FF6600' --> orange

Parameters:
hexString - 7 character hex-string; something like "#FF6600"
Returns:

genRndFile

public static File genRndFile(String parentPath,
                              String midPart,
                              String postfix)
genreates a random file name with the specified parent path, midPart and postFix.


genFile

public static File genFile(String parentPath,
                           String midPart,
                           String postfix)
genreates a file name with the specified parent path, midPart and postFix.


normalize

public static String normalize(String toNormalize)
Returns:
a normalized String for use in a file path, i.e. all [\,/,:,*,?,",<,>] characters are replaced by '_'.

cleanUpDir

public static void cleanUpDir(String dirToClean,
                              int olderThanTimeMillis)
deletes all files in the specified directory which are older than olderThanTimeMillis.

Parameters:
dirToClean -
olderThanTimeMillis -

cleanUpDir

public static void cleanUpDir(String dirToClean,
                              int olderThanTimeMillis,
                              String postFix)
deletes all files in the specified directory which are older than olderThanTimeMillis and have the defined postFix.

Parameters:
dirToClean -
olderThanTimeMillis -
postFix -

main

public static void main(String[] args)


Copyright © 2012-2013 52north.org. All Rights Reserved.