public final class GridFSFile extends Object
Constructor and Description |
---|
GridFSFile(BsonValue id,
String filename,
long length,
int chunkSize,
Date uploadDate,
String md5,
Document metadata)
Creates a new GridFSFile
|
GridFSFile(BsonValue id,
String filename,
long length,
int chunkSize,
Date uploadDate,
String md5,
Document metadata,
Document extraElements)
Creates a legacy implementation of the GridFSFile
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
List<String> |
getAliases()
Deprecated.
aliases should be stored in the metadata document.
|
int |
getChunkSize()
The size, in bytes, of each data chunk of this file
|
String |
getContentType()
Deprecated.
content type information stored in the metadata document.
|
Document |
getExtraElements()
Deprecated.
any extra information should be stored in the metadata document.
|
String |
getFilename()
The filename
|
BsonValue |
getId()
The
BsonValue id for this file. |
long |
getLength()
The length, in bytes of this file
|
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. |
Date |
getUploadDate()
The date and time this file was added to GridFS
|
int |
hashCode() |
String |
toString() |
public GridFSFile(BsonValue id, String filename, long length, int chunkSize, Date uploadDate, 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, String filename, long length, int chunkSize, Date uploadDate, 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 String getFilename()
public long getLength()
public int getChunkSize()
public Date getUploadDate()
public String getMD5()
public Document getMetadata()
@Deprecated public Document getExtraElements()
@Deprecated public String getContentType()
@Deprecated public List<String> getAliases()