From 493187a0aa88a7bebcad6ba7c79189e25356d97a Mon Sep 17 00:00:00 2001 From: Giancarlo Panichi Date: Tue, 3 Mar 2015 11:05:34 +0000 Subject: [PATCH] Fixed external file open in resources git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-gwt-service@112304 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../gwtservice/server/TDGWTServiceImpl.java | 1 + .../server/storage/FilesStorage.java | 2 +- .../uriresolver/UriResolverSession.java | 26 +++++++++++++++++-- 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/gcube/portlets/user/td/gwtservice/server/TDGWTServiceImpl.java b/src/main/java/org/gcube/portlets/user/td/gwtservice/server/TDGWTServiceImpl.java index eb4b1f8..fb0b5a1 100644 --- a/src/main/java/org/gcube/portlets/user/td/gwtservice/server/TDGWTServiceImpl.java +++ b/src/main/java/org/gcube/portlets/user/td/gwtservice/server/TDGWTServiceImpl.java @@ -8573,6 +8573,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements resolver = new UriResolverManager(uriResolverSession .getApplicationType().toString()); params.put("smp-uri", uriResolverSession.getUuid()); + params.put("fileName", uriResolverSession.getFileName()); logger.debug("Uri Resolver params: " + params); link = resolver.getLink(params, true); // true, link is shorted // otherwise none diff --git a/src/main/java/org/gcube/portlets/user/td/gwtservice/server/storage/FilesStorage.java b/src/main/java/org/gcube/portlets/user/td/gwtservice/server/storage/FilesStorage.java index 55c567a..9fd910b 100644 --- a/src/main/java/org/gcube/portlets/user/td/gwtservice/server/storage/FilesStorage.java +++ b/src/main/java/org/gcube/portlets/user/td/gwtservice/server/storage/FilesStorage.java @@ -35,7 +35,7 @@ public class FilesStorage { public static final Logger logger = LoggerFactory .getLogger(FilesStorage.class); - + public String storageCSVTempFile(String user, File file) { String url = null; try { diff --git a/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/uriresolver/UriResolverSession.java b/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/uriresolver/UriResolverSession.java index 508ba18..28afa77 100644 --- a/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/uriresolver/UriResolverSession.java +++ b/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/uriresolver/UriResolverSession.java @@ -16,7 +16,8 @@ public class UriResolverSession implements Serializable { private String uuid; private ApplicationType applicationType; - + private String fileName; + public UriResolverSession() { super(); } @@ -25,6 +26,17 @@ public class UriResolverSession implements Serializable { super(); this.uuid = uuid; this.applicationType = applicationType; + this.fileName=null; + } + + + + public UriResolverSession(String uuid, ApplicationType applicationType, + String fileName) { + super(); + this.uuid = uuid; + this.applicationType = applicationType; + this.fileName = fileName; } public String getUuid() { @@ -42,11 +54,21 @@ public class UriResolverSession implements Serializable { public void setApplicationType(ApplicationType applicationType) { this.applicationType = applicationType; } + + + public String getFileName() { + return fileName; + } + + public void setFileName(String fileName) { + this.fileName = fileName; + } @Override public String toString() { return "UriResolverSession [uuid=" + uuid + ", applicationType=" - + applicationType + "]"; + + applicationType + ", fileName=" + fileName + "]"; } + }