- issue on right displayed
- https://support.d4science.org/issues/20417
This commit is contained in:
parent
6e934d7633
commit
8248bd6111
|
@ -2,6 +2,13 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
|
|||
|
||||
# Changelog for org.gcube.data-access.sh-fuse-integration
|
||||
|
||||
## [v1.1.1] 2021-01-15
|
||||
|
||||
### Fixes
|
||||
|
||||
- issue on right displayed
|
||||
- https://support.d4science.org/issues/20417
|
||||
|
||||
## [v1.1.0] 2020-09-07
|
||||
|
||||
### Fixes
|
||||
|
|
2
pom.xml
2
pom.xml
|
@ -4,7 +4,7 @@
|
|||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.gcube.data-access</groupId>
|
||||
<artifactId>sh-fuse-integration</artifactId>
|
||||
<version>1.1.0</version>
|
||||
<version>1.1.1</version>
|
||||
<name>SHFuseIntegration</name>
|
||||
|
||||
<parent>
|
||||
|
|
|
@ -34,11 +34,15 @@ public class FileDownload implements SHFile{
|
|||
while ((read=bi.read(buf))!=-1) {
|
||||
fo.write(buf, 0, read);
|
||||
}
|
||||
fo.flush();
|
||||
}
|
||||
|
||||
|
||||
|
||||
fileItem = fileContainer.get();
|
||||
logger.trace("FILE-DOWNLOAD with {} , {}", fileItem.getName(), fileItem.getContent().getSize());
|
||||
logger.trace("output name is {} ans length {}", output.getAbsolutePath(),output.length());
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -51,6 +55,7 @@ public class FileDownload implements SHFile{
|
|||
int readTotal= 0;
|
||||
try {
|
||||
raf = new RandomAccessFile(output, "r");
|
||||
raf.seek(offset);
|
||||
int read =0;
|
||||
logger.trace("{} BEFORE: bytes to read {} and read total {} and last read {}", fileItem.getName(), bytesToRead, readTotal, read);
|
||||
while ((read= raf.read(mybuf, 0 , bytesToRead-readTotal))!=-1 && bytesToRead>readTotal) {
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package org.gcube.data.access.storagehub.fs;
|
||||
|
||||
import java.awt.Container;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.List;
|
||||
|
||||
|
|
|
@ -1,19 +1,16 @@
|
|||
package org.gcube.data.access.storagehub.fs;
|
||||
|
||||
import java.io.RandomAccessFile;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Objects;
|
||||
import java.util.Random;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.cache2k.Cache;
|
||||
import org.cache2k.Cache2kBuilder;
|
||||
import org.gcube.common.authorization.library.AuthorizedTasks;
|
||||
import org.gcube.common.authorization.library.provider.SecurityTokenProvider;
|
||||
import org.gcube.common.gxrest.response.outbound.ErrorCode;
|
||||
import org.gcube.common.scope.api.ScopeProvider;
|
||||
import org.gcube.common.storagehub.client.dsl.ContainerType;
|
||||
import org.gcube.common.storagehub.client.dsl.FileContainer;
|
||||
|
@ -212,11 +209,8 @@ public class StorageHubFS extends FuseStubFS {
|
|||
|
||||
|
||||
private void setCommonAttributes(Item item, FileStat stat, int type) {
|
||||
if (item.isShared()) {
|
||||
stat.st_mode.set(type | FileStat.S_IROTH);
|
||||
}else {
|
||||
stat.st_mode.set(type | 0777);
|
||||
}
|
||||
|
||||
stat.st_mode.set(type | 0777);
|
||||
stat.st_mtim.tv_sec.set(item.getLastModificationTime().toInstant().getEpochSecond());
|
||||
stat.st_mtim.tv_nsec.set(item.getLastModificationTime().toInstant().getNano());
|
||||
stat.st_ctim.tv_sec.set(item.getLastModificationTime().toInstant().getEpochSecond());
|
||||
|
@ -258,7 +252,7 @@ public class StorageHubFS extends FuseStubFS {
|
|||
* @see ru.serce.jnrfuse.FuseStubFS#write(java.lang.String, jnr.ffi.Pointer, long, long, ru.serce.jnrfuse.struct.FuseFileInfo)
|
||||
*/
|
||||
@Override
|
||||
public int read(String path, Pointer buf, @size_t long size, @off_t long offset, FuseFileInfo fi) {
|
||||
public synchronized int read(String path, Pointer buf, @size_t long size, @off_t long offset, FuseFileInfo fi) {
|
||||
ScopeProvider.instance.set(scope);
|
||||
SecurityTokenProvider.instance.set(token);
|
||||
|
||||
|
@ -289,7 +283,7 @@ public class StorageHubFS extends FuseStubFS {
|
|||
synchronized (tempFiles) {
|
||||
|
||||
if (tempFiles.containsKey(path) && tempFiles.get(path) instanceof FileDownload) {
|
||||
logger.trace("path {} found in tmpFiles");
|
||||
logger.trace("path {} found in tmpFiles", path);
|
||||
fileDownload = tempFiles.get(path);
|
||||
} else {
|
||||
ItemContainer<? extends Item> item = pathUtils.getPath(path);
|
||||
|
@ -379,7 +373,7 @@ public class StorageHubFS extends FuseStubFS {
|
|||
cache.put(path+name, (ItemContainer<Item>) child);
|
||||
|
||||
}catch (Exception e) {
|
||||
logger.error("error riding children ",e);
|
||||
logger.error("error reading children ",e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@ public class FuseTest {
|
|||
String path;
|
||||
switch (Platform.getNativePlatform().getOS()) {
|
||||
case WINDOWS:
|
||||
System.out.println("Im here");
|
||||
path = "J:\\";
|
||||
break;
|
||||
default:
|
||||
|
|
Loading…
Reference in New Issue