|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.nuiton.util.PluginHelper
public class PluginHelper
Une classe pour mutualiser toutes les méthodes utiles pour un plugin.
| Nested Class Summary | |
|---|---|
static class |
PluginHelper.PropertiesDateRemoveFilterStream
Un ecrivain qui supprime la premiere ligne rencontree dans le flux. |
static class |
PluginHelper.SortedProperties
Permet d'avoir les fichiers de proprietes tries. |
| Field Summary | |
|---|---|
protected static double[] |
timeFactors
|
protected static java.lang.String[] |
timeUnites
|
| Constructor Summary | |
|---|---|
PluginHelper()
|
|
| Method Summary | ||
|---|---|---|
static boolean |
addResourceDir(java.lang.String newresourceDir,
org.apache.maven.project.MavenProject project)
|
|
static boolean |
addResourceDir(java.lang.String newresourceDir,
org.apache.maven.project.MavenProject project,
java.util.List<?> resources)
|
|
static boolean |
addTestResourceDir(java.lang.String newresourceDir,
org.apache.maven.project.MavenProject project)
|
|
static java.lang.String |
convert(long value,
double[] factors,
java.lang.String[] unites)
|
|
static java.lang.String |
convertTime(long value)
|
|
static java.lang.String |
convertTime(long value,
long value2)
|
|
static void |
copy(java.io.File source,
java.io.File target)
Permet de copier le fichier source vers le fichier cible. |
|
static void |
copyFiles(java.io.File src,
java.io.File dst,
java.lang.String[] includes,
java.lang.String[] excludes,
boolean overwrite)
|
|
static void |
copyFiles(PluginIOContext p,
java.lang.String[] includes,
java.lang.String[] excludes,
boolean overwrite)
|
|
static void |
expandFile(java.io.File src,
java.io.File dst,
java.lang.String[] includes,
boolean overwrite)
|
|
static void |
expandFiles(PluginIOContext p,
java.lang.String[] includes,
java.lang.String[] excludes,
java.lang.String[] zipIncludes,
boolean overwrite)
|
|
static java.util.SortedSet<java.lang.String> |
getEmptyKeys(java.util.Map<?,?> map)
Obtenir les clefs de toutes les valeurs nulles ou vide a partir d'un dictionnaire donne. |
|
static java.util.List<java.io.File> |
getIncludedFiles(java.io.File dir,
java.lang.String[] includes,
java.lang.String[] excludes)
|
|
static java.lang.String |
readAsString(java.io.File file,
java.lang.String encoding)
Permet de lire un fichier et de retourner sont contenu sous forme d'une chaine de carateres |
|
static java.lang.String |
readAsString(java.io.Reader file)
Permet de lire un fichier et de retourner sont contenu sous forme d'une chaine de carateres |
|
static
|
toGenericList(java.util.List<?> list,
java.lang.Class<O> type)
Permet de convertir une liste non typee, en une liste typee. |
|
static void |
write(java.io.File destFile,
java.lang.String content,
java.lang.String encoding)
|
|
static void |
writeString(java.io.File file,
java.lang.String content,
java.lang.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 |
|---|
protected static final double[] timeFactors
protected static final java.lang.String[] timeUnites
| Constructor Detail |
|---|
public PluginHelper()
| Method Detail |
|---|
public static <O> java.util.List<O> toGenericList(java.util.List<?> list,
java.lang.Class<O> type)
throws java.lang.IllegalArgumentException
O - le type des objets de la listelist - la liste a convertirtype - le type des elements de la liste
java.lang.IllegalArgumentException - si un element de la liste en entree n'est
pas en adequation avec le type voulue.public static java.lang.String convertTime(long value)
public static java.lang.String convertTime(long value,
long value2)
public static java.lang.String convert(long value,
double[] factors,
java.lang.String[] unites)
public static java.util.SortedSet<java.lang.String> getEmptyKeys(java.util.Map<?,?> map)
map - le dictionner a parcourir
public static boolean addResourceDir(java.lang.String newresourceDir,
org.apache.maven.project.MavenProject project)
public static boolean addTestResourceDir(java.lang.String newresourceDir,
org.apache.maven.project.MavenProject project)
public static boolean addResourceDir(java.lang.String newresourceDir,
org.apache.maven.project.MavenProject project,
java.util.List<?> resources)
public static void copy(java.io.File source,
java.io.File target)
throws java.io.IOException
source - le fichier sourcetarget - le fichier cible
java.io.IOException - Erreur de copie
public static java.lang.String readAsString(java.io.File file,
java.lang.String encoding)
throws java.io.IOException
file - le fichier a lireencoding - encoding to read file
java.io.IOException - if IO pb
public static java.lang.String readAsString(java.io.Reader file)
throws java.io.IOException
file - le reader a lire
java.io.IOException - if IO pb
public static void writeString(java.io.File file,
java.lang.String content,
java.lang.String encoding)
throws java.io.IOException
file - le fichier a ecrirecontent - le contenu du fichierencoding - l'encoding d'ecriture
java.io.IOException - if IO pb
public static void write(java.io.File destFile,
java.lang.String content,
java.lang.String encoding)
throws java.io.IOException
java.io.IOException
public static java.util.List<java.io.File> getIncludedFiles(java.io.File dir,
java.lang.String[] includes,
java.lang.String[] excludes)
public static void copyFiles(java.io.File src,
java.io.File dst,
java.lang.String[] includes,
java.lang.String[] excludes,
boolean overwrite)
throws java.io.IOException
java.io.IOException
public static void copyFiles(PluginIOContext p,
java.lang.String[] includes,
java.lang.String[] excludes,
boolean overwrite)
throws java.io.IOException
java.io.IOException
public static void expandFiles(PluginIOContext p,
java.lang.String[] includes,
java.lang.String[] excludes,
java.lang.String[] zipIncludes,
boolean overwrite)
throws java.io.IOException
java.io.IOException
public static void expandFile(java.io.File src,
java.io.File dst,
java.lang.String[] includes,
boolean overwrite)
throws java.io.IOException
java.io.IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||