|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.ourgrid.common.util.StringUtil
public class StringUtil
This is a auxiliar class that incloses many util functionalities related to strings.
Constructor Summary | |
---|---|
StringUtil()
|
Method Summary | |
---|---|
static java.lang.String |
fillWithChars(java.lang.String value,
char character,
int numChars)
This method fills value with the characters at right. |
static java.lang.String[] |
getArrayOfStrings(java.lang.String string,
java.lang.String delimitator)
Gets a array of strings after broken with the given delimitator |
static java.lang.String |
getStringSeparatedByCommas(java.lang.String[] strings)
Gets a array of string and return a string that contains the strings separated by commas |
static java.lang.String |
insertSpace(java.lang.String expr,
int i)
Inserts a white space at a specific point. |
static java.lang.String |
insertSpaces(java.lang.String expr)
Insert spaces in the sentence expr. |
static int |
parsePermissionString(java.lang.String permStr)
This method parse a permissions file from stringo to int |
static java.lang.String[] |
passToArrayStr(java.lang.String strToArray)
Receives a simple String and returns a array containing all words of the String supressed the "," - it is the delimiter |
static java.lang.String |
passToString(java.lang.String[] orig)
Receives an array of String and returns a simple string of all separeted by a "," |
static java.lang.String |
replace(java.lang.String str,
java.lang.String subOld,
java.lang.String subNew)
Replaces at the a String a patter to another. |
static java.lang.String |
replaceVariables(java.lang.String stringWithVariables,
java.util.Map<java.lang.String,java.lang.String> envVars)
This method does a job that is expected to be done by the shell: it converts variables to String literals. |
static void |
writeStringOnFile(java.lang.String file,
java.lang.String s)
Writes the given string into the given file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StringUtil()
Method Detail |
---|
public static void writeStringOnFile(java.lang.String file, java.lang.String s) throws java.io.IOException
file
- The file where the string have to be written (appended).s
- the string to be written into the file
java.io.IOException
- If the file could not be used (created) or any other
I/O problem at the open, writte or close moment.public static java.lang.String replace(java.lang.String str, java.lang.String subOld, java.lang.String subNew)
str
- The String where will be made the changes.subOld
- The pattern that will be removed.subNew
- The pattern that will be inserted.
public static java.lang.String passToString(java.lang.String[] orig)
public static java.lang.String[] passToArrayStr(java.lang.String strToArray)
strToArray
- string that must be transformed to an array.
public static java.lang.String insertSpace(java.lang.String expr, int i)
expr
- the string where the space have to be inserted.i
- the specific point where the space have to be inserted
public static java.lang.String fillWithChars(java.lang.String value, char character, int numChars)
value
- - The string to be filled with white space caracterscharacter
- - The character to be used in the filling of the stringnumChars
- - The number of characters to insert in the string.public static java.lang.String insertSpaces(java.lang.String expr)
expr
- The sentence that spaces will be inserted
public static java.lang.String replaceVariables(java.lang.String stringWithVariables, java.util.Map<java.lang.String,java.lang.String> envVars)
stringWithVariables
- A string with 0 or more variables.
public static int parsePermissionString(java.lang.String permStr)
permStr
- The file permission as drwxrwxrwx
public static java.lang.String getStringSeparatedByCommas(java.lang.String[] strings)
strings
- The array of strings
public static java.lang.String[] getArrayOfStrings(java.lang.String string, java.lang.String delimitator)
string
- A string that will broken in an array of stringsdelimitator
- The delimitator between strings
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |