Package com.mongodb.client.gridfs
Class GridFSUploadStream
java.lang.Object
java.io.OutputStream
com.mongodb.client.gridfs.GridFSUploadStream
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
@NotThreadSafe
@Deprecated(since="2021-05-27")
public abstract class GridFSUploadStream
extends 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 -
Method Summary
Modifier and TypeMethodDescriptionabstract voidabort()Deprecated.Aborts the upload and deletes any data.abstract voidclose()Deprecated.voidflush()Deprecated.abstract ObjectIdDeprecated.usegetObjectId()instead.abstract BsonValuegetId()Deprecated.Gets theBsonValuefor the file to be uploadedabstract ObjectIdDeprecated.Gets theObjectIdfor the file to be uploaded or throws an error if an alternative BsonType has been used for the id.abstract voidwrite(byte[] b) Deprecated.abstract voidwrite(byte[] b, int off, int len) Deprecated.abstract voidwrite(int b) Deprecated.Methods inherited from class java.io.OutputStream
nullOutputStream
-
Constructor Details
-
GridFSUploadStream
public GridFSUploadStream()Deprecated.
-
-
Method Details
-
getFileId
Deprecated.usegetObjectId()instead.Gets theObjectIdfor the file to be uploaded Throws aMongoGridFSExceptionif the file id is not an ObjectId.- Returns:
- the ObjectId for the file to be uploaded
-
getObjectId
Deprecated.Gets theObjectIdfor 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
Deprecated.Gets theBsonValuefor 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:
writein classOutputStream
-
write
public abstract void write(byte[] b) Deprecated.- Overrides:
writein classOutputStream
-
write
public abstract void write(byte[] b, int off, int len) Deprecated.- Overrides:
writein classOutputStream
-
flush
public void flush()Deprecated.- Specified by:
flushin interfaceFlushable- Overrides:
flushin classOutputStream
-
close
public abstract void close()Deprecated.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classOutputStream
-