1298: Workspace: Update public link generation

Task-Url: https://support.d4science.org/issues/1298

Fixed id to resolve storage file

git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/data-transfer/uri-resolver@122323 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2016-01-19 16:46:07 +00:00
parent 8812454b52
commit 9e2f1f0798
1 changed files with 3 additions and 2 deletions

View File

@ -88,7 +88,7 @@ public class StorageIDResolver extends HttpServlet {
//we should not unescape the filename with spaces //we should not unescape the filename with spaces
logger.debug(SMP_ID+" = "+ smpID); logger.info(SMP_ID+" = "+ smpID);
InputStream in = null; InputStream in = null;
try { try {
@ -98,9 +98,10 @@ public class StorageIDResolver extends HttpServlet {
StorageClient client = new StorageClient(StorageIDResolver.class.getName(), StorageIDResolver.class.getSimpleName(), StorageIDResolver.class.getName(), AccessType.PUBLIC); StorageClient client = new StorageClient(StorageIDResolver.class.getName(), StorageIDResolver.class.getSimpleName(), StorageIDResolver.class.getName(), AccessType.PUBLIC);
IClient icClient = client.getClient(); IClient icClient = client.getClient();
String toSEID = icClient.getId(smpID); //to Storage Encrypted ID String toSEID = icClient.getId(smpID); //to Storage Encrypted ID
logger.debug("Decoded ID"+" = "+ toSEID);
in=icClient.get().RFileAsInputStream(toSEID); //input stream in=icClient.get().RFileAsInputStream(toSEID); //input stream
MyFile file = client.getClient().getMetaFile().RFile(smpID); MyFile file = client.getClient().getMetaFile().RFile(toSEID);
logger.debug("MetaFile retrieved from storage? "+ (file!=null)); logger.debug("MetaFile retrieved from storage? "+ (file!=null));
if(fileName==null || fileName.isEmpty()){ //filename if(fileName==null || fileName.isEmpty()){ //filename