|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.nuiton.plugin.PluginHelper
public class PluginHelper
Une classe pour mutualiser toutes les méthodes utiles pour un plugin.
| Field Summary | |
|---|---|
protected static double[] |
memoryFactors
|
protected static String[] |
memoryUnites
|
static String |
SNAPSHOT_SUFFIX
|
protected static double[] |
timeFactors
|
protected static String[] |
timeUnites
|
| Constructor Summary | |
|---|---|
PluginHelper()
|
|
| Method Summary | ||
|---|---|---|
static boolean |
addResourceDir(String newresourceDir,
org.apache.maven.project.MavenProject project)
|
|
static boolean |
addResourceDir(String newresourceDir,
org.apache.maven.project.MavenProject project,
List<?> resources)
|
|
static boolean |
addTestResourceDir(String newresourceDir,
org.apache.maven.project.MavenProject project)
|
|
static String |
convert(long value,
double[] factors,
String[] unites)
|
|
static String |
convertMemory(long value)
|
|
static String |
convertTime(long value)
|
|
static String |
convertTime(long value,
long value2)
|
|
static void |
copy(File source,
File target)
Permet de copier le fichier source vers le fichier cible. |
|
static void |
copyFiles(File src,
File dst,
String[] includes,
String[] excludes,
boolean overwrite)
|
|
static void |
copyFiles(PluginIOContext p,
String[] includes,
String[] excludes,
boolean overwrite)
|
|
static void |
expandFile(File src,
File dst,
String[] includes,
boolean overwrite)
|
|
static void |
expandFiles(PluginIOContext p,
String[] includes,
String[] excludes,
String[] zipIncludes,
boolean overwrite)
|
|
static SortedSet<String> |
getEmptyKeys(Map<?,?> map)
Obtenir les clefs de toutes les valeurs nulles ou vide a partir d'un dictionnaire donne. |
|
static File |
getFile(File base,
String... paths)
|
|
static List<File> |
getIncludedFiles(File dir,
String[] includes,
String[] excludes)
|
|
static String |
getRelativePath(File base,
File file)
|
|
static String |
prefixLines(String prefix,
String prefixForEmpty,
String content)
Prefix the lines of the given content with a given prefix. |
|
static String |
readAsString(File file,
String encoding)
Permet de lire un fichier et de retourner sont contenu sous forme d'une chaine de carateres |
|
static String |
readAsString(Reader reader)
Permet de lire un fichier et de retourner sont contenu sous forme d'une chaine de carateres |
|
static String |
removeSnapshotSuffix(String versionId)
|
|
static String[] |
splitAndTrim(String txt,
String separator)
Split the given text using the separator and trim
each part of result. |
|
static
|
toGenericList(List<?> list,
Class<O> type)
Permet de convertir une liste non typee, en une liste typee. |
|
static void |
writeString(File file,
String content,
String encoding)
Sauvegarde un contenu dans un fichier. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String SNAPSHOT_SUFFIX
protected static final double[] timeFactors
protected static final String[] timeUnites
protected static final double[] memoryFactors
protected static final String[] memoryUnites
| Constructor Detail |
|---|
public PluginHelper()
| Method Detail |
|---|
public static String removeSnapshotSuffix(String versionId)
public static <O> List<O> toGenericList(List<?> list,
Class<O> type)
throws IllegalArgumentException
O - le type des objets de la listelist - la liste a convertirtype - le type des elements de la liste
IllegalArgumentException - si un element de la liste en entree n'est
pas en adequation avec le type voulue.public static String convertMemory(long value)
public static String convertTime(long value)
public static String convertTime(long value,
long value2)
public static String convert(long value,
double[] factors,
String[] unites)
public static String[] splitAndTrim(String txt,
String separator)
text using the separator and trim
each part of result.
txt - text to splitseparator - the split separator
public static String prefixLines(String prefix,
String prefixForEmpty,
String content)
throws IOException
prefix - prefix to add on each line of textprefixForEmpty - prefix to add for empty linescontent - the text to treate
IOException - if any reading problempublic static SortedSet<String> getEmptyKeys(Map<?,?> map)
map - le dictionner a parcourir
public static boolean addResourceDir(String newresourceDir,
org.apache.maven.project.MavenProject project)
public static boolean addTestResourceDir(String newresourceDir,
org.apache.maven.project.MavenProject project)
public static boolean addResourceDir(String newresourceDir,
org.apache.maven.project.MavenProject project,
List<?> resources)
public static void copy(File source,
File target)
throws IOException
source - le fichier sourcetarget - le fichier cible
IOException - Erreur de copie
public static String readAsString(File file,
String encoding)
throws IOException
file - le fichier a lireencoding - encoding to read file
IOException - if IO pb
public static String readAsString(Reader reader)
throws IOException
reader - la source alire
IOException - if IO pb
public static void writeString(File file,
String content,
String encoding)
throws IOException
file - le fichier a ecrirecontent - le contenu du fichierencoding - l'encoding d'ecriture
IOException - if IO pb
public static List<File> getIncludedFiles(File dir,
String[] includes,
String[] excludes)
public static void copyFiles(File src,
File dst,
String[] includes,
String[] excludes,
boolean overwrite)
throws IOException
IOException
public static void copyFiles(PluginIOContext p,
String[] includes,
String[] excludes,
boolean overwrite)
throws IOException
IOException
public static void expandFiles(PluginIOContext p,
String[] includes,
String[] excludes,
String[] zipIncludes,
boolean overwrite)
throws IOException
IOException
public static File getFile(File base,
String... paths)
public static String getRelativePath(File base,
File file)
public static void expandFile(File src,
File dst,
String[] includes,
boolean overwrite)
throws IOException
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||