Package org.basex.core.cmd
Class Copy
java.lang.Object
org.basex.core.jobs.Job
org.basex.core.Command
org.basex.core.cmd.Copy
Evaluates the 'copy' command and creates a copy of a database.
- Author:
- BaseX Team 2005-21, BSD License, Christian Gruen
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddLocks()Adds the strings (databases, special identifiers) for which locks need to be acquired.static voidcopy(String source, String target, StaticOptions sopts, Copy cmd) Copies the specified database.doubleReturns a progress value (0 - 1).protected booleanrun()Executes the command and serializes the result (internal call).Returns short progress information.booleanReturns true if this command returns a progress value.Methods inherited from class org.basex.core.Command
addLocks, baseURI, baseURI, build, close, error, exception, execute, execute, getOption, getOption, info, info, init, maxResults, newData, result, run, run, setInput, setInput, stoppable, toString, toString, updated, updating
-
Constructor Details
-
Copy
Default constructor.- Parameters:
db- db namenewdb- new db name
-
-
Method Details
-
run
protected boolean run()Description copied from class:CommandExecutes the command and serializes the result (internal call). -
copy
public static void copy(String source, String target, StaticOptions sopts, Copy cmd) throws IOException Copies the specified database.- Parameters:
source- name of the databasetarget- new database namesopts- static optionscmd- calling command (can benull)- Throws:
IOException- I/O exception
-
addLocks
public void addLocks()Description copied from class:JobAdds the strings (databases, special identifiers) for which locks need to be acquired. -
shortInfo
Description copied from class:JobReturns short progress information. Can be overwritten to give more specific feedback. -
supportsProg
public boolean supportsProg()Description copied from class:CommandReturns true if this command returns a progress value. This method is only required by the GUI.- Overrides:
supportsProgin classCommand- Returns:
- result of check
-
progressInfo
public double progressInfo()Description copied from class:JobReturns a progress value (0 - 1). Can be overwritten to give more specific feedback.- Overrides:
progressInfoin classJob- Returns:
- header information
-