tabular-data-gwt-service/src/main/java/org/gcube/portlets/user/td/gxtservice/server/storage/FilesStorage.java

21 lines
729 B
Java

package org.gcube.portlets.user.td.gxtservice.server.storage;
import java.io.File;
import org.gcube.contentmanagement.blobstorage.service.IClient;
import org.gcube.contentmanager.storageclient.wrapper.AccessType;
import org.gcube.contentmanager.storageclient.wrapper.MemoryType;
import org.gcube.contentmanager.storageclient.wrapper.StorageClient;
public class FilesStorage {
public String storageCSVTempFile(String user, File file) {
IClient client = new StorageClient(user, AccessType.PUBLIC,
MemoryType.VOLATILE).getClient();
String remotePath = "/CSVimport/" + file.getName();
client.put(true).LFile(file.getAbsolutePath()).RFile(remotePath);
String url=client.getUrl().RFile(remotePath);
return url;
}
}