Class ParameterizedCopy
- java.lang.Object
-
- org.nuxeo.connect.update.task.standalone.commands.AbstractCommand
-
- org.nuxeo.connect.update.task.standalone.commands.Copy
-
- org.nuxeo.connect.update.task.standalone.commands.ParameterizedCopy
-
- All Implemented Interfaces:
org.nuxeo.connect.update.task.Command
public class ParameterizedCopy extends Copy
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
-
-
Field Summary
Fields Modifier and Type Field Description static String
ID
-
Fields inherited from class org.nuxeo.connect.update.task.standalone.commands.Copy
append, file, LAUNCHER_CHANGED_PROPERTY, LAUNCHER_JAR, log, md5, overwrite, removeOnExit, tofile
-
Fields inherited from class org.nuxeo.connect.update.task.standalone.commands.AbstractCommand
fail, guardVars, id, ignore
-
-
Constructor Summary
Constructors Constructor Description ParameterizedCopy()
ParameterizedCopy(File file, File tofile, String md5, boolean overwrite)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
getContentToCopy(File fileToCopy, Map<String,String> prefs)
Override in subclass to parameterize content.-
Methods inherited from class org.nuxeo.connect.update.task.standalone.commands.Copy
doCopy, doRun, doValidate, getContentToCopy, readFrom, writeTo
-
Methods inherited from class org.nuxeo.connect.update.task.standalone.commands.AbstractCommand
getId, ignore, initialize, isPostInstall, run, setFail, setIgnore, setPackageUpdateService, validate
-
-
-
-
Field Detail
-
ID
public static final String ID
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ParameterizedCopy
public ParameterizedCopy()
-
ParameterizedCopy
public ParameterizedCopy(File file, File tofile, String md5, boolean overwrite)
-
-
Method Detail
-
getContentToCopy
protected String getContentToCopy(File fileToCopy, Map<String,String> prefs) throws org.nuxeo.connect.update.PackageException
Description copied from class:Copy
Override in subclass to parameterize content.- Overrides:
getContentToCopy
in classCopy
- Returns:
- Content to put in destination file. See
Copy.append
parameter to determine if returned content is replacing or appending to destination file. - Throws:
org.nuxeo.connect.update.PackageException
-
-