X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;f=org.argeo.eclipse.ui%2Fsrc%2Forg%2Fargeo%2Feclipse%2Fui%2Fjcr%2Futils%2FSingleSessionFileProvider.java;h=05754d024fc8daec2832ef96d2f47bfe7f69ba3f;hb=e54c6091d38b6859dec42f36e7334da19e2a0227;hp=57bdf246ec6e244b212c92a2cf9f739a891a6184;hpb=261af6b864de167e10eed1916f83035cca71d32f;p=lgpl%2Fargeo-commons.git diff --git a/org.argeo.eclipse.ui/src/org/argeo/eclipse/ui/jcr/utils/SingleSessionFileProvider.java b/org.argeo.eclipse.ui/src/org/argeo/eclipse/ui/jcr/utils/SingleSessionFileProvider.java index 57bdf246e..05754d024 100644 --- a/org.argeo.eclipse.ui/src/org/argeo/eclipse/ui/jcr/utils/SingleSessionFileProvider.java +++ b/org.argeo.eclipse.ui/src/org/argeo/eclipse/ui/jcr/utils/SingleSessionFileProvider.java @@ -24,7 +24,7 @@ import javax.jcr.Session; import javax.jcr.nodetype.NodeType; import org.apache.commons.io.IOUtils; -import org.argeo.ArgeoException; +import org.argeo.eclipse.ui.EclipseUiException; import org.argeo.eclipse.ui.FileProvider; /** @@ -35,9 +35,6 @@ import org.argeo.eclipse.ui.FileProvider; * Note that considered id is the JCR path * * Relies on common approach for JCR file handling implementation. - * - * @author bsinou - * */ @SuppressWarnings("deprecation") public class SingleSessionFileProvider implements FileProvider { @@ -58,7 +55,7 @@ public class SingleSessionFileProvider implements FileProvider { ba = IOUtils.toByteArray(fis); } catch (Exception e) { - throw new ArgeoException("Stream error while opening file", e); + throw new EclipseUiException("Stream error while opening file", e); } finally { IOUtils.closeQuietly(fis); } @@ -74,7 +71,7 @@ public class SingleSessionFileProvider implements FileProvider { .getBinary().getStream(); return fis; } catch (RepositoryException re) { - throw new ArgeoException("Cannot get stream from file node for Id " + throw new EclipseUiException("Cannot get stream from file node for Id " + fileId, re); } } @@ -93,23 +90,23 @@ public class SingleSessionFileProvider implements FileProvider { // Sanity checks if (result == null) - throw new ArgeoException("File node not found for ID" + fileId); + throw new EclipseUiException("File node not found for ID" + fileId); // Ensure that the node have the correct type. if (!result.isNodeType(NodeType.NT_FILE)) - throw new ArgeoException( + throw new EclipseUiException( "Cannot open file children Node that are not of " + NodeType.NT_RESOURCE + " type."); Node child = result.getNodes().nextNode(); if (child == null || !child.isNodeType(NodeType.NT_RESOURCE)) - throw new ArgeoException( + throw new EclipseUiException( "ERROR: IN the current implemented model, " + NodeType.NT_FILE + " file node must have one and only one child of the nt:ressource, where actual data is stored"); return child; } catch (RepositoryException re) { - throw new ArgeoException("Erreur while getting file node of ID " + throw new EclipseUiException("Erreur while getting file node of ID " + fileId, re); } }