removed home library dependency

This commit is contained in:
Massimiliano Assante 2021-04-02 12:09:22 +02:00
parent 57e2c2ef00
commit 4f5c5ca847
2 changed files with 4 additions and 20 deletions

View File

@ -60,12 +60,6 @@
<version>${gwtVersion}</version> <version>${gwtVersion}</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </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> <dependency>
<groupId>com.google.gwt</groupId> <groupId>com.google.gwt</groupId>
<artifactId>gwt-dev</artifactId> <artifactId>gwt-dev</artifactId>

View File

@ -5,17 +5,12 @@ import java.io.FileInputStream;
import java.io.InputStream; import java.io.InputStream;
import java.util.UUID; 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.scope.api.ScopeProvider;
import org.gcube.common.storagehub.client.dsl.FileContainer; import org.gcube.common.storagehub.client.dsl.FileContainer;
import org.gcube.common.storagehub.client.dsl.FolderContainer; import org.gcube.common.storagehub.client.dsl.FolderContainer;
import org.gcube.common.storagehub.client.dsl.OpenResolver; import org.gcube.common.storagehub.client.dsl.OpenResolver;
import org.gcube.common.storagehub.client.dsl.StorageHubClient; 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.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.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -62,15 +57,10 @@ public class UploadToWorkspaceThread implements Runnable {
try { try {
String currContext = ScopeProvider.instance.get(); String currContext = ScopeProvider.instance.get();
StorageHubClient shc = new StorageHubClient(); StorageHubClient shc = new StorageHubClient();
_log.info("Trying to get VRE folder for scope="+currContext); _log.debug("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(); FolderContainer vreFolder = shc.openVREFolder();
_log.info("File to upload="+fileabsolutePathOnServer); _log.debug("File to upload="+fileabsolutePathOnServer);
File file = new File(fileabsolutePathOnServer); File file = new File(fileabsolutePathOnServer);
InputStream fileData = new FileInputStream(file); InputStream fileData = new FileInputStream(file);
FolderContainer attachmentFolder = null; FolderContainer attachmentFolder = null;
@ -79,12 +69,12 @@ public class UploadToWorkspaceThread implements Runnable {
attachmentFolder = oRes.asFolder(); attachmentFolder = oRes.asFolder();
} catch (StorageHubException e) { } catch (StorageHubException e) {
_log.info(ATTACHMENT_FOLDER + " in VRE Folder does not exists, creating it for "+currContext); _log.info(ATTACHMENT_FOLDER + " in VRE Folder does not exists, creating it for "+currContext);
vreFolder.newFolder(ATTACHMENT_FOLDER,"Folder created automatically by the System"); attachmentFolder = vreFolder.newFolder(ATTACHMENT_FOLDER,"Folder created automatically by the System");
} }
String itemName = getUniqueName(fileName); String itemName = getUniqueName(fileName);
FileContainer uploadedFile = attachmentFolder.uploadFile(fileData, itemName, "File shared by " + fullName + "("+username+")"); FileContainer uploadedFile = attachmentFolder.uploadFile(fileData, itemName, "File shared by " + fullName + "("+username+")");
_log.debug("Uploaded " + uploadedFile.get().getName() + " - Returned Workspace id=" + uploadedFile.getId()); _log.info("Uploaded " + uploadedFile.get().getName() + " - Returned Workspace id=" + uploadedFile.getId());
} }
catch (Exception e) { catch (Exception e) {
e.printStackTrace(); e.printStackTrace();