Skip to content
Snippets Groups Projects
Commit cd0ed509 authored by juanf's avatar juanf
Browse files

SP-1115 / BIS-627 : ELN UI : Implement data set upload, ongoing work.

SVN: 30355
parent 35176001
No related branches found
No related tags found
No related merge requests found
......@@ -65,14 +65,18 @@ def insertDataSet(tr, parameters, tableBuilder):
dataSet.setPropertyValue(key,propertyValue);
#Move File
tempDir = System.getProperty("java.io.tmpdir");
temFile = File(tempDir + filename);
dss_component = DssComponentFactory.tryCreate(parameters.get("sessionID"), parameters.get("openBISURL"));
inputStream = dss_component.getFileFromSessionWorkspace(fileSessionKey);
rawFile = IOUtils.toByteArray(inputStream);
tempDir = System.getProperty("java.io.tmpdir");
file = File(tempDir + filename);
FileOutputStream(file).write(rawFile);
print file.getAbsolutePath();
tr.moveFile(file.getAbsolutePath(), dataSet);
outputStream = FileOutputStream(temFile);
IOUtils.copyLarge(inputStream, outputStream);
IOUtils.closeQuietly(inputStream);
IOUtils.closeQuietly(outputStream);
tr.moveFile(temFile.getAbsolutePath(), dataSet);
#Clean File from workspace
dss_component.deleteSessionWorkspaceFile(fileSessionKey);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment