Class GSFile

  • public class GSFile
    extends FileMetadata
    A Google Cloud Storage object represented by a local file in blobstore. Appendable versions of GSFiles have paths of the form /gs/writable:random?name=bucket%2fkey. Unfinalized bytes are stored in memory. Finalizing an object copies the bytes to a local blobstore file, which is accessible at /gs/bucket/key.
    • Field Detail


        public static final java.lang.String FILE_SYSTEM

        public static final java.lang.String CREATION_HANDLE_PREFIX
        See Also:
        Constant Field Values
    • Method Detail

      • buildWritablePath

        public static java.lang.String buildWritablePath(java.lang.String randomString,
                                                         java.lang.String fileName)
      • create

        public static FileMetadata create(LocalFileService localFileService,
                                          Clock clock,
                                          java.lang.String fileName,
                                          java.lang.String randomString,
                                          ContentType contentType,
                                          java.util.Map<java.lang.String,java.lang.String> parameters)
        Creates a new instance. There are two cases: 1) A create request 2) A read request for a special read-only file.
      • getBlobInfo

        public getBlobInfo()
        Specified by:
        getBlobInfo in class FileMetadata
        the BlobInfo of the file. File must have been finalized.
      • getOutputStream

        protected getOutputStream()
        Specified by:
        getOutputStream in class FileMetadata
      • getInputStream

        protected getInputStream()
        Specified by:
        getInputStream in class FileMetadata

Monitor your resources on the go

Get the Google Cloud Console app to help you manage your projects.

Send feedback about...

App Engine standard environment for Java