Class GridFSFile

  • All Implemented Interfaces:
    DBObject, BSONObject
    Direct Known Subclasses:
    GridFSDBFile, GridFSInputFile

    @Deprecated(since="2021-05-27")
    public abstract class GridFSFile
    extends java.lang.Object
    implements DBObject
    Deprecated.
    Usage of this API is not supported in AEM as a Cloud Service.
    The abstract class representing a GridFS file.
    • Constructor Summary

      Constructors 
      Constructor Description
      GridFSFile()
      Deprecated.
       
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      boolean containsField​(java.lang.String s)
      Deprecated.
      Checks if this object contains a field with the given name.
      boolean containsKey​(java.lang.String key)
      Deprecated.
      java.lang.Object get​(java.lang.String key)
      Deprecated.
      Gets a field from this object by a given name.
      java.util.List<java.lang.String> getAliases()
      Deprecated.
      Gets the aliases from the metadata.
      long getChunkSize()
      Deprecated.
      Gets the size of a chunk.
      java.lang.String getContentType()
      Deprecated.
      Gets the content type.
      java.lang.String getFilename()
      Deprecated.
      Gets the filename.
      java.lang.Object getId()
      Deprecated.
      Gets the id.
      long getLength()
      Deprecated.
      Gets the file's length.
      java.lang.String getMD5()
      Deprecated.
      there is no replacement for this method
      DBObject getMetaData()
      Deprecated.
      Gets the file metadata.
      java.util.Date getUploadDate()
      Deprecated.
      Gets the upload date.
      boolean isPartialObject()
      Deprecated.
      Whether DBObject.markAsPartialObject() was ever called only matters if you are going to upsert and do not want to risk losing fields.
      java.util.Set<java.lang.String> keySet()
      Deprecated.
      Returns this object's fields' names
      void markAsPartialObject()
      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 numChunks()
      Deprecated.
      Returns the number of chunks that store the file data.
      java.lang.Object put​(java.lang.String key, java.lang.Object v)
      Deprecated.
      Sets a name/value pair in this object.
      void putAll​(java.util.Map m)
      Deprecated.
      Sets all key/value pairs from a map into this object
      void putAll​(BSONObject o)
      Deprecated.
      Sets all key/value pairs from an object into this object
      java.lang.Object removeField​(java.lang.String key)
      Deprecated.
      Removes a field with a given name from this object.
      void save()
      Deprecated.
      Saves the file entry to the files collection
      void setMetaData​(DBObject metadata)
      Deprecated.
      Gets the file metadata.
      java.util.Map<?,​?> toMap()
      Deprecated.
      Returns a map representing this BSONObject.
      java.lang.String toString()
      Deprecated.
       
      void validate()
      Deprecated.
      there is no replacement for this method
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • GridFSFile

        public GridFSFile()
        Deprecated.
    • Method Detail

      • save

        public void save()
        Deprecated.
        Saves the file entry to the files collection
        Throws:
        MongoException - if there's a failure
      • validate

        @Deprecated
        public void validate()
        Deprecated.
        there is no replacement for this method
        Verifies 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

        public java.lang.Object getId()
        Deprecated.
        Gets the id.
        Returns:
        the id of the file.
      • getFilename

        public java.lang.String getFilename()
        Deprecated.
        Gets the filename.
        Returns:
        the name of the file
      • getContentType

        public java.lang.String 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

        public java.util.Date getUploadDate()
        Deprecated.
        Gets the upload date.
        Returns:
        the date
      • getAliases

        public java.util.List<java.lang.String> getAliases()
        Deprecated.
        Gets the aliases from the metadata. note: to set aliases, call put(String, Object) with "aliases" , List<String>.
        Returns:
        list of aliases
      • getMetaData

        public DBObject getMetaData()
        Deprecated.
        Gets the file metadata.
        Returns:
        the metadata
      • setMetaData

        public void setMetaData​(DBObject metadata)
        Deprecated.
        Gets the file metadata.
        Parameters:
        metadata - metadata to be set
      • getMD5

        @Deprecated
        public java.lang.String getMD5()
        Deprecated.
        there is no replacement for this method
        Gets the observed MD5 during transfer
        Returns:
        md5
      • put

        public java.lang.Object put​(java.lang.String key,
                                    java.lang.Object v)
        Deprecated.
        Description copied from interface: BSONObject
        Sets a name/value pair in this object.
        Specified by:
        put in interface BSONObject
        Parameters:
        key - Name to set
        v - Corresponding value
        Returns:
        the previous value associated with key, or null if there was no mapping for key. (A null return can also indicate that the map previously associated null with key.)
      • get

        public java.lang.Object get​(java.lang.String key)
        Deprecated.
        Description copied from interface: BSONObject
        Gets a field from this object by a given name.
        Specified by:
        get in interface BSONObject
        Parameters:
        key - The name of the field fetch
        Returns:
        The field, if found
      • containsKey

        @Deprecated
        public boolean containsKey​(java.lang.String key)
        Deprecated.
        Description copied from interface: BSONObject
        Deprecated
        Specified by:
        containsKey in interface BSONObject
        Parameters:
        key - the key to check
        Returns:
        True if the key is present
      • containsField

        public boolean containsField​(java.lang.String s)
        Deprecated.
        Description copied from interface: BSONObject
        Checks if this object contains a field with the given name.
        Specified by:
        containsField in interface BSONObject
        Parameters:
        s - Field name for which to check
        Returns:
        True if the field is present
      • keySet

        public java.util.Set<java.lang.String> keySet()
        Deprecated.
        Description copied from interface: BSONObject
        Returns this object's fields' names
        Specified by:
        keySet in interface BSONObject
        Returns:
        The names of the fields in this object
      • isPartialObject

        public boolean isPartialObject()
        Deprecated.
        Description copied from interface: DBObject
        Whether DBObject.markAsPartialObject() was ever called only matters if you are going to upsert and do not want to risk losing fields.
        Specified by:
        isPartialObject in interface DBObject
        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 interface DBObject
      • toString

        public java.lang.String toString()
        Deprecated.
        Overrides:
        toString in class java.lang.Object
      • putAll

        public void putAll​(BSONObject o)
        Deprecated.
        Description copied from interface: BSONObject
        Sets all key/value pairs from an object into this object
        Specified by:
        putAll in interface BSONObject
        Parameters:
        o - the object
      • putAll

        public void putAll​(java.util.Map m)
        Deprecated.
        Description copied from interface: BSONObject
        Sets all key/value pairs from a map into this object
        Specified by:
        putAll in interface BSONObject
        Parameters:
        m - the map
      • toMap

        public java.util.Map<?,​?> toMap()
        Deprecated.
        Description copied from interface: BSONObject
        Returns a map representing this BSONObject.
        Specified by:
        toMap in interface BSONObject
        Returns:
        the map
      • removeField

        public java.lang.Object removeField​(java.lang.String key)
        Deprecated.
        Description copied from interface: BSONObject
        Removes a field with a given name from this object.
        Specified by:
        removeField in interface BSONObject
        Parameters:
        key - The name of the field to remove
        Returns:
        The value removed from this object