Class GcsSession
java.lang.Object
com.google.cloud.spring.storage.integration.GcsSession
- All Implemented Interfaces:
Closeable,AutoCloseable,org.springframework.integration.file.remote.session.Session<com.google.cloud.storage.BlobInfo>
public class GcsSession
extends Object
implements org.springframework.integration.file.remote.session.Session<com.google.cloud.storage.BlobInfo>
A session implementation for Google Cloud Storage.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidappend(InputStream inputStream, String destination) voidclose()booleanbooleanbooleanisOpen()com.google.cloud.storage.BlobInfo[]Only supports listing buckets, not folders.String[]booleanvoidread(String source, OutputStream outputStream) booleanvoidbooleanvoidwrite(InputStream inputStream, String destination) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.integration.file.remote.session.Session
dirty, test
-
Constructor Details
-
GcsSession
public GcsSession(com.google.cloud.storage.Storage gcs)
-
-
Method Details
-
remove
- Specified by:
removein interfaceorg.springframework.integration.file.remote.session.Session<com.google.cloud.storage.BlobInfo>- Throws:
IOException
-
list
Only supports listing buckets, not folders.- Specified by:
listin interfaceorg.springframework.integration.file.remote.session.Session<com.google.cloud.storage.BlobInfo>- Parameters:
bucket- The name of the bucket.- Returns:
- The BlobInfo of all objects in the bucket.
- Throws:
IOException- Thrown if there an issue communicating with GCS.
-
read
- Specified by:
readin interfaceorg.springframework.integration.file.remote.session.Session<com.google.cloud.storage.BlobInfo>- Throws:
IOException
-
write
- Specified by:
writein interfaceorg.springframework.integration.file.remote.session.Session<com.google.cloud.storage.BlobInfo>- Throws:
IOException
-
append
- Specified by:
appendin interfaceorg.springframework.integration.file.remote.session.Session<com.google.cloud.storage.BlobInfo>- Throws:
IOException
-
mkdir
- Specified by:
mkdirin interfaceorg.springframework.integration.file.remote.session.Session<com.google.cloud.storage.BlobInfo>- Throws:
IOException
-
rmdir
- Specified by:
rmdirin interfaceorg.springframework.integration.file.remote.session.Session<com.google.cloud.storage.BlobInfo>- Throws:
IOException
-
rename
- Specified by:
renamein interfaceorg.springframework.integration.file.remote.session.Session<com.google.cloud.storage.BlobInfo>- Throws:
IOException
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceorg.springframework.integration.file.remote.session.Session<com.google.cloud.storage.BlobInfo>
-
isOpen
public boolean isOpen()- Specified by:
isOpenin interfaceorg.springframework.integration.file.remote.session.Session<com.google.cloud.storage.BlobInfo>
-
exists
- Specified by:
existsin interfaceorg.springframework.integration.file.remote.session.Session<com.google.cloud.storage.BlobInfo>- Throws:
IOException
-
listNames
- Specified by:
listNamesin interfaceorg.springframework.integration.file.remote.session.Session<com.google.cloud.storage.BlobInfo>- Throws:
IOException
-
readRaw
- Specified by:
readRawin interfaceorg.springframework.integration.file.remote.session.Session<com.google.cloud.storage.BlobInfo>- Throws:
IOException
-
finalizeRaw
- Specified by:
finalizeRawin interfaceorg.springframework.integration.file.remote.session.Session<com.google.cloud.storage.BlobInfo>- Throws:
IOException
-
getClientInstance
- Specified by:
getClientInstancein interfaceorg.springframework.integration.file.remote.session.Session<com.google.cloud.storage.BlobInfo>
-
getHostPort
- Specified by:
getHostPortin interfaceorg.springframework.integration.file.remote.session.Session<com.google.cloud.storage.BlobInfo>
-