X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=org.argeo.cms.jcr%2Fsrc%2Forg%2Fargeo%2Fcms%2Fjcr%2Facr%2FJcrContent.java;h=30590640e05cc6a29b43f5b22eeeb90863a2b7a5;hb=40e89f491fb2aad2e1219b28106588ea365198a0;hp=a4af35bc671437ad6b3d9d587817181a9ab7a480;hpb=bce03099b0d2f1758e7a3d74fba339d0200924d5;p=gpl%2Fargeo-jcr.git
diff --git a/org.argeo.cms.jcr/src/org/argeo/cms/jcr/acr/JcrContent.java b/org.argeo.cms.jcr/src/org/argeo/cms/jcr/acr/JcrContent.java
index a4af35b..3059064 100644
--- a/org.argeo.cms.jcr/src/org/argeo/cms/jcr/acr/JcrContent.java
+++ b/org.argeo.cms.jcr/src/org/argeo/cms/jcr/acr/JcrContent.java
@@ -257,12 +257,20 @@ public class JcrContent extends AbstractContent {
public A adapt(Class clss) {
if (Source.class.isAssignableFrom(clss)) {
// try {
- PipedInputStream in = new PipedInputStream();
+ PipedOutputStream out = new PipedOutputStream();
+ PipedInputStream in;
+ try {
+ in = new PipedInputStream(out);
+ } catch (IOException e) {
+ throw new RuntimeException("Cannot export " + jcrPath + " in workspace " + jcrWorkspace, e);
+ }
ForkJoinPool.commonPool().execute(() -> {
- try (PipedOutputStream out = new PipedOutputStream(in)) {
+// try (PipedOutputStream out = new PipedOutputStream(in)) {
+ try {
provider.getJcrSession(getSession(), jcrWorkspace).exportDocumentView(jcrPath, out, true, false);
out.flush();
+ out.close();
} catch (IOException | RepositoryException e) {
throw new RuntimeException("Cannot export " + jcrPath + " in workspace " + jcrWorkspace, e);
}