You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by im...@apache.org on 2004/05/08 22:04:45 UTC
cvs commit: jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/tasks CopyTask.java
imario 2004/05/08 13:04:45
Modified: vfs/src/java/org/apache/commons/vfs/tasks CopyTask.java
Log:
added accessors to the overwrite/preserveLastModified
Revision Changes Path
1.8 +29 -14 jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/tasks/CopyTask.java
Index: CopyTask.java
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/tasks/CopyTask.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- CopyTask.java 28 Feb 2004 03:35:52 -0000 1.7
+++ CopyTask.java 8 May 2004 20:04:45 -0000 1.8
@@ -24,7 +24,6 @@
*
* @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a>
* @version $Revision$ $Date$
- *
* @todo Copy folders that do not contain files
*/
public class CopyTask
@@ -36,7 +35,7 @@
/**
* Enable/disable overwriting of up-to-date files.
*/
- public void setOverwrite( boolean overwrite )
+ public void setOverwrite(boolean overwrite)
{
this.overwrite = overwrite;
}
@@ -44,38 +43,54 @@
/**
* Enable/disable preserving last modified time of copied files.
*/
- public void setPreserveLastModified( boolean preserveLastModified )
+ public void setPreserveLastModified(boolean preserveLastModified)
{
this.preserveLastModified = preserveLastModified;
}
/**
+ * @return the curent value of overwrite
+ */
+ public boolean isOverwrite()
+ {
+ return overwrite;
+ }
+
+ /**
+ * @return the curent value of preserveLastModified
+ */
+ public boolean isPreserveLastModified()
+ {
+ return preserveLastModified;
+ }
+
+ /**
* Handles an out-of-date file.
*/
- protected void handleOutOfDateFile( final FileObject srcFile,
- final FileObject destFile )
+ protected void handleOutOfDateFile(final FileObject srcFile,
+ final FileObject destFile)
throws FileSystemException
{
- log( "Copying " + srcFile + " to " + destFile );
- destFile.copyFrom( srcFile, Selectors.SELECT_SELF );
- if ( preserveLastModified )
+ log("Copying " + srcFile + " to " + destFile);
+ destFile.copyFrom(srcFile, Selectors.SELECT_SELF);
+ if (preserveLastModified)
{
final long lastModTime = srcFile.getContent().getLastModifiedTime();
- destFile.getContent().setLastModifiedTime( lastModTime );
+ destFile.getContent().setLastModifiedTime(lastModTime);
}
}
/**
* Handles an up-to-date file.
*/
- protected void handleUpToDateFile( final FileObject srcFile,
- final FileObject destFile )
+ protected void handleUpToDateFile(final FileObject srcFile,
+ final FileObject destFile)
throws FileSystemException
{
- if ( overwrite )
+ if (overwrite)
{
// Copy the file anyway
- handleOutOfDateFile( srcFile, destFile );
+ handleOutOfDateFile(srcFile, destFile);
}
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org