org.nuiton.util
Class PluginHelper

java.lang.Object
  extended by org.nuiton.util.PluginHelper

Deprecated. since 1.0.3, move to package org.nuiton.plugin (removed in 1.1.0)

@Deprecated
public class PluginHelper
extends Object

Une classe pour mutualiser toutes les méthodes utiles pour un plugin.

Author:
chemit

Nested Class Summary
static class PluginHelper.PropertiesDateRemoveFilterStream
          Deprecated. Un ecrivain qui supprime la premiere ligne rencontree dans le flux.
static class PluginHelper.SortedProperties
          Deprecated. Permet d'avoir les fichiers de proprietes tries.
 
Field Summary
protected static double[] memoryFactors
          Deprecated.  
protected static String[] memoryUnites
          Deprecated.  
static String SNAPSHOT_SUFFIX
          Deprecated.  
protected static double[] timeFactors
          Deprecated.  
protected static String[] timeUnites
          Deprecated.  
 
Constructor Summary
PluginHelper()
          Deprecated.  
 
Method Summary
static boolean addResourceDir(String newresourceDir, org.apache.maven.project.MavenProject project)
          Deprecated.  
static boolean addResourceDir(String newresourceDir, org.apache.maven.project.MavenProject project, List<?> resources)
          Deprecated.  
static boolean addTestResourceDir(String newresourceDir, org.apache.maven.project.MavenProject project)
          Deprecated.  
static String convert(long value, double[] factors, String[] unites)
          Deprecated.  
static String convertMemory(long value)
          Deprecated.  
static String convertTime(long value)
          Deprecated.  
static String convertTime(long value, long value2)
          Deprecated.  
static void copy(File source, File target)
          Deprecated. Permet de copier le fichier source vers le fichier cible.
static void copyFiles(File src, File dst, String[] includes, String[] excludes, boolean overwrite)
          Deprecated.  
static void copyFiles(PluginIOContext p, String[] includes, String[] excludes, boolean overwrite)
          Deprecated.  
static void expandFile(File src, File dst, String[] includes, boolean overwrite)
          Deprecated.  
static void expandFiles(PluginIOContext p, String[] includes, String[] excludes, String[] zipIncludes, boolean overwrite)
          Deprecated.  
static SortedSet<String> getEmptyKeys(Map<?,?> map)
          Deprecated. Obtenir les clefs de toutes les valeurs nulles ou vide a partir d'un dictionnaire donne.
static List<File> getIncludedFiles(File dir, String[] includes, String[] excludes)
          Deprecated.  
static String prefixLines(String prefix, String prefixForEmpty, String content)
          Deprecated. Prefix the lines of the given content with a given prefix.
static String readAsString(File file, String encoding)
          Deprecated. Permet de lire un fichier et de retourner sont contenu sous forme d'une chaine de carateres
static String readAsString(Reader file)
          Deprecated. Permet de lire un fichier et de retourner sont contenu sous forme d'une chaine de carateres
static String removeSnapshotSuffix(String versionId)
          Deprecated.  
static
<O> List<O>
toGenericList(List<?> list, Class<O> type)
          Deprecated. Permet de convertir une liste non typee, en une liste typee.
static void write(File destFile, String content, String encoding)
          Deprecated.  
static void writeString(File file, String content, String encoding)
          Deprecated. 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

SNAPSHOT_SUFFIX

public static final String SNAPSHOT_SUFFIX
Deprecated. 
See Also:
Constant Field Values

timeFactors

protected static final double[] timeFactors
Deprecated. 

timeUnites

protected static final String[] timeUnites
Deprecated. 

memoryFactors

protected static final double[] memoryFactors
Deprecated. 

memoryUnites

protected static final String[] memoryUnites
Deprecated. 
Constructor Detail

PluginHelper

public PluginHelper()
Deprecated. 
Method Detail

removeSnapshotSuffix

public static String removeSnapshotSuffix(String versionId)
Deprecated. 

toGenericList

public static <O> List<O> toGenericList(List<?> list,
                                        Class<O> type)
                             throws IllegalArgumentException
Deprecated. 
Permet de convertir une liste non typee, en une liste typee.

La liste en entree en juste bien castee.

On effectue une verification sur le typage des elements de la liste.

Note : Aucune liste n'est creee, ni recopiee

Type Parameters:
O - le type des objets de la liste
Parameters:
list - la liste a convertir
type - le type des elements de la liste
Returns:
la liste typee
Throws:
IllegalArgumentException - si un element de la liste en entree n'est pas en adequation avec le type voulue.

convertMemory

public static String convertMemory(long value)
Deprecated. 

convertTime

public static String convertTime(long value)
Deprecated. 

convertTime

public static String convertTime(long value,
                                 long value2)
Deprecated. 

convert

public static String convert(long value,
                             double[] factors,
                             String[] unites)
Deprecated. 

prefixLines

public static String prefixLines(String prefix,
                                 String prefixForEmpty,
                                 String content)
                          throws IOException
Deprecated. 
Prefix the lines of the given content with a given prefix.

Parameters:
prefix - prefix to add on each line of text
prefixForEmpty - prefix to add for empty lines
content - the text to treate
Returns:
the text transformed
Throws:
IOException - if any reading problem

getEmptyKeys

public static SortedSet<String> getEmptyKeys(Map<?,?> map)
Deprecated. 
Obtenir les clefs de toutes les valeurs nulles ou vide a partir d'un dictionnaire donne.

Parameters:
map - le dictionner a parcourir
Returns:
la liste des clefs dont la valeur est nulle ou vide

addResourceDir

public static boolean addResourceDir(String newresourceDir,
                                     org.apache.maven.project.MavenProject project)
Deprecated. 

addTestResourceDir

public static boolean addTestResourceDir(String newresourceDir,
                                         org.apache.maven.project.MavenProject project)
Deprecated. 

addResourceDir

public static boolean addResourceDir(String newresourceDir,
                                     org.apache.maven.project.MavenProject project,
                                     List<?> resources)
Deprecated. 

copy

public static void copy(File source,
                        File target)
                 throws IOException
Deprecated. 
Permet de copier le fichier source vers le fichier cible.

Parameters:
source - le fichier source
target - le fichier cible
Throws:
IOException - Erreur de copie

readAsString

public static String readAsString(File file,
                                  String encoding)
                           throws IOException
Deprecated. 
Permet de lire un fichier et de retourner sont contenu sous forme d'une chaine de carateres

Parameters:
file - le fichier a lire
encoding - encoding to read file
Returns:
the content of the file
Throws:
IOException - if IO pb

readAsString

public static String readAsString(Reader file)
                           throws IOException
Deprecated. 
Permet de lire un fichier et de retourner sont contenu sous forme d'une chaine de carateres

Parameters:
file - le reader a lire
Returns:
the content of the file
Throws:
IOException - if IO pb

writeString

public static void writeString(File file,
                               String content,
                               String encoding)
                        throws IOException
Deprecated. 
Sauvegarde un contenu dans un fichier.

Parameters:
file - le fichier a ecrire
content - le contenu du fichier
encoding - l'encoding d'ecriture
Throws:
IOException - if IO pb

write

public static void write(File destFile,
                         String content,
                         String encoding)
                  throws IOException
Deprecated. 
Throws:
IOException

getIncludedFiles

public static List<File> getIncludedFiles(File dir,
                                          String[] includes,
                                          String[] excludes)
Deprecated. 

copyFiles

public static void copyFiles(File src,
                             File dst,
                             String[] includes,
                             String[] excludes,
                             boolean overwrite)
                      throws IOException
Deprecated. 
Throws:
IOException

copyFiles

public static void copyFiles(PluginIOContext p,
                             String[] includes,
                             String[] excludes,
                             boolean overwrite)
                      throws IOException
Deprecated. 
Throws:
IOException

expandFiles

public static void expandFiles(PluginIOContext p,
                               String[] includes,
                               String[] excludes,
                               String[] zipIncludes,
                               boolean overwrite)
                        throws IOException
Deprecated. 
Throws:
IOException

expandFile

public static void expandFile(File src,
                              File dst,
                              String[] includes,
                              boolean overwrite)
                       throws IOException
Deprecated. 
Throws:
IOException


Copyright © 2009 CodeLutin. All Rights Reserved.