com.xmlserv.util
Class FileUtil

java.lang.Object
  |
  +--com.xmlserv.util.FileUtil

public class FileUtil
extends java.lang.Object


Constructor Summary
FileUtil()
           
 
Method Summary
static void copy(java.io.File source, java.io.File dest)
          File copy operation.
static java.lang.String createTempFilename(java.lang.String prefix)
          Return a temporary filename consisting of the given prefix plus 10 random characters and numbers.
static java.lang.String createTempFilename(java.lang.String prefix, int length)
          Return a random filename starting with the given prefix adding length characters.
static void move(java.io.File source, java.io.File dest)
          Copy source to destination and delete source.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileUtil

public FileUtil()
Method Detail

copy

public static void copy(java.io.File source,
                        java.io.File dest)
                 throws java.io.IOException
File copy operation.
Parameters:
source - The source File object.
dest - Destination file object.
Throws:
java.io.IOException - On any I/O error.

move

public static void move(java.io.File source,
                        java.io.File dest)
                 throws java.io.IOException
Copy source to destination and delete source.
Parameters:
source - The source File object.
dest - The destination File object.
Throws:
java.io.IOException - On any I/O error.

createTempFilename

public static java.lang.String createTempFilename(java.lang.String prefix)
Return a temporary filename consisting of the given prefix plus 10 random characters and numbers.
Parameters:
prefix - The filename prefix.
Returns:
The filename.

createTempFilename

public static java.lang.String createTempFilename(java.lang.String prefix,
                                                  int length)
Return a random filename starting with the given prefix adding length characters.
Parameters:
prefix - The filename prefix.
length - The number of random characters to add to prefix.
Returns:
The filename.