MCPcopy Create free account
hub / github.com/BaseXdb/basex / run

Method run

basex-core/src/main/java/org/basex/core/cmd/Copy.java:35–54  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

33 }
34
35 @Override
36 protected boolean run() {
37 final String src = args[0];
38 final String trg = args[1];
39 // check if names are valid
40 if(!Databases.validName(src)) return error(NAME_INVALID_X, src);
41 if(!Databases.validName(trg)) return error(NAME_INVALID_X, trg);
42
43 // source database does not exist
44 if(!soptions.dbExists(src)) return error(DB_NOT_FOUND_X, src);
45
46 // try to copy database
47 try {
48 copy(src, trg, soptions, this);
49 return info(DB_COPIED_X, src, jc().performance);
50 } catch(final IOException ex) {
51 Util.debug(ex);
52 return error(DB_NOT_COPIED_X, src);
53 }
54 }
55
56 /**
57 * Copies the specified database.

Callers

nothing calls this directly

Calls 7

validNameMethod · 0.95
copyMethod · 0.95
debugMethod · 0.95
jcMethod · 0.80
infoMethod · 0.65
errorMethod · 0.45
dbExistsMethod · 0.45

Tested by

no test coverage detected