+ if (Source.class.isAssignableFrom(clss)) {
+// try {
+ PipedInputStream in = new PipedInputStream();
+
+ ForkJoinPool.commonPool().execute(() -> {
+ try (PipedOutputStream out = new PipedOutputStream(in)) {
+ provider.getJcrSession(session, jcrWorkspace).exportDocumentView(jcrPath, out, true, false);
+ out.flush();
+ } catch (IOException | RepositoryException e) {
+ throw new RuntimeException("Cannot export " + jcrPath + " in workspace " + jcrWorkspace, e);
+ }
+
+ });
+ return (A) new StreamSource(in);
+// } catch (IOException e) {
+// throw new RuntimeException("Cannot adapt " + JcrContent.this + " to " + clss, e);
+// }
+ } else
+
+ return super.adapt(clss);
+ }