com.notuvy.file
Class FileCopy

java.lang.Object
  extended by com.notuvy.file.FileCopy
All Implemented Interfaces:
Runnable

public class FileCopy
extends Object
implements Runnable

A utility to copy files.

Version:
$Id: Sample.java,v 1.1 2006/06/07 03:29:59 murali Exp $
Author:
murali

Field Summary
protected static org.apache.log4j.Logger LOG
           
 
Constructor Summary
FileCopy(File pSource, File pDestination)
           
 
Method Summary
protected  void doCopy()
           
 boolean getCreateDestinationParent()
           
 File getDestination()
           
 boolean getNoOverwrite()
           
 Progressable getProgress()
           
 File getSource()
           
 boolean getSuccessful()
           
protected  boolean preconditionsHold()
          Check all the preconditions for a valid copy.
 void run()
           
 void setCreateDestinationParent(boolean pCreateDestinationParent)
           
 void setNoOverwrite(boolean pNoOverwrite)
           
 void setProgress(Progressable pProgress)
           
protected  void setSuccessful(boolean pSuccessful)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

protected static final org.apache.log4j.Logger LOG
Constructor Detail

FileCopy

public FileCopy(File pSource,
                File pDestination)
Method Detail

getSource

public File getSource()

getDestination

public File getDestination()

getSuccessful

public boolean getSuccessful()

getCreateDestinationParent

public boolean getCreateDestinationParent()

getNoOverwrite

public boolean getNoOverwrite()

getProgress

public Progressable getProgress()

setSuccessful

protected void setSuccessful(boolean pSuccessful)

setCreateDestinationParent

public void setCreateDestinationParent(boolean pCreateDestinationParent)

setNoOverwrite

public void setNoOverwrite(boolean pNoOverwrite)

setProgress

public void setProgress(Progressable pProgress)

preconditionsHold

protected boolean preconditionsHold()
Check all the preconditions for a valid copy. If the parent directory of the destination does not exist, then create if directed to do so, or fail if not.

Returns:
A boolean flag that indicates that all the precondtions are valid.

doCopy

protected void doCopy()
               throws IOException
Throws:
IOException

run

public void run()
Specified by:
run in interface Runnable


Copyright © 2013. All Rights Reserved.