This commit is contained in:
Lucio Lelii 2018-10-16 12:11:26 +00:00
parent f6b3253459
commit fdda6ce838
2 changed files with 16 additions and 16 deletions

View File

@ -196,10 +196,10 @@ public class InputsManager {
for (Map.Entry<String, List<String>> entry : map.entrySet()) {
String value = entry.getValue().toString();
if (value.toLowerCase().contains("filename=")){
LOGGER.debug("Searching in http header: found file name in header value "+value);
LOGGER.debug("Searching in http header: found file name in header value {}",value);
filename=value.substring(value.indexOf("=")+1);
filename=filename.replace("\"", "").replace("]", "");
LOGGER.debug("Searching in http header: retrieved file name "+filename);
LOGGER.debug("Searching in http header: retrieved file name {}",filename);
break;
}
}
@ -235,12 +235,11 @@ public class InputsManager {
String fileNameTemp = inputNameFromHttpHeader(subfilelink);
if (fileNameTemp==null)
fileName = inputName+"_[" + computationId + "]";
fileName = String.format("%s_(%s)",inputName, computationId);
else
fileName = fileNameTemp+ "_[" + computationId + "]."+FilenameUtils.getExtension(fileNameTemp);
LOGGER.debug("Retrieving remote input in file: " + fileName);
LOGGER.debug("Creating local temp file: " + fileName);
fileName = String.format("%s_(%s).%s",fileNameTemp, computationId, FilenameUtils.getExtension(fileNameTemp));
LOGGER.debug("Retrieving remote input in file: {}", fileName);
LOGGER.debug("Creating local temp file: {}", fileName);
File of = new File(config.getPersistencePath(), fileName);
FileOutputStream fos = new FileOutputStream(of);
IOUtils.copy(is, fos);
@ -249,7 +248,7 @@ public class InputsManager {
fos.close();
urlConnection.disconnect();
filesList.add(of);
LOGGER.debug("Created local file: " + of.getAbsolutePath());
LOGGER.debug("Created local file: {}", of.getAbsolutePath());
}
} else {
LOGGER.debug("Complex Input payload is the filelink");

View File

@ -172,7 +172,7 @@ public class DataspaceManager implements Runnable {
// LOGGER.debug("Dataspace->final file name on ws " + data.name+" description "+data.description);
LOGGER.debug("Dataspace->WS OP saving the following file on the WS " + filenameonwsString);
LinkedHashMap<String, String> properties = new LinkedHashMap<String, String>();
Map<String, Object> properties = new LinkedHashMap<String, Object>();
properties.put(computation_id, data.computationId);
properties.put(hostname, WPSConfig.getInstance().getWPSConfig().getServer().getHostname());
@ -186,9 +186,8 @@ public class DataspaceManager implements Runnable {
properties.put(payload, url);
FileContainer fileContainer = destinationFolder.uploadFile(in, filenameonwsString, data.description);
//TODO: add proprerty to file
//FolderItem fileItem = WorkspaceUtil.createExternalFile(wsFolder, filenameonwsString, data.description, in,properties,data.type,size);
//fileItem.getProperties().addProperties(properties);
fileContainer.setMetadata(new Metadata(properties));
LOGGER.debug("Dataspace->WS OP file saved on the WS " + filenameonwsString);
url = fileContainer.getPublicLink().toString();
@ -371,9 +370,11 @@ public class DataspaceManager implements Runnable {
} catch (Exception e) {
LOGGER.error("Dataspace->Failed creating ProvO XML file ",e);
}
//List<String> scopes = new ArrayList<String>();
//scopes.add(config.getGcubeScope());
//ws.createGcubeItem(computation.id, computation.operatorDescription, scopes, computation.user, itemType, properties, newcomputationFolder.getId());
/*
List<String> scopes = new ArrayList<String>();
scopes.add(config.getGcubeScope());
ws.createGcubeItem(computation.id, computation.operatorDescription, scopes, computation.user, itemType, properties, newcomputationFolder.getId());
*/
newcomputationFolder.setMetadata(new Metadata(properties));
@ -446,7 +447,7 @@ public class DataspaceManager implements Runnable {
gcubeItem.setDescription(computation.operatorDescription);
gcubeItem.setScopes(scopes.toArray(new String[scopes.size()]));
gcubeItem.setItemType(itemType);
gcubeItem.setProperty(new Metadata(properties));
gcubeItem.setPropertyMap(new Metadata(properties));
gcubeItem.setCreator(AuthorizationProvider.instance.get().getClient().getId());
computationsContainer.newGcubeItem(gcubeItem);