|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.mongodb.gridfs.GridFSFile
public abstract class GridFSFile
The abstract class representing a GridFS file
| Field Summary | |
|---|---|
protected GridFS |
_fs
|
| Constructor Summary | |
|---|---|
GridFSFile()
|
|
| Method Summary | |
|---|---|
boolean |
containsField(String s)
Checks if this object contains a field with the given name. |
boolean |
containsKey(String s)
Deprecated. |
Object |
get(String key)
Gets a field from this object by a given name. |
List<String> |
getAliases()
Gets the aliases from the metadata. |
long |
getChunkSize()
Gets the size of a chunk |
String |
getContentType()
Gets the content type |
String |
getFilename()
Gets the filename |
Object |
getId()
Gets the id |
long |
getLength()
Gets the file's length |
String |
getMD5()
Gets the observed MD5 during transfer |
DBObject |
getMetaData()
Gets the file metadata |
Date |
getUploadDate()
Gets the upload date |
boolean |
isPartialObject()
whether markAsPartialObject was ever called only matters if you are going to upsert and do not want to risk losing fields |
Set<String> |
keySet()
Returns this object's fields' names |
void |
markAsPartialObject()
if this object was retrieved with only some fields (using a field filter) this method will be called to mark it as such. |
int |
numChunks()
Returns the number of chunks that store the file data |
Object |
put(String key,
Object v)
Sets a name/value pair in this object. |
void |
putAll(BSONObject o)
Sets all key/value pairs from an object into this object |
void |
putAll(Map m)
Sets all key/value pairs from a map into this object |
Object |
removeField(String key)
Removes a field with a given name from this object. |
void |
save()
Saves the file entry to the files collection |
protected void |
setGridFS(GridFS fs)
Sets the GridFS associated with this file |
void |
setMetaData(DBObject metadata)
Gets the file metadata |
Map |
toMap()
Returns a map representing this BSONObject. |
String |
toString()
|
void |
validate()
Verifies that the MD5 matches between the database and the local file. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected GridFS _fs
| Constructor Detail |
|---|
public GridFSFile()
| Method Detail |
|---|
public void save()
MongoExceptionpublic void validate()
MongoExceptionpublic int numChunks()
public Object getId()
public String getFilename()
public String getContentType()
public long getLength()
public long getChunkSize()
public Date getUploadDate()
public List<String> getAliases()
public DBObject getMetaData()
public void setMetaData(DBObject metadata)
public String getMD5()
public Object put(String key,
Object v)
BSONObject
put in interface BSONObjectkey - Name to setv - Corresponding value
public Object get(String key)
BSONObject
get in interface BSONObjectkey - The name of the field fetch
public void putAll(BSONObject o)
BSONObject
putAll in interface BSONObjecto - the objectpublic void putAll(Map m)
BSONObject
putAll in interface BSONObjectm - the mappublic Map toMap()
BSONObject
toMap in interface BSONObjectpublic Object removeField(String key)
BSONObject
removeField in interface BSONObjectkey - The name of the field to remove
@Deprecated public boolean containsKey(String s)
BSONObject
containsKey in interface BSONObjectpublic boolean containsField(String s)
BSONObject
containsField in interface BSONObjects - Field name for which to check
public Set<String> keySet()
BSONObject
keySet in interface BSONObjectpublic boolean isPartialObject()
DBObject
isPartialObject in interface DBObjectpublic void markAsPartialObject()
DBObject
markAsPartialObject in interface DBObjectpublic String toString()
toString in class Objectprotected void setGridFS(GridFS fs)
fs -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||