org.apache.servicemix.jbi.deployer.utils
Class FileUtil

java.lang.Object
  extended by org.apache.servicemix.jbi.deployer.utils.FileUtil

public final class FileUtil
extends Object

File utilities

Version:
$Revision: 564900 $

Method Summary
static boolean buildDirectory(File file)
          Build a directory path - creating directories if neccesary
static void copyInputStream(InputStream in, OutputStream out)
          Copy in stream to an out stream
static boolean deleteFile(File fileToDelete)
          Delete a file
static void unpackArchive(File theFile, File targetDir)
          Unpack a zip file
static void unpackArchive(InputStream is, File targetDir)
          Unpack an archive from an input stream
static void unpackArchive(URL url, File targetDir)
          Unpack an archive from a URL
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

buildDirectory

public static boolean buildDirectory(File file)
Build a directory path - creating directories if neccesary

Parameters:
file -
Returns:
true if the directory exists, or making it was successful

copyInputStream

public static void copyInputStream(InputStream in,
                                   OutputStream out)
                            throws IOException
Copy in stream to an out stream

Parameters:
in -
out -
Throws:
IOException

unpackArchive

public static void unpackArchive(File theFile,
                                 File targetDir)
                          throws IOException
Unpack a zip file

Parameters:
theFile -
targetDir -
Throws:
IOException

unpackArchive

public static void unpackArchive(URL url,
                                 File targetDir)
                          throws IOException
Unpack an archive from a URL

Parameters:
url -
targetDir -
Throws:
IOException

unpackArchive

public static void unpackArchive(InputStream is,
                                 File targetDir)
                          throws IOException
Unpack an archive from an input stream

Parameters:
is -
targetDir -
Throws:
IOException

deleteFile

public static boolean deleteFile(File fileToDelete)
Delete a file

Parameters:
fileToDelete -
Returns:
true if the File is deleted


Copyright © 2005-2011 The Apache Software Foundation. All Rights Reserved.