站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss 4.0.1 sp1 common API Documentation 英文版文档

Files (JBoss/Common API) - JBoss 4.0.1 sp1 common API Documentation 英文版文档


org.jboss.util.file
Class Files

java.lang.Object
  extended byorg.jboss.util.file.Files

public final class Files
extends Object

A collection of file utilities.

Version:
$Revision: 1.4 $
Author:
Jason Dillon, Scott.Stark@jboss.org

Field Summary
static int DEFAULT_BUFFER_SIZE
          The default size of the copy buffer.
 
Constructor Summary
Files()
           
 
Method Summary
static void copy(File source, File target)
          Copy a file.
static void copy(File source, File target, byte[] buff)
          Copy a file.
static void copy(File source, File target, int size)
          Copy a file.
static boolean delete(File dir)
          Delete a file, or a directory and all of its contents.
static boolean delete(String dirname)
          Delete a file or directory and all of its contents.
static boolean deleteContaining(String filename)
          Delete a directory contaning the given file and all its contents.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_BUFFER_SIZE

public static final int DEFAULT_BUFFER_SIZE
The default size of the copy buffer.

See Also:
Constant Field Values
Constructor Detail

Files

public Files()
Method Detail

delete

public static boolean delete(File dir)
Delete a file, or a directory and all of its contents.

Parameters:
dir - The directory or file to delete.
Returns:
True if all delete operations were successfull.

delete

public static boolean delete(String dirname)
Delete a file or directory and all of its contents.

Parameters:
dirname - The name of the file or directory to delete.
Returns:
True if all delete operations were successfull.

deleteContaining

public static boolean deleteContaining(String filename)
Delete a directory contaning the given file and all its contents.

Parameters:
filename - a file or directory in the containing directory to delete
Returns:
true if all delete operations were successfull, false if any delete failed.

copy

public static void copy(File source,
                        File target,
                        byte[] buff)
                 throws IOException
Copy a file.

Parameters:
source - Source file to copy.
target - Destination target file.
buff - The copy buffer.
Throws:
IOException - Failed to copy file.

copy

public static void copy(File source,
                        File target,
                        int size)
                 throws IOException
Copy a file.

Parameters:
source - Source file to copy.
target - Destination target file.
size - The size of the copy buffer.
Throws:
IOException - Failed to copy file.

copy

public static void copy(File source,
                        File target)
                 throws IOException
Copy a file.

Parameters:
source - Source file to copy.
target - Destination target file.
Throws:
IOException - Failed to copy file.


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.