public final class GridFSFile
extends java.lang.Object
| 构造器和说明 |
|---|
GridFSFile(BsonValue id,
java.lang.String filename,
long length,
int chunkSize,
java.util.Date uploadDate,
java.lang.String md5,
Document metadata)
Creates a new GridFSFile
|
GridFSFile(BsonValue id,
java.lang.String filename,
long length,
int chunkSize,
java.util.Date uploadDate,
java.lang.String md5,
Document metadata,
Document extraElements)
Creates a legacy implementation of the GridFSFile
For GridFS files created in older versions of the driver.
|
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
equals(java.lang.Object o) |
java.util.List<java.lang.String> |
getAliases()
已过时。
aliases should be stored in the metadata document.
|
int |
getChunkSize()
The size, in bytes, of each data chunk of this file
|
java.lang.String |
getContentType()
已过时。
content type information stored in the metadata document.
|
Document |
getExtraElements()
已过时。
any extra information should be stored in the metadata document.
|
java.lang.String |
getFilename()
The filename
|
BsonValue |
getId()
The
BsonValue id for this file. |
long |
getLength()
The length, in bytes of this file
|
java.lang.String |
getMD5()
The hash of the contents of the stored file
|
Document |
getMetadata()
Any additional metadata stored along with the file
|
ObjectId |
getObjectId()
The
ObjectId for this file. |
java.util.Date |
getUploadDate()
The date and time this file was added to GridFS
|
int |
hashCode() |
java.lang.String |
toString() |
public GridFSFile(BsonValue id, java.lang.String filename, long length, int chunkSize, java.util.Date uploadDate, java.lang.String md5, Document metadata)
id - the id of the filefilename - the filenamelength - the length, in bytes of the filechunkSize - the chunkSize, in bytes of the fileuploadDate - the upload date of the filemd5 - the hash of the files contentsmetadata - the optional metadata for the filepublic GridFSFile(BsonValue id, java.lang.String filename, long length, int chunkSize, java.util.Date uploadDate, java.lang.String md5, Document metadata, Document extraElements)
For GridFS files created in older versions of the driver.
id - the id of the filefilename - the filenamelength - the length, in bytes of the filechunkSize - the chunkSize, in bytes of the fileuploadDate - the upload date of the filemd5 - the hash of the files contentsmetadata - the optional metadata for the fileextraElements - any extra data stored in the documentpublic ObjectId getObjectId()
ObjectId for this file.
Throws a MongoGridFSException if the file id is not an ObjectId.public java.lang.String getFilename()
public long getLength()
public int getChunkSize()
public java.util.Date getUploadDate()
public java.lang.String getMD5()
public Document getMetadata()
@Deprecated public Document getExtraElements()
@Deprecated public java.lang.String getContentType()
@Deprecated public java.util.List<java.lang.String> getAliases()
public boolean equals(java.lang.Object o)
equals 在类中 java.lang.Objectpublic int hashCode()
hashCode 在类中 java.lang.Objectpublic java.lang.String toString()
toString 在类中 java.lang.Object