com.googlecode.jpattern.core.util
Class FileHelper

java.lang.Object
  extended by com.googlecode.jpattern.core.util.FileHelper

public abstract class FileHelper
extends java.lang.Object

Author:
Francesco Cina' 21/lug/2010

Constructor Summary
FileHelper()
           
 
Method Summary
static java.lang.String getExtension(java.lang.String filename)
           
static java.lang.String removeExtension(java.lang.String filename)
           
static java.lang.String removePath(java.lang.String filename)
          Restituisce il nome del file privo del path
static void zipFiles(java.lang.String[] files, java.lang.String zipfilename, boolean ignorePath, int compressionLevel)
          Crea un file compresso da una lista di file
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileHelper

public FileHelper()
Method Detail

zipFiles

public static void zipFiles(java.lang.String[] files,
                            java.lang.String zipfilename,
                            boolean ignorePath,
                            int compressionLevel)
                     throws java.lang.Exception
Crea un file compresso da una lista di file

Parameters:
files - array di nomi di file da includere nello zip finale
zipfilename - nome del file zip che deve essere creato
ignorePath - se true archivia i file senza il loro path
compressionLevel - livello di compressione, varia da 1 (non compresso) a 9 (massima compressione)
Throws:
java.lang.Exception

removePath

public static java.lang.String removePath(java.lang.String filename)
Restituisce il nome del file privo del path

Parameters:
fName - il nome completo del file (comprendente il path)
Returns:
il nome del file privo del path

removeExtension

public static java.lang.String removeExtension(java.lang.String filename)

getExtension

public static java.lang.String getExtension(java.lang.String filename)


Copyright © 2011. All Rights Reserved.