Package com.mongodb.client.gridfs
Class GridFSUploadStream
- java.lang.Object
-
- java.io.OutputStream
-
- com.mongodb.client.gridfs.GridFSUploadStream
-
- All Implemented Interfaces:
java.io.Closeable,java.io.Flushable,java.lang.AutoCloseable
@NotThreadSafe @Deprecated public abstract class GridFSUploadStream extends java.io.OutputStream
Deprecated.Usage of this API is not supported in Cloud Service.A GridFS OutputStream for uploading data into GridFSProvides the
idfor the file to be uploaded as well as thewritemethods of aOutputStreamThis implementation of a
OutputStreamwill not throwIOExceptions. However, it will throw aMongoExceptionif 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 voidabort()Deprecated.Aborts the upload and deletes any data.abstract voidclose()Deprecated.voidflush()Deprecated.abstract ObjectIdgetFileId()Deprecated.usegetObjectId()instead.abstract BsonValuegetId()Deprecated.Gets theBsonValuefor the file to be uploadedabstract ObjectIdgetObjectId()Deprecated.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.
-
-
-
Method Detail
-
getFileId
@Deprecated public abstract ObjectId 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
public abstract ObjectId 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
public abstract BsonValue 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 classjava.io.OutputStream
-
write
public abstract void write(byte[] b)
Deprecated.- Overrides:
writein classjava.io.OutputStream
-
write
public abstract void write(byte[] b, int off, int len)Deprecated.- Overrides:
writein classjava.io.OutputStream
-
flush
public void flush()
Deprecated.- Specified by:
flushin interfacejava.io.Flushable- Overrides:
flushin classjava.io.OutputStream
-
close
public abstract void close()
Deprecated.- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classjava.io.OutputStream
-
-