com.izforge.izpack.util
Class StringTool

java.lang.Object
  extended bycom.izforge.izpack.util.StringTool

public class StringTool
extends java.lang.Object

A extended Java Implementation of Pythons string.replace()

Author:
marc.eppelmann@gmx.de

Constructor Summary
StringTool()
          Default Constructor
 
Method Summary
static void main(java.lang.String[] args)
          Test method
static java.lang.String normalizePath(java.lang.String destination)
          Normalizes a mixed Windows/Unix Path.
static java.lang.String normalizePath(java.lang.String destination, java.lang.String fileSeparator)
          Normalizes a Windows or Unix Path.
static java.lang.String replace(java.lang.String value, java.lang.String from, java.lang.String to)
          Replaces from with to in given String: value
static java.lang.String replace(java.lang.String value, java.lang.String from, java.lang.String to, boolean aCaseSensitiveFlag)
          Replaces from with to in given String: value
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringTool

public StringTool()
Default Constructor

Method Detail

main

public static void main(java.lang.String[] args)
Test method

Parameters:
args - Commandline Args

replace

public static java.lang.String replace(java.lang.String value,
                                       java.lang.String from,
                                       java.lang.String to)
Replaces from with to in given String: value

Parameters:
value - original String
from - Search Pattern
to - Replace with this
Returns:
the replaced String

replace

public static java.lang.String replace(java.lang.String value,
                                       java.lang.String from,
                                       java.lang.String to,
                                       boolean aCaseSensitiveFlag)
Replaces from with to in given String: value

Parameters:
value - original String
from - Search Pattern
to - Replace with this
Returns:
the replaced String

normalizePath

public static java.lang.String normalizePath(java.lang.String destination,
                                             java.lang.String fileSeparator)
Normalizes a Windows or Unix Path. Reason: Javas File accepts / or \ for Pathes. Batches or ShellScripts does it not! TODO: implement support for MAC < MacOSX

Parameters:
destination -
Returns:

normalizePath

public static java.lang.String normalizePath(java.lang.String destination)
Normalizes a mixed Windows/Unix Path. Does Only work for Windows or Unix Pathes Reason: Java.File accepts / or \ for Pathes. Batches or ShellScripts does it not!

Returns:
the normalized Path