From 9f8f9e375c121d889c3428fee6715acaabc18d70 Mon Sep 17 00:00:00 2001 From: Lucio Lelii Date: Fri, 29 Nov 2024 10:59:46 +0100 Subject: [PATCH] updated --- CHANGELOG.md | 2 +- pom.xml | 238 +++++++++--------- .../access/storagehub/fs/StorageHubFS.java | 1 + .../data/access/storagehub/fuse/FuseTest.java | 17 +- 4 files changed, 132 insertions(+), 126 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f3dc57d..1bdb82d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm # Changelog for org.gcube.data-access.sh-fuse-integration -## [v2.1.0] +## [v2.1.0-SNAPSHOT] - porting to storagehub-client-2.0.0 diff --git a/pom.xml b/pom.xml index d0aa9b2..1194f79 100644 --- a/pom.xml +++ b/pom.xml @@ -1,127 +1,133 @@ - 4.0.0 - org.gcube.data-access - sh-fuse-integration - 2.1.0 - SHFuseIntegration + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + org.gcube.data-access + sh-fuse-integration + 2.1.0-SNAPSHOT + SHFuseIntegration - - maven-parent - org.gcube.tools - 1.2.0 - - + + maven-parent + org.gcube.tools + 1.2.0 + + - - scm:git:https://code-repo.d4science.org/gCubeSystem/sh-fuse-integration.git - scm:git:https://code-repo.d4science.org/gCubeSystem/sh-fuse-integration.git - https://code-repo.d4science.org/gCubeSystem/sh-fuse-integration - + + scm:git:https://code-repo.d4science.org/gCubeSystem/sh-fuse-integration.git + scm:git:https://code-repo.d4science.org/gCubeSystem/sh-fuse-integration.git + + https://code-repo.d4science.org/gCubeSystem/sh-fuse-integration + - - - central - bintray - https://jcenter.bintray.com - - + + 1.8 + 1.8 + - - - - org.gcube.distribution - gcube-bom - 2.4.1 - pom - import - - - + + + central + bintray + https://jcenter.bintray.com + + - - - com.github.serceman - jnr-fuse - 0.5.7 - - - org.gcube.common - gxJRS - + + + + org.gcube.distribution + gcube-bom + 2.4.1-SNAPSHOT + pom + import + + + - - org.gcube.common - common-authorization - + + + com.github.serceman + jnr-fuse + 0.5.8 + + + org.gcube.common + gxJRS + - - org.gcube.common - storagehub-client-library - - - org.gcube.common - storagehub-model - - - org.gcube.core - common-gcube-calls - - - org.cache2k - cache2k-jcache - 1.2.0.Final - - - org.slf4j - slf4j-api - + + org.gcube.common + common-authorization + - - junit - junit - 4.11 - test - - - ch.qos.logback - logback-classic - - + + org.gcube.common + storagehub-client-library + + + org.gcube.common + storagehub-model + + + org.gcube.core + common-gcube-calls + + + org.cache2k + cache2k-jcache + 1.2.0.Final + + + org.slf4j + slf4j-api + - - - - org.apache.maven.plugins - maven-assembly-plugin - - - package - - single - - - - - org.gcube.data.access.storagehub.fs.StorageHubFuseLauncher - - - - - jar-with-dependencies - - - - - - - maven-compiler-plugin - - 1.8 - 1.8 - - - - + + junit + junit + 4.11 + test + + + ch.qos.logback + logback-classic + + + + + + + org.apache.maven.plugins + maven-assembly-plugin + + + package + + single + + + + + org.gcube.data.access.storagehub.fs.StorageHubFuseLauncher + + + + + jar-with-dependencies + + + + + + + maven-compiler-plugin + + 1.8 + 1.8 + + + + \ No newline at end of file diff --git a/src/main/java/org/gcube/data/access/storagehub/fs/StorageHubFS.java b/src/main/java/org/gcube/data/access/storagehub/fs/StorageHubFS.java index 41d38d1..511fa36 100644 --- a/src/main/java/org/gcube/data/access/storagehub/fs/StorageHubFS.java +++ b/src/main/java/org/gcube/data/access/storagehub/fs/StorageHubFS.java @@ -11,6 +11,7 @@ import org.cache2k.Cache; import org.cache2k.Cache2kBuilder; import org.gcube.common.authorization.library.AuthorizedTasks; import org.gcube.common.authorization.library.provider.AccessTokenProvider; +import org.gcube.common.authorization.library.provider.SecurityTokenProvider; import org.gcube.common.scope.api.ScopeProvider; import org.gcube.common.storagehub.client.dsl.ContainerType; import org.gcube.common.storagehub.client.dsl.FileContainer; diff --git a/src/test/java/org/gcube/data/access/storagehub/fuse/FuseTest.java b/src/test/java/org/gcube/data/access/storagehub/fuse/FuseTest.java index b080282..edf6bdc 100644 --- a/src/test/java/org/gcube/data/access/storagehub/fuse/FuseTest.java +++ b/src/test/java/org/gcube/data/access/storagehub/fuse/FuseTest.java @@ -1,6 +1,7 @@ package org.gcube.data.access.storagehub.fuse; import java.nio.file.Paths; +import java.util.Objects; import org.gcube.data.access.storagehub.fs.StorageHubFS; import org.junit.Test; @@ -11,17 +12,15 @@ public class FuseTest { @Test public void mount() { - StorageHubFS memfs = new StorageHubFS("AccessToken","/gcube"); + StorageHubFS memfs = new StorageHubFS("eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJSSklZNEpoNF9qdDdvNmREY0NlUDFfS1l0akcxVExXVW9oMkQ2Tzk1bFNBIn0","/gcube"); try { String path; - switch (Platform.getNativePlatform().getOS()) { - case WINDOWS: - System.out.println("Im here"); - path = "J:\\"; - break; - default: - path = "/home/lucio/java/mnt"; - } + if (Objects.requireNonNull(Platform.getNativePlatform().getOS()) == Platform.OS.WINDOWS) { + System.out.println("Im here"); + path = "J:\\"; + } else + path = "/home/lucio/java/mnt"; + memfs.mount(Paths.get(path), true, true); } finally { memfs.umount();