modified
This commit is contained in:
parent
d567786ff6
commit
3631e00a90
|
@ -20,7 +20,7 @@ public class BackupJackrabbit implements AbstractScript{
|
|||
StringBuilder stringBuilder = new StringBuilder();
|
||||
try {
|
||||
try(OutputStream os = new ByteArrayOutputStream()){
|
||||
session.exportDocumentView("/", os, true, false);
|
||||
session.exportSystemView("/", os, true, false);
|
||||
stringBuilder.append(os.toString());
|
||||
}
|
||||
}catch (Throwable e) {
|
||||
|
|
|
@ -3,6 +3,8 @@ import java.io.PrintWriter;
|
|||
import java.io.StringWriter;
|
||||
import java.net.URI;
|
||||
|
||||
import javax.jcr.ImportUUIDBehavior;
|
||||
|
||||
import org.apache.jackrabbit.api.JackrabbitSession;
|
||||
import org.gcube.data.access.storagehub.scripting.AbstractScript;
|
||||
import org.gcube.data.access.storagehub.scripting.ScriptParameter;
|
||||
|
@ -21,8 +23,11 @@ public class RetoreJackrabbitBackup implements AbstractScript{
|
|||
StringBuilder stringBuilder = new StringBuilder();
|
||||
|
||||
try {
|
||||
try(InputStream is = new URI("https://data-dev.d4science.net/VoyH").toURL().openStream()){
|
||||
session.importXML("/", is, 1);
|
||||
if(session.nodeExists("/Share"))
|
||||
session.getNode("/Share").remove();
|
||||
session.save();
|
||||
try(InputStream is = new URI("https://data-dev.d4science.net/iUnB").toURL().openStream()){
|
||||
session.importXML("/", is, ImportUUIDBehavior.IMPORT_UUID_COLLISION_THROW);
|
||||
}
|
||||
session.save();
|
||||
}catch (Throwable e) {
|
||||
|
|
Loading…
Reference in New Issue