X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=org.argeo.server.jcr%2Fsrc%2Forg%2Fargeo%2Fjcr%2FJcrResourceAdapter.java;h=1ccce4f769972fc2c9296127bf8db614520f6484;hb=8260f4470f514ea347ca53f5b4dfc632c4a4de66;hp=0b1a98cf0ce0b34e7910412776b983661c83a64e;hpb=cf3a914f6fbf31b43be5cb86e54d05e8543be6a9;p=lgpl%2Fargeo-commons.git diff --git a/org.argeo.server.jcr/src/org/argeo/jcr/JcrResourceAdapter.java b/org.argeo.server.jcr/src/org/argeo/jcr/JcrResourceAdapter.java index 0b1a98cf0..1ccce4f76 100644 --- a/org.argeo.server.jcr/src/org/argeo/jcr/JcrResourceAdapter.java +++ b/org.argeo.server.jcr/src/org/argeo/jcr/JcrResourceAdapter.java @@ -32,7 +32,6 @@ import javax.jcr.version.VersionIterator; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.argeo.ArgeoException; /** * Bridge Spring resources and JCR folder / files semantics (nt:folder / @@ -63,7 +62,7 @@ public class JcrResourceAdapter { public void create(String path, InputStream in, String mimeType) { try { if (session().itemExists(path)) { - throw new ArgeoException("Node " + path + " already exists."); + throw new ArgeoJcrException("Node " + path + " already exists."); } int index = path.lastIndexOf('/'); @@ -72,7 +71,7 @@ public class JcrResourceAdapter { parentPath = "/"; String fileName = path.substring(index + 1); if (!session().itemExists(parentPath)) - throw new ArgeoException("Parent folder of node " + path + throw new ArgeoJcrException("Parent folder of node " + path + " does not exist: " + parentPath); Node folderNode = (Node) session().getItem(parentPath); @@ -103,7 +102,7 @@ public class JcrResourceAdapter { if (log.isDebugEnabled()) log.debug("Created " + path); } catch (Exception e) { - throw new ArgeoException("Cannot create node for " + path, e); + throw new ArgeoJcrException("Cannot create node for " + path, e); } } @@ -141,13 +140,13 @@ public class JcrResourceAdapter { if (log.isDebugEnabled()) log.debug("Updated " + path); } catch (Exception e) { - throw new ArgeoException("Cannot update node " + path, e); + throw new ArgeoJcrException("Cannot update node " + path, e); } } public List listVersions(String path) { if (!versioning) - throw new ArgeoException("Versioning is not activated"); + throw new ArgeoJcrException("Versioning is not activated"); try { List versions = new ArrayList(); @@ -164,7 +163,7 @@ public class JcrResourceAdapter { } return versions; } catch (Exception e) { - throw new ArgeoException("Cannot list version of node " + path, e); + throw new ArgeoJcrException("Cannot list version of node " + path, e); } } @@ -175,13 +174,13 @@ public class JcrResourceAdapter { Property property = node.getProperty(Property.JCR_DATA); return property.getBinary().getStream(); } catch (Exception e) { - throw new ArgeoException("Cannot retrieve " + path, e); + throw new ArgeoJcrException("Cannot retrieve " + path, e); } } public synchronized InputStream retrieve(String path, Integer revision) { if (!versioning) - throw new ArgeoException("Versioning is not activated"); + throw new ArgeoJcrException("Versioning is not activated"); try { Node fileNode = (Node) session().getItem(path); @@ -201,11 +200,11 @@ public class JcrResourceAdapter { count++; } } catch (Exception e) { - throw new ArgeoException("Cannot retrieve version " + revision + throw new ArgeoJcrException("Cannot retrieve version " + revision + " of " + path, e); } - throw new ArgeoException("Version " + revision + throw new ArgeoJcrException("Version " + revision + " does not exist for node " + path); }