public final class WaarpStringUtils extends Object
Modifier and Type | Field and Description |
---|---|
static String |
UTF_8 |
static Charset |
UTF8
Format used for Files
|
Modifier and Type | Method and Description |
---|---|
static String |
cleanJsonForHtml(String json)
Clean the String that could contain '\' or '\n', '\r' into something
compatible with HTML
|
static String |
fillString(char fillChar,
int count)
Build a String with count chars using fillChar
|
static Timestamp |
fixDate(String date)
Get a date in String and return the corresponding Timestamp
|
static Timestamp |
fixDate(String date,
Timestamp before)
From a date in String format and a Timestamp, return the Timestamp as
:
if before = null as date if before ! |
static boolean |
getBoolean(org.dom4j.Node node)
Read a boolean value (0,1,true,false) from a node
|
static int |
getInteger(org.dom4j.Node node)
Read an integer value from a node
|
static Timestamp |
getTodayMidnight() |
static String |
readFile(String filename)
Read file and return "" if an error occurs
|
static String |
readFileException(String filename)
Read a file and return its content in String format
|
static boolean |
replace(StringBuilder builder,
String find,
String replace)
Make a replacement of first "find" string by "replace" string into the
StringBuilder
|
static void |
replaceAll(StringBuilder builder,
String find,
String replace)
Make replacement of all "find" string by "replace" string into the
StringBuilder
|
public static final String UTF_8
public static final Charset UTF8
public static String readFileException(String filename) throws InvalidArgumentException, FileTransferException
filename
- InvalidArgumentException
- for File not foundFileTransferException
- for reading exceptionpublic static String readFile(String filename)
filename
- public static Timestamp fixDate(String date)
date
- public static Timestamp fixDate(String date, Timestamp before)
date
- before
- public static Timestamp getTodayMidnight()
public static boolean getBoolean(org.dom4j.Node node)
node
- public static int getInteger(org.dom4j.Node node) throws InvalidArgumentException
node
- InvalidArgumentException
public static boolean replace(StringBuilder builder, String find, String replace)
builder
- find
- replace
- public static void replaceAll(StringBuilder builder, String find, String replace)
builder
- find
- replace
- public static String fillString(char fillChar, int count)
fillChar
- count
- Copyright © 2009–2020 Waarp. All rights reserved.