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 java.lang.Object

File utilities

Version:
$Revision: 564900 $

Method Summary
static boolean buildDirectory(java.io.File file)
          Build a directory path - creating directories if neccesary
static void copyInputStream(java.io.InputStream in, java.io.OutputStream out)
          Copy in stream to an out stream
static boolean deleteFile(java.io.File fileToDelete)
          Delete a file
static void unpackArchive(java.io.File theFile, java.io.File targetDir)
          Unpack a zip file
static void unpackArchive(java.io.InputStream is, java.io.File targetDir)
          Unpack an archive from an input stream
static void unpackArchive(java.net.URL url, java.io.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(java.io.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(java.io.InputStream in,
                                   java.io.OutputStream out)
                            throws java.io.IOException
Copy in stream to an out stream

Parameters:
in -
out -
Throws:
java.io.IOException

unpackArchive

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

Parameters:
theFile -
targetDir -
Throws:
java.io.IOException

unpackArchive

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

Parameters:
url -
targetDir -
Throws:
java.io.IOException

unpackArchive

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

Parameters:
is -
targetDir -
Throws:
java.io.IOException

deleteFile

public static boolean deleteFile(java.io.File fileToDelete)
Delete a file

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


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