FileMetadata

com.google.appengine.api.files.dev

Class FileMetadata

  • java.lang.Object
    • com.google.appengine.api.files.dev.FileMetadata
  • Direct Known Subclasses:
    BlobstoreFile, GSFile


    public abstract class FileMetadata
    extends java.lang.Object
    This class represents a single file stored by the local file service. This class is abstract. There are concrete subclasses corresponding to each of the concrete backend storage repositories.
    • Field Detail

      • contentType

        protected ContentType contentType
      • finalized

        protected boolean finalized
      • readName

        protected final java.lang.String readName
        The name of the readable version of this file once it is finalized.
      • appendName

        protected final java.lang.String appendName
        The name of the appendable version of this unfinalized file.
      • currentSequenceKey

        protected java.lang.String currentSequenceKey
        If this instance is for writing and it has not yet been finalized, then this variable stores the current sequence key
      • tempBytes

        protected java.io.ByteArrayOutputStream tempBytes
        If this instance is for writing and it has not yet been finalized, then this variable stores the current bytes. These bytes will be copied to the remote file during finalization.
      • tempBytesSizeWhenFinalized

        protected int tempBytesSizeWhenFinalized
    • Constructor Detail

      • FileMetadata

        public FileMetadata(java.lang.String readName,
                            java.lang.String appendName,
                            ContentType contentType)
    • Method Detail

      • getTempBytesSize

        protected final int getTempBytesSize()
      • getAppendName

        public java.lang.String getAppendName()
      • setFinalized

        public void setFinalized()
      • getBlobInfo

        public abstract com.google.appengine.api.blobstore.BlobInfo getBlobInfo()
        Returns:
        the BlobInfo of the file. File must have been finalized.
        Throws:
        {@link - IllegalStateException} if file is not finalized.
        {@link - com.google.apphosting.api.ApiProxy.ApplicationException} if the blobInfo can't be found for any other reasons.
      • isFinalized

        public boolean isFinalized()
      • getContentType

        public ContentType getContentType()
      • lock

        public void lock(