org.nuxeo.connect.update.impl.task.commands
Class Copy
java.lang.Object
org.nuxeo.connect.update.impl.task.AbstractCommand
org.nuxeo.connect.update.impl.task.commands.Copy
- All Implemented Interfaces:
- Command
- Direct Known Subclasses:
- ParametrizedCopy
public class Copy
- extends AbstractCommand
Copy a file to the given target directory or file. If the target is a
directory the file name is preserved. If the target file exists it will be
replaced if overwrite is true otherwise the command validation fails.
If md5 is set then the copy command will be validated only if the target file
has the same md5 as the one specified in the command.
The Copy command has as inverse either Delete either another Copy command. If
the file was copied without overwriting then Delete is the inverse (with a
md5 set to the one of the copied file). If the file was overwritten then the
Copy command has an inverse another copy command with the md5 to the one of
the copied file and the overwrite flag to true. The file to copy will be the
backup of the overwritten file.
- Author:
- Bogdan Stefanescu
Method Summary |
void |
readFrom(Element element)
Must be implemented to initialize the command arguments from an XML
fragment. |
void |
writeTo(XmlWriter writer)
Write the command as XML using the given XmlWriter . |
ID
public static final String ID
- See Also:
- Constant Field Values
Copy
public Copy()
Copy
public Copy(File file,
File tofile,
String md5,
boolean overwrite)
readFrom
public void readFrom(Element element)
throws org.nuxeo.connect.update.PackageException
- Description copied from class:
AbstractCommand
- Must be implemented to initialize the command arguments from an XML
fragment.
- Specified by:
readFrom
in class AbstractCommand
- Throws:
org.nuxeo.connect.update.PackageException
writeTo
public void writeTo(XmlWriter writer)
- Description copied from interface:
Command
- Write the command as XML using the given
XmlWriter
. This method
will be called by the task to create an uninstall.xml file.
Copyright © 2011 Nuxeo SAS. All Rights Reserved.