railo.loader.util
Class Util

java.lang.Object
  extended by railo.loader.util.Util

public class Util
extends Object

Util class for different little jobs


Constructor Summary
Util()
           
 
Method Summary
static void closeEL(InputStream is)
          close inputstream without a Exception
static void closeEL(InputStream is, OutputStream os)
          close inputstream without a Exception
static void closeEL(OutputStream os)
          close outputstream without a Exception
static void closeEL(Reader r)
          close reader without a Exception
static void closeEL(Writer w)
          close reader without a Exception
static void copy(InputStream in, OutputStream out)
          copy a inputstream to a outputstream
static void copy(Resource in, Resource out)
           
static String first(String str, String delimeter)
           
static File getCanonicalFileEL(File file)
          Returns the canonical form of this abstract pathname.
static String getContentAsString(InputStream is, String charset)
           
static File getHomeDirectory()
          returns the Hoome Directory of the System
static File getSystemDirectory()
           
static File getTempDirectory()
          returns the Temp Directory of the System
static boolean hasUpperCase(String str)
           
static boolean isEmpty(String str)
          check if string is empty (null or "")
static boolean isEmpty(String str, boolean trim)
          check if string is empty (null or "")
static String last(String str, String delimeter)
           
static int length(String str)
           
static String parsePlaceHolder(String path)
          replace path placeholder with the real path, placeholders are [{temp-directory},{system-directory},{home-directory}]
static String replace(String str, String sub1, String sub2, boolean onlyFirst)
           
static boolean toBooleanValue(String str)
           
static BufferedInputStream toBufferedInputStream(InputStream is)
           
static BufferedOutputStream toBufferedOutputStream(OutputStream os)
           
static String toHTTPTimeString()
           
static String toHTTPTimeString(Date date)
           
static int toInVersion(String version)
          cast a railo string version to a int version
static String toString(InputStream is)
          read String data from a InputStream and returns it as String Object
static String toStringVersion(int version)
           
static String toVariableName(String str, boolean addIdentityNumber)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Util

public Util()
Method Detail

copy

public static final void copy(InputStream in,
                              OutputStream out)
                       throws IOException
copy a inputstream to a outputstream

Parameters:
in -
out -
Throws:
IOException

toString

public static String toString(InputStream is)
                       throws IOException
read String data from a InputStream and returns it as String Object

Parameters:
is - InputStream to read data from.
Returns:
readed data from InputStream
Throws:
IOException

toBooleanValue

public static boolean toBooleanValue(String str)
                              throws IOException
Throws:
IOException

closeEL

public static void closeEL(InputStream is,
                           OutputStream os)
close inputstream without a Exception

Parameters:
is -
os -

closeEL

public static void closeEL(InputStream is)
close inputstream without a Exception

Parameters:
is -

closeEL

public static void closeEL(Reader r)
close reader without a Exception

Parameters:
is -

closeEL

public static void closeEL(Writer w)
close reader without a Exception

Parameters:
is -

closeEL

public static void closeEL(OutputStream os)
close outputstream without a Exception

Parameters:
os -

getContentAsString

public static String getContentAsString(InputStream is,
                                        String charset)
                                 throws IOException
Parameters:
is - inputStream to get content From
charset -
Returns:
returns content from a file inputed by input stream
Throws:
IOException

isEmpty

public static boolean isEmpty(String str)
check if string is empty (null or "")

Parameters:
str -
Returns:
is empty or not

isEmpty

public static boolean isEmpty(String str,
                              boolean trim)
check if string is empty (null or "")

Parameters:
str -
Returns:
is empty or not

length

public static int length(String str)

toInVersion

public static int toInVersion(String version)
cast a railo string version to a int version

Parameters:
version -
Returns:
int version

toStringVersion

public static String toStringVersion(int version)

replace

public static String replace(String str,
                             String sub1,
                             String sub2,
                             boolean onlyFirst)
Parameters:
str - String to work with
sub1 - value to replace
sub2 - replacement
onlyFirst - replace only first or all
Returns:
new String

parsePlaceHolder

public static String parsePlaceHolder(String path)
replace path placeholder with the real path, placeholders are [{temp-directory},{system-directory},{home-directory}]

Parameters:
path -
Returns:
updated path

getTempDirectory

public static File getTempDirectory()
returns the Temp Directory of the System

Returns:
temp directory

getHomeDirectory

public static File getHomeDirectory()
returns the Hoome Directory of the System

Returns:
home directory

getSystemDirectory

public static File getSystemDirectory()
Returns:
return System directory

getCanonicalFileEL

public static File getCanonicalFileEL(File file)
Returns the canonical form of this abstract pathname.

Parameters:
file - file to get canoncial form from it
Returns:
The canonical pathname string denoting the same file or directory as this abstract pathname
Throws:
SecurityException - If a required system property value cannot be accessed.

toHTTPTimeString

public static String toHTTPTimeString(Date date)

toHTTPTimeString

public static String toHTTPTimeString()

hasUpperCase

public static boolean hasUpperCase(String str)

toBufferedInputStream

public static BufferedInputStream toBufferedInputStream(InputStream is)

toBufferedOutputStream

public static BufferedOutputStream toBufferedOutputStream(OutputStream os)

copy

public static void copy(Resource in,
                        Resource out)
                 throws IOException
Throws:
IOException

toVariableName

public static String toVariableName(String str,
                                    boolean addIdentityNumber)

first

public static String first(String str,
                           String delimeter)

last

public static String last(String str,
                          String delimeter)


Copyright © 2012 Railo