org.objectweb.dsrg.sofa.util
Class IOUtil

java.lang.Object
  extended by org.objectweb.dsrg.sofa.util.IOUtil

public class IOUtil
extends java.lang.Object

Helper i/o static methods.


Constructor Summary
IOUtil()
           
 
Method Summary
static boolean delete(java.io.File f)
          Deletes given file or directory (it it is directory then it deletes it recursively.
static void makeJar(java.io.File jarFile, java.io.File dir)
          Packs complete directory into the jar file.
static void makeJarFromSubdirs(java.io.File jarfile, java.io.File dir)
          Packs all subdirectories into the jar file.
static void makeJarFromSubdirs(java.io.File jarfile, java.io.File dir, java.util.Set<java.lang.String> subdirs)
          Packs selected subdirectories into the jar file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IOUtil

public IOUtil()
Method Detail

delete

public static boolean delete(java.io.File f)
Deletes given file or directory (it it is directory then it deletes it recursively.

Parameters:
f - file or directory
Returns:
true if and only if the file or directory is successfully deleted; false otherwise

makeJar

public static void makeJar(java.io.File jarFile,
                           java.io.File dir)
                    throws java.io.IOException
Packs complete directory into the jar file.

Parameters:
jarFile - name of the jar file
dir - directory to be packed
Throws:
java.io.IOException

makeJarFromSubdirs

public static void makeJarFromSubdirs(java.io.File jarfile,
                                      java.io.File dir)
                               throws java.io.IOException
Packs all subdirectories into the jar file.

Parameters:
jarfile - name of the jar file
dir - directory to be packed
Throws:
java.io.IOException

makeJarFromSubdirs

public static void makeJarFromSubdirs(java.io.File jarfile,
                                      java.io.File dir,
                                      java.util.Set<java.lang.String> subdirs)
                               throws java.io.IOException
Packs selected subdirectories into the jar file.

Parameters:
jarfile - name of the jar file
dir - directory to be packed
subdirs -
Throws:
java.io.IOException