org.apache.servicemix.jbi.util
Class FileUtil

java.lang.Object
  extended by org.apache.servicemix.jbi.util.FileUtil

Deprecated. use FileUtil instead

public final class FileUtil
extends Object

File utilities

Version:
$Revision: 691982 $

Method Summary
static boolean archiveContainsEntry(File theFile, String name)
          Deprecated. Validate that an archive contains a named entry
static boolean buildDirectory(File file)
          Deprecated. Build a directory path - creating directories if neccesary
static void copyInputStream(InputStream in, OutputStream out)
          Deprecated. Copy in stream to an out stream
static int countFilesInDirectory(File directory)
          Deprecated. Count files in a directory (including files in all subdirectories)
static File createUniqueDirectory(File rootDir, String seed)
          Deprecated. Create a unique directory within a directory 'root'
static boolean deleteFile(File fileToDelete)
          Deprecated. Delete a file
static File getDirectoryPath(File parent, String subDirectory)
          Deprecated. Build a path- but do not create it
static void moveFile(File src, File targetDirectory)
          Deprecated. Move a File
static File unpackArchive(File theFile, File targetDir)
          Deprecated. Unpack a zip file
static File unpackArchive(URL url, File targetDir)
          Deprecated. Unpack an archive from a URL
static void zipDir(String directory, String zipName)
          Deprecated. Zip up a directory
static void zipDir(String directory, ZipOutputStream zos, String path)
          Deprecated. Zip up a directory path
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

moveFile

public static void moveFile(File src,
                            File targetDirectory)
                     throws IOException
Deprecated. 
Move a File

Parameters:
src -
targetDirectory -
Throws:
IOException

getDirectoryPath

public static File getDirectoryPath(File parent,
                                    String subDirectory)
Deprecated. 
Build a path- but do not create it

Parameters:
parent -
subDirectory -
Returns:
a File representing the path

buildDirectory

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

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

countFilesInDirectory

public static int countFilesInDirectory(File directory)
Deprecated. 
Count files in a directory (including files in all subdirectories)

Parameters:
directory - the directory to start in
Returns:
the total number of files

copyInputStream

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

Parameters:
in -
out -
Throws:
IOException

unpackArchive

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

Parameters:
theFile -
targetDir -
Returns:
the file
Throws:
IOException

unpackArchive

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

Parameters:
url -
targetDir -
Returns:
the file to the url
Throws:
IOException

archiveContainsEntry

public static boolean archiveContainsEntry(File theFile,
                                           String name)
                                    throws IOException
Deprecated. 
Validate that an archive contains a named entry

Parameters:
theFile -
name -
Returns:
true if the entry exists
Throws:
IOException

createUniqueDirectory

public static File createUniqueDirectory(File rootDir,
                                         String seed)
                                  throws IOException
Deprecated. 
Create a unique directory within a directory 'root'

Parameters:
rootDir -
seed -
Returns:
unique directory
Throws:
IOException

deleteFile

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

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

zipDir

public static void zipDir(String directory,
                          String zipName)
                   throws IOException
Deprecated. 
Zip up a directory

Parameters:
directory -
zipName -
Throws:
IOException

zipDir

public static void zipDir(String directory,
                          ZipOutputStream zos,
                          String path)
                   throws IOException
Deprecated. 
Zip up a directory path

Parameters:
directory -
zos -
path -
Throws:
IOException


Copyright © 2005-2008 Apache Software Foundation. All Rights Reserved.