org.netbeans.lib.cvsclient.file
Class FileUtils

java.lang.Object
  extended by org.netbeans.lib.cvsclient.file.FileUtils

public class FileUtils
extends Object

A utility class for file based operations.

Version:
Nov 23, 2001
Author:
Thomas Singer

Method Summary
static void copyFile(File sourceFile, File targetFile)
          Copies the specified sourceFile to the specified targetFile.
static FileReadOnlyHandler getFileReadOnlyHandler()
          Returns the current FileReadOnlyHandler used by setFileReadOnly().
static void renameFile(File orig, File dest)
          Do the best to rename the file.
static void setFileReadOnly(File file, boolean readOnly)
          Sets the specified file read-only (readOnly == true) or writable (readOnly == false).
static void setFileReadOnlyHandler(FileReadOnlyHandler fileReadOnlyHandler)
          Sets the specified fileReadOnlyHandler to be used with setFileReadOnly().
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getFileReadOnlyHandler

public static FileReadOnlyHandler getFileReadOnlyHandler()
Returns the current FileReadOnlyHandler used by setFileReadOnly().


setFileReadOnlyHandler

public static void setFileReadOnlyHandler(FileReadOnlyHandler fileReadOnlyHandler)
Sets the specified fileReadOnlyHandler to be used with setFileReadOnly().


setFileReadOnly

public static void setFileReadOnly(File file,
                                   boolean readOnly)
                            throws IOException
Sets the specified file read-only (readOnly == true) or writable (readOnly == false). If no fileReadOnlyHandler is set, nothing happens.

Throws:
IOException - if the operation failed

copyFile

public static void copyFile(File sourceFile,
                            File targetFile)
                     throws IOException
Copies the specified sourceFile to the specified targetFile.

Throws:
IOException

renameFile

public static void renameFile(File orig,
                              File dest)
                       throws IOException
Do the best to rename the file.

Parameters:
orig - regular file
dest - regular file (if exists it's rewritten)
Throws:
IOException


Copyright © 2011. All Rights Reserved.