Work on logical backups.
[lgpl/argeo-commons.git] / org.argeo.maintenance / src / org / argeo / maintenance / backup / LogicalBackup.java
index 9964b7f53cbf0e1b96a016095cf06f5294279ecd..864de25be9b3fa4483bb9aee8837f15149a0c664 100644 (file)
@@ -25,7 +25,6 @@ import java.util.zip.ZipOutputStream;
 
 import javax.jcr.Binary;
 import javax.jcr.Node;
-import javax.jcr.PathNotFoundException;
 import javax.jcr.Property;
 import javax.jcr.Repository;
 import javax.jcr.RepositoryException;
@@ -188,15 +187,10 @@ public class LogicalBackup implements Runnable {
                                        session.exportSystemView("/", contentHandler, true, false);
                                        if (log.isDebugEnabled())
                                                log.debug("Workspace " + workspaceName + ": metadata exported to " + relativePath);
-                               } catch (PathNotFoundException e) {
-                                       // TODO Auto-generated catch block
-                                       e.printStackTrace();
                                } catch (SAXException e) {
-                                       // TODO Auto-generated catch block
-                                       e.printStackTrace();
+                                       throw new RuntimeException("Cannot perform backup of workspace " + workspaceName, e);
                                } catch (RepositoryException e) {
-                                       // TODO Auto-generated catch block
-                                       e.printStackTrace();
+                                       throw new JcrException("Cannot perform backup of workspace " + workspaceName, e);
                                }
                        }
                        for (String path : contentHandler.getContentPaths()) {
@@ -205,8 +199,8 @@ public class LogicalBackup implements Runnable {
                                String fileRelativePath = WORKSPACES_BASE + workspaceName + contentNode.getParent().getPath();
                                try (InputStream in = binary.getStream(); OutputStream out = openOutputStream(fileRelativePath)) {
                                        IOUtils.copy(in, out);
-                                       if (log.isDebugEnabled())
-                                               log.debug("Workspace " + workspaceName + ": file content exported to " + fileRelativePath);
+                                       if (log.isTraceEnabled())
+                                               log.trace("Workspace " + workspaceName + ": file content exported to " + fileRelativePath);
                                } finally {
 
                                }