- if (log.isDebugEnabled())
- log.debug("URL : "
- + createFullDownloadUrl(repoNodePath, repoUri,
- wkspName, filePath));
- // RWT.getResponse().sendRedirect(createFullDownloadUrl(repoNodePath,
- // repoUri,
- // wkspName, filePath));
-
- URL url = new URL(createFullDownloadUrl(repoNodePath, repoUri,
- wkspName, filePath));
+ businessSession = repoService.getRemoteSession(repoNodePath,
+ repoUri, wkspName);
+ Node result = businessSession.getNode(filePath);
+
+ // Create a temporary service. No better solution has been found
+ // yet.
+ currentServiceId = UUID.randomUUID().toString();
+ OpenJcrFileService ojfs = new OpenJcrFileService(result);
+ IServiceManager manager = RWT.getServiceManager();
+ manager.registerServiceHandler(currentServiceId, ojfs);
+ String urlStr = createFullDownloadUrl(currentServiceId);
+ URL url = new URL(urlStr);