Hi All, I have tried to create a filesystem using the Google Cloud Storage
API/SDK. But I can't seem to get it working. Does anyone have experience
with this? I have looked at the AWS s3 Bucket examples. But I have not been
able to make it work with the GCS. Please if anyone has some example or
projects where this is working I would love to get some inspiration to get
my code working. I just get this here error (can't really tell what that
mean): `/2019-02-07 15:13:39.875 DEBUG o.a.s.s.subsystem.sftp.SftpSubsystem
- doSendStatus(ServerSessionImpl[kasper@/127.0.0.1:55866])[id=1]
SSH_FXP_STATUS (substatus=SSH_FX_FAILURE, lang=, msg=General failure)/`If I
setup the code to use local filesystem everything works fine. When I setup
GCS I can access files on the filesystem, but it does not work together with
the FileSystemFactory. Here is the GoogleCloudStorage filesystem class I
have created: /import java.io.FileInputStreamimport java.net.URIimport
java.nio.charset.StandardCharsetsimport
org.apache.sshd.common.file.FileSystemFactoryimport
org.apache.sshd.common.session.Sessionimport java.nio.file.{FileSystem,
FileSystems, Files, Path}import java.nio.file.spi.FileSystemProviderimport
com.google.auth.oauth2.GoogleCredentialsimport
com.google.cloud.storage.contrib.nio.{CloudStorageConfiguration,
CloudStorageFileSystem}import com.google.cloud.storage.StorageOptionsimport
org.apache.sshd.common.file.virtualfs.VirtualFileSystemFactoryimport
org.apache.sshd.common.file.root.RootedFileSystemProviderclass
GCSFilesystemFactory(bucketName: String) extends FileSystemFactory {  
override def createFileSystem(session: Session): FileSystem = {   
FileSystemProvider.installedProviders().forEach(p => println(p.getScheme))   
val fs = FileSystems.getFileSystem(URI.create(""))    // This here works in
on the created filesystem    // val path: Path = fs.getPath("README.md")   
// Files.readAllLines(path, StandardCharsets.UTF_8).forEach(println)    fs 
}}/Thanks in advance. Br. Kasper



--
Sent from: 
http://apache-mina.10907.n7.nabble.com/Apache-MINA-User-Forum-f31345.html

Reply via email to