class GridFS[P <: SerializationPack with Singleton] extends AnyRef
- Alphabetic
- By Inheritance
- GridFS
- AnyRef
- Any
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- All
Instance Constructors
-
new
GridFS(db: DB with DBMetaCommands, prefix: String = "fs")(implicit producer: GenericCollectionProducer[P, GenericCollection[P]] = BSONCollectionProducer)
- db
The database where this store is located.
- prefix
The prefix of this store. The
filesandchunkscollections will be actually named${prefix}.filesand${prefix}.chunks.
Type Members
- type ReadFile[Id <: P.Value] = gridfs.ReadFile[P, Id]
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
- def +(other: String): String
- def ->[B](y: B): (GridFS[P], B)
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
val
chunks: GenericCollection[P]
The
chunkscollection -
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
def
defaultReadPreference: ReadPreference
- Annotations
- @inline()
-
def
ensureIndex()(implicit ec: ExecutionContext): Future[Boolean]
Creates the needed indexes on the GridFS collections (
chunksandfiles).Creates the needed indexes on the GridFS collections (
chunksandfiles).Please note that you should really consider reading http://www.mongodb.org/display/DOCS/Indexes before doing this, especially in production.
- returns
A future containing true if the index was created, false if it already exists.
- def ensuring(cond: (GridFS[P]) ⇒ Boolean, msg: ⇒ Any): GridFS[P]
- def ensuring(cond: (GridFS[P]) ⇒ Boolean): GridFS[P]
- def ensuring(cond: Boolean, msg: ⇒ Any): GridFS[P]
- def ensuring(cond: Boolean): GridFS[P]
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
val
files: GenericCollection[P]
The
filescollection -
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
find[S, T <: ReadFile[_]](selector: S)(implicit sWriter: P.Writer[S], readFileReader: P.Reader[T], ec: ExecutionContext, cp: CursorProducer[T]): ProducedCursor
Finds the files matching the given selector.
Finds the files matching the given selector.
- S
The type of the selector document. An implicit
Writer[S]must be in the scope.- selector
The document to select the files to return
- def formatted(fmtstr: String): String
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- val pack: collections.GenericCollection.pack.type
-
def
readToOutputStream[Id <: P.Value](file: ReadFile[Id], out: OutputStream)(implicit ec: ExecutionContext, idProducer: IdProducer[Id]): Future[Unit]
Reads the given file and writes its contents to the given OutputStream
-
def
remove[Id <: P.Value](id: Id)(implicit ec: ExecutionContext, idProducer: IdProducer[Id]): Future[WriteResult]
Removes a file from this store.
Removes a file from this store. Note that if the file does not actually exist, the returned future will not be hold an error.
- id
the file id to remove from this store
-
def
remove[Id <: P.Value](file: BasicMetadata[Id])(implicit ec: ExecutionContext, idProducer: IdProducer[Id]): Future[WriteResult]
Removes a file from this store.
Removes a file from this store. Note that if the file does not actually exist, the returned future will not be hold an error.
- file
the file entry to remove from this store
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- GridFS → AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
def
writeFromInputStream[Id <: P.Value](file: FileToSave[pack.type, Id], input: InputStream, chunkSize: Int = 262144)(implicit readFileReader: P.Reader[ReadFile[Id]], ec: ExecutionContext, idProducer: IdProducer[Id], docWriter: BSONDocumentWriter[P.Document]): Future[ReadFile[Id]]
Writes the data provided by the given InputStream to the given file.
- def →[B](y: B): (GridFS[P], B)
Deprecated Value Members
-
def
enumerate[Id <: P.Value](file: ReadFile[Id])(implicit ec: ExecutionContext, idProducer: IdProducer[Id]): Enumerator[Array[Byte]]
Produces an enumerator of chunks of bytes from the
chunkscollection matching the given file metadata.Produces an enumerator of chunks of bytes from the
chunkscollection matching the given file metadata.- file
the file to be read
- Annotations
- @deprecated
- Deprecated
(Since version 0.17.0) Will be moved to
reactivemongo.play.iteratees.GridFS
-
def
iteratee[Id <: P.Value](file: FileToSave[pack.type, Id], chunkSize: Int = 262144)(implicit readFileReader: P.Reader[ReadFile[Id]], ec: ExecutionContext, idProducer: IdProducer[Id], docWriter: BSONDocumentWriter[P.Document]): Iteratee[Array[Byte], Future[ReadFile[Id]]]
Returns an
Iterateethat will consume data to put into a GridFS store.Returns an
Iterateethat will consume data to put into a GridFS store.- Id
the type of the id of this file (generally
BSONObjectIDorBSONValue).- file
the metadata of the file to store.
- chunkSize
Size of the chunks. Defaults to 256kB.
- Annotations
- @deprecated
- Deprecated
(Since version 0.12.0) Use iterateeWithMD5
-
def
iterateeWithMD5[Id <: P.Value](file: FileToSave[pack.type, Id], chunkSize: Int = 262144)(implicit readFileReader: P.Reader[ReadFile[Id]], ec: ExecutionContext, idProducer: IdProducer[Id], docWriter: BSONDocumentWriter[P.Document]): Iteratee[Array[Byte], Future[ReadFile[Id]]]
Returns an
Iterateethat will consume data to put into a GridFS store, computing the MD5.Returns an
Iterateethat will consume data to put into a GridFS store, computing the MD5.- Id
the type of the id of this file (generally
BSONObjectIDorBSONValue).- file
the metadata of the file to store.
- chunkSize
Size of the chunks. Defaults to 256kB.
- Annotations
- @deprecated
- Deprecated
(Since version 0.12.0) Will be moved to
reactivemongo.play.iteratees.GridFS
-
def
save[Id <: P.Value](enumerator: Enumerator[Array[Byte]], file: FileToSave[pack.type, Id], chunkSize: Int = 262144)(implicit readFileReader: P.Reader[ReadFile[Id]], ec: ExecutionContext, idProducer: IdProducer[Id], docWriter: BSONDocumentWriter[P.Document]): Future[ReadFile[Id]]
Saves the content provided by the given enumerator with the given metadata.
Saves the content provided by the given enumerator with the given metadata.
- enumerator
Producer of content.
- file
Metadata of the file to store.
- chunkSize
Size of the chunks. Defaults to 256kB.
- returns
A future of a ReadFile[Id].
- Annotations
- @deprecated
- Deprecated
(Since version 0.17.0) Will be moved to
reactivemongo.play.iteratees.GridFS
-
def
saveWithMD5[Id <: P.Value](enumerator: Enumerator[Array[Byte]], file: FileToSave[pack.type, Id], chunkSize: Int = 262144)(implicit readFileReader: P.Reader[ReadFile[Id]], ec: ExecutionContext, idProducer: IdProducer[Id], docWriter: BSONDocumentWriter[P.Document]): Future[ReadFile[Id]]
Saves the content provided by the given enumerator with the given metadata, with the MD5 computed.
Saves the content provided by the given enumerator with the given metadata, with the MD5 computed.
- enumerator
Producer of content.
- file
Metadata of the file to store.
- chunkSize
Size of the chunks. Defaults to 256kB.
- returns
A future of a ReadFile[Id].
- Annotations
- @deprecated
- Deprecated
(Since version 0.17.0) Will be moved to
reactivemongo.play.iteratees.GridFS