- public void openFile(String fileName, InputStream is) {
-
- String prefix ="", extension = "";
-
- if (fileName != null){
- int ind = fileName.
- if (true){
- }
- }
-
- prefix = .substring(0,
- node.getName().lastIndexOf('.'));
- extension = node.getName().substring(
- node.getName().lastIndexOf('.'));
- try {
- Desktop desktop = null;
- if (Desktop.isDesktopSupported()) {
- desktop = Desktop.getDesktop();
- }
- desktop.open(file);
- } catch (IOException e) {
- throw new ArgeoException("Cannot open file " + file.getName(), e);
- }
+ private String createFullDownloadUrl(String fileName, String fileId) {
+ StringBuilder url = new StringBuilder();
+ // in case RAP is proxied we need to specify the actual base URL
+ // TODO find a cleaner way
+ String forcedDownloadUrlBase = System
+ .getProperty(FORCED_DOWNLOAD_URL_BASE_PROPERTY);
+ if (forcedDownloadUrlBase != null)
+ url.append(forcedDownloadUrlBase);
+ else
+ url.append(RWT.getRequest().getRequestURL());
+ url.append(createParamUrl(fileName, fileId));
+ return url.toString();