Package com.mongodb.gridfs
Class GridFSFile
java.lang.Object
com.mongodb.gridfs.GridFSFile
- All Implemented Interfaces:
DBObject
,BSONObject
- Direct Known Subclasses:
GridFSDBFile
,GridFSInputFile
Deprecated.
Usage of this API is not supported in AEM as a Cloud Service.
The abstract class representing a GridFS file.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Deprecated.Checks if this object contains a field with the given name.boolean
containsKey
(String key) Deprecated.Deprecated.Gets a field from this object by a given name.Deprecated.Gets the aliases from the metadata.long
Deprecated.Gets the size of a chunk.Deprecated.Gets the content type.Deprecated.Gets the filename.getId()
Deprecated.Gets the id.long
Deprecated.Gets the file's length.getMD5()
Deprecated.there is no replacement for this methodDeprecated.Gets the file metadata.Deprecated.Gets the upload date.boolean
Deprecated.WhetherDBObject.markAsPartialObject()
was ever called only matters if you are going to upsert and do not want to risk losing fields.keySet()
Deprecated.Returns this object's fields' namesvoid
Deprecated.If this object was retrieved with only some fields (using a field filter) this method will be called to mark it as such.int
Deprecated.Returns the number of chunks that store the file data.Deprecated.Sets a name/value pair in this object.void
Deprecated.Sets all key/value pairs from a map into this objectvoid
putAll
(BSONObject o) Deprecated.Sets all key/value pairs from an object into this objectremoveField
(String key) Deprecated.Removes a field with a given name from this object.void
save()
Deprecated.Saves the file entry to the files collectionvoid
setMetaData
(DBObject metadata) Deprecated.Gets the file metadata.Map
<?, ?> toMap()
Deprecated.Returns a map representing this BSONObject.toString()
Deprecated.void
validate()
Deprecated.there is no replacement for this method
-
Constructor Details
-
GridFSFile
public GridFSFile()Deprecated.
-
-
Method Details
-
save
public void save()Deprecated.Saves the file entry to the files collection- Throws:
MongoException
- if there's a failure
-
validate
Deprecated.there is no replacement for this methodVerifies that the MD5 matches between the database and the local file. This should be called after transferring a file.- Throws:
MongoException
- if there's a failure
-
numChunks
public int numChunks()Deprecated.Returns the number of chunks that store the file data.- Returns:
- number of chunks
-
getId
Deprecated.Gets the id.- Returns:
- the id of the file.
-
getFilename
Deprecated.Gets the filename.- Returns:
- the name of the file
-
getContentType
Deprecated.Gets the content type.- Returns:
- the content type
-
getLength
public long getLength()Deprecated.Gets the file's length.- Returns:
- the length of the file
-
getChunkSize
public long getChunkSize()Deprecated.Gets the size of a chunk.- Returns:
- the chunkSize
-
getUploadDate
Deprecated.Gets the upload date.- Returns:
- the date
-
getAliases
Deprecated.Gets the aliases from the metadata. note: to set aliases, callput(String, Object)
with"aliases" , List<String>
.- Returns:
- list of aliases
-
getMetaData
Deprecated.Gets the file metadata.- Returns:
- the metadata
-
setMetaData
Deprecated.Gets the file metadata.- Parameters:
metadata
- metadata to be set
-
getMD5
Deprecated.there is no replacement for this methodGets the observed MD5 during transfer- Returns:
- md5
-
put
Deprecated.Description copied from interface:BSONObject
Sets a name/value pair in this object.- Specified by:
put
in interfaceBSONObject
- Parameters:
key
- Name to setv
- Corresponding value- Returns:
- the previous value associated with
key
, ornull
if there was no mapping forkey
. (Anull
return can also indicate that the map previously associatednull
withkey
.)
-
get
Deprecated.Description copied from interface:BSONObject
Gets a field from this object by a given name.- Specified by:
get
in interfaceBSONObject
- Parameters:
key
- The name of the field fetch- Returns:
- The field, if found
-
containsKey
Deprecated.Description copied from interface:BSONObject
Deprecated- Specified by:
containsKey
in interfaceBSONObject
- Parameters:
key
- the key to check- Returns:
- True if the key is present
-
containsField
Deprecated.Description copied from interface:BSONObject
Checks if this object contains a field with the given name.- Specified by:
containsField
in interfaceBSONObject
- Parameters:
s
- Field name for which to check- Returns:
- True if the field is present
-
keySet
Deprecated.Description copied from interface:BSONObject
Returns this object's fields' names- Specified by:
keySet
in interfaceBSONObject
- Returns:
- The names of the fields in this object
-
isPartialObject
public boolean isPartialObject()Deprecated.Description copied from interface:DBObject
WhetherDBObject.markAsPartialObject()
was ever called only matters if you are going to upsert and do not want to risk losing fields.- Specified by:
isPartialObject
in interfaceDBObject
- Returns:
- true if this has been marked as a partial object
-
markAsPartialObject
public void markAsPartialObject()Deprecated.Description copied from interface:DBObject
If this object was retrieved with only some fields (using a field filter) this method will be called to mark it as such.- Specified by:
markAsPartialObject
in interfaceDBObject
-
toString
Deprecated. -
putAll
Deprecated.Description copied from interface:BSONObject
Sets all key/value pairs from an object into this object- Specified by:
putAll
in interfaceBSONObject
- Parameters:
o
- the object
-
putAll
Deprecated.Description copied from interface:BSONObject
Sets all key/value pairs from a map into this object- Specified by:
putAll
in interfaceBSONObject
- Parameters:
m
- the map
-
toMap
Deprecated.Description copied from interface:BSONObject
Returns a map representing this BSONObject.- Specified by:
toMap
in interfaceBSONObject
- Returns:
- the map
-
removeField
Deprecated.Description copied from interface:BSONObject
Removes a field with a given name from this object.- Specified by:
removeField
in interfaceBSONObject
- Parameters:
key
- The name of the field to remove- Returns:
- The value removed from this object
-