none
This commit is contained in:
parent
09dc6cf186
commit
57e2c2ef00
6
pom.xml
6
pom.xml
|
@ -60,6 +60,12 @@
|
|||
<version>${gwtVersion}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.gcube.portal</groupId>
|
||||
<artifactId>oidc-library-portal</artifactId>
|
||||
<version>[1.3.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.gwt</groupId>
|
||||
<artifactId>gwt-dev</artifactId>
|
||||
|
|
|
@ -5,6 +5,8 @@ import java.io.FileInputStream;
|
|||
import java.io.InputStream;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.gcube.common.authorization.library.provider.SecurityTokenProvider;
|
||||
import org.gcube.common.authorization.library.provider.UmaJWTProvider;
|
||||
import org.gcube.common.scope.api.ScopeProvider;
|
||||
import org.gcube.common.storagehub.client.dsl.FileContainer;
|
||||
import org.gcube.common.storagehub.client.dsl.FolderContainer;
|
||||
|
@ -12,6 +14,8 @@ import org.gcube.common.storagehub.client.dsl.OpenResolver;
|
|||
import org.gcube.common.storagehub.client.dsl.StorageHubClient;
|
||||
import org.gcube.common.storagehub.model.exceptions.InvalidItemException;
|
||||
import org.gcube.common.storagehub.model.exceptions.StorageHubException;
|
||||
import org.gcube.oidc.rest.JWTToken;
|
||||
import org.gcube.portal.oidc.lr62.OIDCUmaUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -56,24 +60,25 @@ public class UploadToWorkspaceThread implements Runnable {
|
|||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
String currScope = ScopeProvider.instance.get();
|
||||
|
||||
|
||||
String currContext = ScopeProvider.instance.get();
|
||||
StorageHubClient shc = new StorageHubClient();
|
||||
_log.info("Trying to get VRE folder for scope="+currScope);
|
||||
_log.info("Trying to get VRE folder for scope="+currContext);
|
||||
String umaToken = UmaJWTProvider.instance.get();
|
||||
System.out.println("\n\n\n UMA Token:");
|
||||
System.out.println(umaToken);
|
||||
System.out.println("\n\n\n END UMA Token");
|
||||
|
||||
FolderContainer vreFolder = shc.openVREFolder();
|
||||
|
||||
_log.info("File to upload="+fileabsolutePathOnServer);
|
||||
File file = new File(fileabsolutePathOnServer);
|
||||
InputStream fileData = new FileInputStream(file);
|
||||
|
||||
|
||||
FolderContainer attachmentFolder = null;
|
||||
try {
|
||||
OpenResolver oRes = vreFolder.openByRelativePath(ATTACHMENT_FOLDER);
|
||||
attachmentFolder = oRes.asFolder();
|
||||
} catch (StorageHubException e) {
|
||||
_log.info(ATTACHMENT_FOLDER + " in VRE Folder does not exists, creating it for "+currScope);
|
||||
_log.info(ATTACHMENT_FOLDER + " in VRE Folder does not exists, creating it for "+currContext);
|
||||
vreFolder.newFolder(ATTACHMENT_FOLDER,"Folder created automatically by the System");
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue