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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
append
(InputStream inputStream, String destination) void
close()
boolean
boolean
boolean
isOpen()
com.google.cloud.storage.BlobInfo[]
Only supports listing buckets, not folders.String[]
boolean
void
read
(String source, OutputStream outputStream) boolean
void
boolean
void
write
(InputStream inputStream, String destination) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:
remove
in interfaceorg.springframework.integration.file.remote.session.Session<com.google.cloud.storage.BlobInfo>
- Throws:
IOException
-
list
Only supports listing buckets, not folders.- Specified by:
list
in 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:
read
in interfaceorg.springframework.integration.file.remote.session.Session<com.google.cloud.storage.BlobInfo>
- Throws:
IOException
-
write
- Specified by:
write
in interfaceorg.springframework.integration.file.remote.session.Session<com.google.cloud.storage.BlobInfo>
- Throws:
IOException
-
append
- Specified by:
append
in interfaceorg.springframework.integration.file.remote.session.Session<com.google.cloud.storage.BlobInfo>
- Throws:
IOException
-
mkdir
- Specified by:
mkdir
in interfaceorg.springframework.integration.file.remote.session.Session<com.google.cloud.storage.BlobInfo>
- Throws:
IOException
-
rmdir
- Specified by:
rmdir
in interfaceorg.springframework.integration.file.remote.session.Session<com.google.cloud.storage.BlobInfo>
- Throws:
IOException
-
rename
- Specified by:
rename
in interfaceorg.springframework.integration.file.remote.session.Session<com.google.cloud.storage.BlobInfo>
- Throws:
IOException
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceorg.springframework.integration.file.remote.session.Session<com.google.cloud.storage.BlobInfo>
-
isOpen
public boolean isOpen()- Specified by:
isOpen
in interfaceorg.springframework.integration.file.remote.session.Session<com.google.cloud.storage.BlobInfo>
-
exists
- Specified by:
exists
in interfaceorg.springframework.integration.file.remote.session.Session<com.google.cloud.storage.BlobInfo>
- Throws:
IOException
-
listNames
- Specified by:
listNames
in interfaceorg.springframework.integration.file.remote.session.Session<com.google.cloud.storage.BlobInfo>
- Throws:
IOException
-
readRaw
- Specified by:
readRaw
in interfaceorg.springframework.integration.file.remote.session.Session<com.google.cloud.storage.BlobInfo>
- Throws:
IOException
-
finalizeRaw
- Specified by:
finalizeRaw
in interfaceorg.springframework.integration.file.remote.session.Session<com.google.cloud.storage.BlobInfo>
- Throws:
IOException
-
getClientInstance
- Specified by:
getClientInstance
in interfaceorg.springframework.integration.file.remote.session.Session<com.google.cloud.storage.BlobInfo>
-
getHostPort
- Specified by:
getHostPort
in interfaceorg.springframework.integration.file.remote.session.Session<com.google.cloud.storage.BlobInfo>
-