Compare commits
10 Commits
Author | SHA1 | Date |
---|---|---|
Giancarlo Panichi | d313488190 | |
Lucio Lelii | 4d1b592ef4 | |
Lucio Lelii | 25a9e4e474 | |
Lucio Lelii | 93c54c3524 | |
Lucio Lelii | 6183c78f6c | |
Lucio Lelii | 5564ce99eb | |
Lucio Lelii | ebe1845fb9 | |
Lucio Lelii | 8f136d8857 | |
Lucio Lelii | a6e686db55 | |
Lucio Lelii | 6c313286b9 |
|
@ -9,6 +9,7 @@
|
||||||
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
|
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
|
||||||
<attributes>
|
<attributes>
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
|
<attribute name="optional" value="true"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
</classpathentry>
|
</classpathentry>
|
||||||
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
|
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
|
||||||
|
@ -22,9 +23,10 @@
|
||||||
<attributes>
|
<attributes>
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
<attribute name="test" value="true"/>
|
<attribute name="test" value="true"/>
|
||||||
|
<attribute name="optional" value="true"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
</classpathentry>
|
</classpathentry>
|
||||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
|
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11">
|
||||||
<attributes>
|
<attributes>
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
eclipse.preferences.version=1
|
eclipse.preferences.version=1
|
||||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
|
org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
|
||||||
org.eclipse.jdt.core.compiler.compliance=1.8
|
org.eclipse.jdt.core.compiler.compliance=11
|
||||||
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
|
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
|
||||||
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
|
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
|
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
|
||||||
org.eclipse.jdt.core.compiler.release=disabled
|
org.eclipse.jdt.core.compiler.release=disabled
|
||||||
org.eclipse.jdt.core.compiler.source=1.8
|
org.eclipse.jdt.core.compiler.source=11
|
||||||
|
|
15
CHANGELOG.md
15
CHANGELOG.md
|
@ -2,22 +2,23 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
|
||||||
|
|
||||||
# Changelog for org.gcube.data-access.sh-fuse-integration
|
# Changelog for org.gcube.data-access.sh-fuse-integration
|
||||||
|
|
||||||
## [v2.0.0] 2021-05-19
|
## [v3.0.0]
|
||||||
|
|
||||||
### Feature
|
- porting to gcube-bom 4.0.0
|
||||||
|
|
||||||
|
## [v2.0.1] 2021-02-09
|
||||||
|
|
||||||
|
- all logs set to WARN [#22814]
|
||||||
|
|
||||||
|
## [v2.0.0] 2021-05-19
|
||||||
|
|
||||||
- porting to uma token [#21441]
|
- porting to uma token [#21441]
|
||||||
|
|
||||||
|
|
||||||
## [v1.1.1] 2021-01-15
|
## [v1.1.1] 2021-01-15
|
||||||
|
|
||||||
### Fixes
|
|
||||||
|
|
||||||
- issue on right displayed
|
- issue on right displayed
|
||||||
- [#20417]
|
- [#20417]
|
||||||
|
|
||||||
## [v1.1.0] 2020-09-07
|
## [v1.1.0] 2020-09-07
|
||||||
|
|
||||||
### Fixes
|
|
||||||
|
|
||||||
- Solved issue on data download [#19651]
|
- Solved issue on data download [#19651]
|
||||||
|
|
85
pom.xml
85
pom.xml
|
@ -4,22 +4,19 @@
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>org.gcube.data-access</groupId>
|
<groupId>org.gcube.data-access</groupId>
|
||||||
<artifactId>sh-fuse-integration</artifactId>
|
<artifactId>sh-fuse-integration</artifactId>
|
||||||
<version>2.0.0</version>
|
<version>3.0.0</version>
|
||||||
<name>SHFuseIntegration</name>
|
<name>SHFuseIntegration</name>
|
||||||
|
|
||||||
<parent>
|
<parent>
|
||||||
<artifactId>maven-parent</artifactId>
|
<artifactId>maven-parent</artifactId>
|
||||||
<groupId>org.gcube.tools</groupId>
|
<groupId>org.gcube.tools</groupId>
|
||||||
<version>1.1.0</version>
|
<version>1.2.0</version>
|
||||||
<relativePath />
|
<relativePath />
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<scm>
|
<scm>
|
||||||
<connection>scm:git:https://code-repo.d4science.org/gCubeSystem/sh-fuse-integration.git</connection>
|
<connection>scm:git:https://code-repo.d4science.org/gCubeSystem/sh-fuse-integration.git</connection>
|
||||||
<developerConnection>scm:git:https://code-repo.d4science.org/gCubeSystem/sh-fuse-integration.git</developerConnection>
|
<developerConnection>scm:git:https://code-repo.d4science.org/gCubeSystem/sh-fuse-integration.git</developerConnection>
|
||||||
<url>https://code-repo.d4science.org/gCubeSystem/sh-fuse-integration</url>
|
<url>https://code-repo.d4science.org/gCubeSystem/sh-fuse-integration</url>
|
||||||
</scm>
|
</scm>
|
||||||
|
|
||||||
<repositories>
|
<repositories>
|
||||||
<repository>
|
<repository>
|
||||||
<id>central</id>
|
<id>central</id>
|
||||||
|
@ -27,44 +24,46 @@
|
||||||
<url>https://jcenter.bintray.com</url>
|
<url>https://jcenter.bintray.com</url>
|
||||||
</repository>
|
</repository>
|
||||||
</repositories>
|
</repositories>
|
||||||
|
<properties>
|
||||||
|
<maven.compiler.source>17</maven.compiler.source>
|
||||||
|
<maven.compiler.target>17</maven.compiler.target>
|
||||||
|
</properties>
|
||||||
<dependencyManagement>
|
<dependencyManagement>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.distribution</groupId>
|
<groupId>org.gcube.distribution</groupId>
|
||||||
<artifactId>gcube-bom</artifactId>
|
<artifactId>gcube-bom</artifactId>
|
||||||
<version>2.0.1</version>
|
<version>4.0.0</version>
|
||||||
<type>pom</type>
|
<type>pom</type>
|
||||||
<scope>import</scope>
|
<scope>import</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</dependencyManagement>
|
</dependencyManagement>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.github.serceman</groupId>
|
<groupId>com.github.serceman</groupId>
|
||||||
<artifactId>jnr-fuse</artifactId>
|
<artifactId>jnr-fuse</artifactId>
|
||||||
<version>0.5.4</version>
|
<version>0.5.8</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.common</groupId>
|
<groupId>org.gcube.common</groupId>
|
||||||
<artifactId>gxJRS</artifactId>
|
<artifactId>gxJRS</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.common</groupId>
|
<groupId>org.gcube.common</groupId>
|
||||||
<artifactId>common-authorization</artifactId>
|
<artifactId>common-security</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.gcube.common.security</groupId>
|
||||||
|
<artifactId>gcube-secrets</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.common</groupId>
|
<groupId>org.gcube.common</groupId>
|
||||||
<artifactId>storagehub-client-library</artifactId>
|
<artifactId>storagehub-client-library</artifactId>
|
||||||
<version>[1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.common</groupId>
|
<groupId>org.gcube.common</groupId>
|
||||||
<artifactId>storagehub-model</artifactId>
|
<artifactId>storagehub-model</artifactId>
|
||||||
<version>[1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.core</groupId>
|
<groupId>org.gcube.core</groupId>
|
||||||
|
@ -79,7 +78,6 @@
|
||||||
<groupId>org.slf4j</groupId>
|
<groupId>org.slf4j</groupId>
|
||||||
<artifactId>slf4j-api</artifactId>
|
<artifactId>slf4j-api</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>junit</groupId>
|
<groupId>junit</groupId>
|
||||||
<artifactId>junit</artifactId>
|
<artifactId>junit</artifactId>
|
||||||
|
@ -91,39 +89,28 @@
|
||||||
<artifactId>logback-classic</artifactId>
|
<artifactId>logback-classic</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-assembly-plugin</artifactId>
|
<artifactId>maven-shade-plugin</artifactId>
|
||||||
<executions>
|
<version>3.4.1</version>
|
||||||
<execution>
|
<executions>
|
||||||
<phase>package</phase>
|
<execution>
|
||||||
<goals>
|
<phase>package</phase>
|
||||||
<goal>single</goal>
|
<goals>
|
||||||
</goals>
|
<goal>shade</goal>
|
||||||
<configuration>
|
</goals>
|
||||||
<archive>
|
<configuration>
|
||||||
<manifest>
|
<transformers>
|
||||||
<mainClass>org.gcube.data.access.storagehub.fs.StorageHubFuseLauncher
|
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
|
||||||
</mainClass>
|
<mainClass>org.gcube.data.access.storagehub.fs.StorageHubFuseLauncher</mainClass>
|
||||||
</manifest>
|
</transformer>
|
||||||
</archive>
|
</transformers>
|
||||||
<descriptorRefs>
|
</configuration>
|
||||||
<descriptorRef>jar-with-dependencies</descriptorRef>
|
</execution>
|
||||||
</descriptorRefs>
|
</executions>
|
||||||
</configuration>
|
</plugin>
|
||||||
</execution>
|
</plugins>
|
||||||
</executions>
|
</build>
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
|
||||||
<configuration>
|
|
||||||
<target>1.8</target>
|
|
||||||
<source>1.8</source>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
</build>
|
|
||||||
</project>
|
</project>
|
|
@ -33,9 +33,7 @@ public class PathUtils {
|
||||||
while (path.substring(path.length() - 1).equals("/")) {
|
while (path.substring(path.length() - 1).equals("/")) {
|
||||||
path = path.substring(0, path.length() - 1);
|
path = path.substring(0, path.length() - 1);
|
||||||
}
|
}
|
||||||
if (path.isEmpty()) {
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
return path.substring(path.lastIndexOf("/") + 1);
|
return path.substring(path.lastIndexOf("/") + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,9 +9,10 @@ import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
import org.cache2k.Cache;
|
import org.cache2k.Cache;
|
||||||
import org.cache2k.Cache2kBuilder;
|
import org.cache2k.Cache2kBuilder;
|
||||||
import org.gcube.common.authorization.library.AuthorizedTasks;
|
import org.gcube.common.security.AuthorizedTasks;
|
||||||
import org.gcube.common.authorization.library.provider.AccessTokenProvider;
|
import org.gcube.common.security.providers.SecretManagerProvider;
|
||||||
import org.gcube.common.scope.api.ScopeProvider;
|
import org.gcube.common.security.secrets.Secret;
|
||||||
|
import org.gcube.common.security.secrets.UmaTokenSecret;
|
||||||
import org.gcube.common.storagehub.client.dsl.ContainerType;
|
import org.gcube.common.storagehub.client.dsl.ContainerType;
|
||||||
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;
|
||||||
|
@ -43,9 +44,7 @@ public class StorageHubFS extends FuseStubFS {
|
||||||
|
|
||||||
StorageHubClient client;
|
StorageHubClient client;
|
||||||
|
|
||||||
String token;
|
Secret secret;
|
||||||
|
|
||||||
String scope;
|
|
||||||
|
|
||||||
HashMap<String, SHFile> tempFiles = new HashMap<>();
|
HashMap<String, SHFile> tempFiles = new HashMap<>();
|
||||||
|
|
||||||
|
@ -58,16 +57,15 @@ public class StorageHubFS extends FuseStubFS {
|
||||||
private FolderContainer rootDirectory;
|
private FolderContainer rootDirectory;
|
||||||
|
|
||||||
|
|
||||||
public StorageHubFS(String token, String scope) {
|
public StorageHubFS(String token) {
|
||||||
|
|
||||||
super();
|
super();
|
||||||
this.token = token;
|
this.secret = new UmaTokenSecret(token);
|
||||||
this.scope = scope;
|
|
||||||
|
|
||||||
logger.debug("using token {} in scope {}", token , scope);
|
logger.debug("using token {}", token);
|
||||||
|
|
||||||
|
SecretManagerProvider.set(secret);
|
||||||
|
|
||||||
ScopeProvider.instance.set(scope);
|
|
||||||
AccessTokenProvider.instance.set(token);
|
|
||||||
client = new StorageHubClient();
|
client = new StorageHubClient();
|
||||||
rootDirectory = client.getWSRoot();
|
rootDirectory = client.getWSRoot();
|
||||||
cache = new Cache2kBuilder<String, ItemContainer<Item>>() {}
|
cache = new Cache2kBuilder<String, ItemContainer<Item>>() {}
|
||||||
|
@ -83,9 +81,8 @@ public class StorageHubFS extends FuseStubFS {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public synchronized int write(String path, Pointer buf, long size, long offset, FuseFileInfo fi) {
|
public synchronized int write(String path, Pointer buf, long size, long offset, FuseFileInfo fi) {
|
||||||
ScopeProvider.instance.set(scope);
|
SecretManagerProvider.set(secret);
|
||||||
AccessTokenProvider.instance.set(token);
|
|
||||||
|
|
||||||
logger.trace("{}) calling write {} - {} ",Thread.currentThread().getName(), size , offset);
|
logger.trace("{}) calling write {} - {} ",Thread.currentThread().getName(), size , offset);
|
||||||
SHFile file = tempFiles.get(path);
|
SHFile file = tempFiles.get(path);
|
||||||
|
|
||||||
|
@ -112,8 +109,7 @@ public class StorageHubFS extends FuseStubFS {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public synchronized int create(final String path, @mode_t long mode, FuseFileInfo fi) {
|
public synchronized int create(final String path, @mode_t long mode, FuseFileInfo fi) {
|
||||||
ScopeProvider.instance.set(scope);
|
SecretManagerProvider.set(secret);
|
||||||
AccessTokenProvider.instance.set(token);
|
|
||||||
|
|
||||||
logger.trace(Thread.currentThread().getName()+" ) calling create "+path);
|
logger.trace(Thread.currentThread().getName()+" ) calling create "+path);
|
||||||
if (pathUtils.getPath(path) != null) {
|
if (pathUtils.getPath(path) != null) {
|
||||||
|
@ -165,8 +161,7 @@ public class StorageHubFS extends FuseStubFS {
|
||||||
@Override
|
@Override
|
||||||
public int getattr(String path, FileStat stat) {
|
public int getattr(String path, FileStat stat) {
|
||||||
|
|
||||||
ScopeProvider.instance.set(scope);
|
SecretManagerProvider.set(secret);
|
||||||
AccessTokenProvider.instance.set(token);
|
|
||||||
|
|
||||||
logger.trace(Thread.currentThread().getName()+" ) calling getattr "+path);
|
logger.trace(Thread.currentThread().getName()+" ) calling getattr "+path);
|
||||||
if (Objects.equals(path, "/") || path.contains("Trash") || path.equals("/"+VREFOLDERS_NAME)) {
|
if (Objects.equals(path, "/") || path.contains("Trash") || path.equals("/"+VREFOLDERS_NAME)) {
|
||||||
|
@ -228,9 +223,8 @@ public class StorageHubFS extends FuseStubFS {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int mkdir(String path, @mode_t long mode) {
|
public int mkdir(String path, @mode_t long mode) {
|
||||||
ScopeProvider.instance.set(scope);
|
SecretManagerProvider.set(secret);
|
||||||
AccessTokenProvider.instance.set(token);
|
|
||||||
|
|
||||||
logger.trace(Thread.currentThread().getName()+" ) calling mkdir");
|
logger.trace(Thread.currentThread().getName()+" ) calling mkdir");
|
||||||
|
|
||||||
ItemContainer<? extends Item> parentContainer;
|
ItemContainer<? extends Item> parentContainer;
|
||||||
|
@ -258,9 +252,8 @@ public class StorageHubFS extends FuseStubFS {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int read(String path, Pointer buf, @size_t long size, @off_t long offset, FuseFileInfo fi) {
|
public int read(String path, Pointer buf, @size_t long size, @off_t long offset, FuseFileInfo fi) {
|
||||||
ScopeProvider.instance.set(scope);
|
SecretManagerProvider.set(secret);
|
||||||
AccessTokenProvider.instance.set(token);
|
|
||||||
|
|
||||||
logger.trace("!!! read called in path {} with size {} and offset {} and pointer address {}",path, size, offset, buf.address());
|
logger.trace("!!! read called in path {} with size {} and offset {} and pointer address {}",path, size, offset, buf.address());
|
||||||
|
|
||||||
SHFile fileDownload = null;
|
SHFile fileDownload = null;
|
||||||
|
@ -326,9 +319,8 @@ public class StorageHubFS extends FuseStubFS {
|
||||||
@Override
|
@Override
|
||||||
public int readdir(String path, Pointer buf, FuseFillDir filter, @off_t long offset, FuseFileInfo fi) {
|
public int readdir(String path, Pointer buf, FuseFillDir filter, @off_t long offset, FuseFileInfo fi) {
|
||||||
logger.trace("readdir called");
|
logger.trace("readdir called");
|
||||||
ScopeProvider.instance.set(scope);
|
SecretManagerProvider.set(secret);
|
||||||
AccessTokenProvider.instance.set(token);
|
|
||||||
|
|
||||||
logger.trace(Thread.currentThread().getName()+" ) calling readdir "+path);
|
logger.trace(Thread.currentThread().getName()+" ) calling readdir "+path);
|
||||||
if (path.contains(".Trash")) return 0;
|
if (path.contains(".Trash")) return 0;
|
||||||
|
|
||||||
|
@ -419,9 +411,8 @@ public class StorageHubFS extends FuseStubFS {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int rename(String path, String newName) {
|
public int rename(String path, String newName) {
|
||||||
ScopeProvider.instance.set(scope);
|
SecretManagerProvider.set(secret);
|
||||||
AccessTokenProvider.instance.set(token);
|
|
||||||
|
|
||||||
ItemContainer<? extends Item> folder = pathUtils.getPath(path);
|
ItemContainer<? extends Item> folder = pathUtils.getPath(path);
|
||||||
if (folder == null) {
|
if (folder == null) {
|
||||||
return -ErrorCodes.ENOENT();
|
return -ErrorCodes.ENOENT();
|
||||||
|
@ -457,9 +448,8 @@ public class StorageHubFS extends FuseStubFS {
|
||||||
if (path.equals("/"+VREFOLDERS_NAME))
|
if (path.equals("/"+VREFOLDERS_NAME))
|
||||||
return -ErrorCodes.EACCES();
|
return -ErrorCodes.EACCES();
|
||||||
|
|
||||||
ScopeProvider.instance.set(scope);
|
SecretManagerProvider.set(secret);
|
||||||
AccessTokenProvider.instance.set(token);
|
|
||||||
|
|
||||||
ItemContainer<? extends Item> folder = pathUtils.getPath(path);
|
ItemContainer<? extends Item> folder = pathUtils.getPath(path);
|
||||||
if (folder == null) {
|
if (folder == null) {
|
||||||
return -ErrorCodes.ENOENT();
|
return -ErrorCodes.ENOENT();
|
||||||
|
@ -467,8 +457,9 @@ public class StorageHubFS extends FuseStubFS {
|
||||||
if (folder.getType()!=ContainerType.FOLDER) {
|
if (folder.getType()!=ContainerType.FOLDER) {
|
||||||
return -ErrorCodes.ENOTDIR();
|
return -ErrorCodes.ENOTDIR();
|
||||||
}
|
}
|
||||||
ScopeProvider.instance.set(scope);
|
|
||||||
AccessTokenProvider.instance.set(token);
|
SecretManagerProvider.set(secret);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
checkSpecialFolderRemove(path);
|
checkSpecialFolderRemove(path);
|
||||||
|
|
||||||
|
@ -496,9 +487,10 @@ public class StorageHubFS extends FuseStubFS {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int unlink(String path) {
|
public int unlink(String path) {
|
||||||
ScopeProvider.instance.set(scope);
|
|
||||||
AccessTokenProvider.instance.set(token);
|
SecretManagerProvider.set(secret);
|
||||||
|
|
||||||
|
|
||||||
ItemContainer<? extends Item> file = pathUtils.getPath(path);
|
ItemContainer<? extends Item> file = pathUtils.getPath(path);
|
||||||
if (file == null) {
|
if (file == null) {
|
||||||
return -ErrorCodes.ENOENT();
|
return -ErrorCodes.ENOENT();
|
||||||
|
@ -506,8 +498,9 @@ public class StorageHubFS extends FuseStubFS {
|
||||||
if (file.getType()!=ContainerType.FILE) {
|
if (file.getType()!=ContainerType.FILE) {
|
||||||
return -ErrorCodes.EISDIR();
|
return -ErrorCodes.EISDIR();
|
||||||
}
|
}
|
||||||
ScopeProvider.instance.set(scope);
|
|
||||||
AccessTokenProvider.instance.set(token);
|
SecretManagerProvider.set(secret);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
file.delete();
|
file.delete();
|
||||||
cache.remove(path);
|
cache.remove(path);
|
||||||
|
@ -542,8 +535,8 @@ public class StorageHubFS extends FuseStubFS {
|
||||||
public int truncate(String path, long size) {
|
public int truncate(String path, long size) {
|
||||||
logger.info("truncate called {} ",path);
|
logger.info("truncate called {} ",path);
|
||||||
|
|
||||||
ScopeProvider.instance.set(scope);
|
SecretManagerProvider.set(secret);
|
||||||
AccessTokenProvider.instance.set(token);
|
|
||||||
cache.remove(path);
|
cache.remove(path);
|
||||||
uploadFile(path);
|
uploadFile(path);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -7,10 +7,9 @@ public class StorageHubFuseLauncher {
|
||||||
|
|
||||||
public static void main(String ...args) {
|
public static void main(String ...args) {
|
||||||
String token = args[0];
|
String token = args[0];
|
||||||
String scope = args[1];
|
String path = args[1];
|
||||||
String path = args[2];
|
|
||||||
|
|
||||||
StorageHubFS shFS= new StorageHubFS(token, scope);
|
StorageHubFS shFS= new StorageHubFS(token);
|
||||||
shFS.mount(Paths.get(path), true, true);
|
shFS.mount(Paths.get(path), true, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,17 +1,20 @@
|
||||||
<configuration>
|
<configuration>
|
||||||
|
|
||||||
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
|
<appender name="FILE" class="ch.qos.logback.core.FileAppender">
|
||||||
<encoder>
|
<file>./fuse.log</file>
|
||||||
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{0}: %msg%n</pattern>
|
<append>true</append>
|
||||||
</encoder>
|
<encoder>
|
||||||
</appender>
|
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger: %msg%n
|
||||||
|
</pattern>
|
||||||
|
</encoder>
|
||||||
<logger name="org.gcube.data.access.storagehub.fs" level="TRACE" />
|
</appender>
|
||||||
<logger name="org.gcube" level="WARN" />
|
|
||||||
|
|
||||||
|
<logger name="org.gcube.data.access.storagehub.fs" level="INFO" />
|
||||||
|
<logger name="org.gcube" level="INFO" />
|
||||||
|
|
||||||
|
<root level="WARN">
|
||||||
|
<appender-ref ref="FILE" />
|
||||||
|
</root>
|
||||||
|
|
||||||
<root level="WARN">
|
|
||||||
<appender-ref ref="STDOUT" />
|
|
||||||
</root>
|
|
||||||
|
|
||||||
</configuration>
|
</configuration>
|
|
@ -11,7 +11,7 @@ public class FuseTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void mount() {
|
public void mount() {
|
||||||
StorageHubFS memfs = new StorageHubFS("AccessToken","/gcube");
|
StorageHubFS memfs = new StorageHubFS("");
|
||||||
try {
|
try {
|
||||||
String path;
|
String path;
|
||||||
switch (Platform.getNativePlatform().getOS()) {
|
switch (Platform.getNativePlatform().getOS()) {
|
||||||
|
@ -20,7 +20,7 @@ public class FuseTest {
|
||||||
path = "J:\\";
|
path = "J:\\";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
path = "/home/lucio/java/mnt";
|
path = "/Users/lucio/java/mnt";
|
||||||
}
|
}
|
||||||
memfs.mount(Paths.get(path), true, true);
|
memfs.mount(Paths.get(path), true, true);
|
||||||
} finally {
|
} finally {
|
||||||
|
|
Loading…
Reference in New Issue