Class GcsSession

  • All Implemented Interfaces:
    Closeable, AutoCloseable, org.springframework.integration.file.remote.session.Session<BlobInfo>

    public class GcsSession
    extends Object
    implements org.springframework.integration.file.remote.session.Session<BlobInfo>
    A session implementation for Google Cloud Storage.
    • Constructor Detail

      • GcsSession

        public GcsSession​(Storage gcs)
    • Method Detail

      • remove

        public boolean remove​(String path)
                       throws IOException
        Specified by:
        remove in interface org.springframework.integration.file.remote.session.Session<BlobInfo>
        Throws:
        IOException
      • list

        public BlobInfo[] list​(String bucket)
                        throws IOException
        Only supports listing buckets, not folders.
        Specified by:
        list in interface org.springframework.integration.file.remote.session.Session<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.
      • mkdir

        public boolean mkdir​(String directory)
                      throws IOException
        Specified by:
        mkdir in interface org.springframework.integration.file.remote.session.Session<BlobInfo>
        Throws:
        IOException
      • rmdir

        public boolean rmdir​(String directory)
                      throws IOException
        Specified by:
        rmdir in interface org.springframework.integration.file.remote.session.Session<BlobInfo>
        Throws:
        IOException
      • rename

        public void rename​(String pathFrom,
                           String pathTo)
                    throws IOException
        Specified by:
        rename in interface org.springframework.integration.file.remote.session.Session<BlobInfo>
        Throws:
        IOException
      • close

        public void close()
        Specified by:
        close in interface AutoCloseable
        Specified by:
        close in interface Closeable
        Specified by:
        close in interface org.springframework.integration.file.remote.session.Session<BlobInfo>
      • isOpen

        public boolean isOpen()
        Specified by:
        isOpen in interface org.springframework.integration.file.remote.session.Session<BlobInfo>
      • exists

        public boolean exists​(String path)
                       throws IOException
        Specified by:
        exists in interface org.springframework.integration.file.remote.session.Session<BlobInfo>
        Throws:
        IOException
      • finalizeRaw

        public boolean finalizeRaw()
                            throws IOException
        Specified by:
        finalizeRaw in interface org.springframework.integration.file.remote.session.Session<BlobInfo>
        Throws:
        IOException
      • getClientInstance

        public Object getClientInstance()
        Specified by:
        getClientInstance in interface org.springframework.integration.file.remote.session.Session<BlobInfo>
      • getHostPort

        public String getHostPort()
        Specified by:
        getHostPort in interface org.springframework.integration.file.remote.session.Session<BlobInfo>