|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectkernel.Tools
public class Tools
This class provides some useful static methods that can be used by plugins.
| Method Summary | |
|---|---|
static String |
accentsToHtml(String input)
Converts accentuated letters to their html form. |
static String |
accentsToIso(String input)
Converts accentuated letters to their iso form. |
static void |
getFilesRec(ArrayList<File> allFiles,
File root,
boolean includesDir)
Gets recursively all the files from a given root directory. |
static PropertyResourceBundle |
getPrb(String baseName,
String language)
Gets the PropertyResourceBundle that corresponds to the
specified language or the default one if the requested language is not
available. |
static String |
htmlToAccents(String input)
Converts html-formed letters to accentuated letters. |
static String |
isoToAccents(String input)
Converts iso-formed letters to accentuated letters. |
static String |
noAccents(String input)
Replaces all accentuated letters (even given in their html or iso form) by their non-accentuated corresponding letters. |
static String |
readFile(String filename)
Reads a file and returns its content in a String. |
static String |
removeAccents(String input)
Removes the accents on accentuated letters. |
static ArrayList<String> |
sort(ArrayList<String> list,
boolean reverseOrder,
boolean caseInsensitive)
Sorts an ArrayList of Strings. |
static String |
sort(String text,
boolean reverseOrder,
boolean caseInsensitive)
Sorts de lines of a text. |
static void |
writeFile(String filename,
String text)
Writes a text in a file. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static PropertyResourceBundle getPrb(String baseName,
String language)
PropertyResourceBundle that corresponds to the
specified language or the default one if the requested language is not
available.
baseName - base name of the resource bundlelanguage - the ISO 639-1 code of the language
PropertyResourceBundle or
null if none is available
public static void getFilesRec(ArrayList<File> allFiles,
File root,
boolean includesDir)
allFiles - the list that will be filled with the filesroot - the root directoryincludesDir - if true, includes also the directoriespublic static String readFile(String filename)
filename - the file to be read
null if the file does not
exist
public static void writeFile(String filename,
String text)
filename - the name of the filetext - the content of the file
public static String sort(String text,
boolean reverseOrder,
boolean caseInsensitive)
text - the text to be sortedreverseOrder - true if the sorting has to be done in
reverse order, false elsecaseInsensitive - true if the sorting has to be done
without taking care about the case, false else
public static ArrayList<String> sort(ArrayList<String> list,
boolean reverseOrder,
boolean caseInsensitive)
list - the list to be sortedreverseOrder - true if the sorting has to be done in
reverse order, false elsecaseInsensitive - true if the sorting has to be done
without taking care about the case, false else
public static String accentsToHtml(String input)
input - the input text
htmlToAccents(String)public static String htmlToAccents(String input)
input - the input text
accentsToHtml(String)public static String accentsToIso(String input)
input - the input text
isoToAccents(String)public static String isoToAccents(String input)
input - the input text
accentsToIso(String)public static String removeAccents(String input)
input - the input text
public static String noAccents(String input)
input - the input text
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||