Class GridFSUploadStream

  • All Implemented Interfaces:
    java.io.Closeable, java.io.Flushable, java.lang.AutoCloseable

    @NotThreadSafe
    @Deprecated(since="2021-05-27")
    public abstract class GridFSUploadStream
    extends java.io.OutputStream
    Deprecated.
    Usage of this API is not supported in AEM as a Cloud Service.
    A GridFS OutputStream for uploading data into GridFS

    Provides the id for the file to be uploaded as well as the write methods of a OutputStream

    This implementation of a OutputStream will not throw IOExceptions. However, it will throw a MongoException if there is an error writing to MongoDB.

    Since:
    3.1
    • Constructor Summary

      Constructors 
      Constructor Description
      GridFSUploadStream()
      Deprecated.
       
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      abstract void abort()
      Deprecated.
      Aborts the upload and deletes any data.
      abstract void close()
      Deprecated.
       
      void flush()
      Deprecated.
       
      abstract ObjectId getFileId()
      Deprecated.
      use getObjectId() instead.
      abstract BsonValue getId()
      Deprecated.
      Gets the BsonValue for the file to be uploaded
      abstract ObjectId getObjectId()
      Deprecated.
      Gets the ObjectId for the file to be uploaded or throws an error if an alternative BsonType has been used for the id.
      abstract void write​(byte[] b)
      Deprecated.
       
      abstract void write​(byte[] b, int off, int len)
      Deprecated.
       
      abstract void write​(int b)
      Deprecated.
       
      • Methods inherited from class java.io.OutputStream

        nullOutputStream
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • GridFSUploadStream

        public GridFSUploadStream()
        Deprecated.
    • Method Detail

      • getFileId

        @Deprecated
        public abstract ObjectId getFileId()
        Deprecated.
        use getObjectId() instead.
        Gets the ObjectId for the file to be uploaded Throws a MongoGridFSException if the file id is not an ObjectId.
        Returns:
        the ObjectId for the file to be uploaded
      • getObjectId

        public abstract ObjectId getObjectId()
        Deprecated.
        Gets the ObjectId for the file to be uploaded or throws an error if an alternative BsonType has been used for the id. Throws a MongoGridFSException if the file id is not an ObjectId.
        Returns:
        the ObjectId for the file to be uploaded
      • getId

        public abstract BsonValue getId()
        Deprecated.
        Gets the BsonValue for the file to be uploaded
        Returns:
        the BsonValue for the file to be uploaded
      • abort

        public abstract void abort()
        Deprecated.
        Aborts the upload and deletes any data.
      • write

        public abstract void write​(int b)
        Deprecated.
        Specified by:
        write in class java.io.OutputStream
      • write

        public abstract void write​(byte[] b)
        Deprecated.
        Overrides:
        write in class java.io.OutputStream
      • write

        public abstract void write​(byte[] b,
                                   int off,
                                   int len)
        Deprecated.
        Overrides:
        write in class java.io.OutputStream
      • flush

        public void flush()
        Deprecated.
        Specified by:
        flush in interface java.io.Flushable
        Overrides:
        flush in class java.io.OutputStream
      • close

        public abstract void close()
        Deprecated.
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Overrides:
        close in class java.io.OutputStream