Package com.dropbox.core.v1
Class DbxEntry.File
- java.lang.Object
-
- com.dropbox.core.util.Dumpable
-
- com.dropbox.core.v1.DbxEntry
-
- com.dropbox.core.v1.DbxEntry.File
-
- All Implemented Interfaces:
java.io.Serializable
- Enclosing class:
- DbxEntry
public static final class DbxEntry.File extends DbxEntry
The subclass ofDbxEntryused to represent file metadata (as opposed to folder metadata).- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDbxEntry.File.LocationA geo locationstatic classDbxEntry.File.PhotoInfoPhoto metadata that the Dropbox server extracted from the photo file.static classDbxEntry.File.VideoInfoVideo metadata that the Dropbox server extracted from the video file.-
Nested classes/interfaces inherited from class com.dropbox.core.v1.DbxEntry
DbxEntry.File, DbxEntry.Folder, DbxEntry.WithChildren, DbxEntry.WithChildrenC<C>
-
-
Field Summary
Fields Modifier and Type Field Description java.util.DateclientMtimeThe modification time sent up by the Dropbox desktop client when the file was added or modified.java.lang.StringhumanSizeA human-readable string version of the file size (ex: "13 kb").java.util.DatelastModifiedThe time the file was added, moved, or last had it's contents changed on the Dropbox server.longnumBytesThe size, in bytes, of the file content.DbxEntry.File.PhotoInfophotoInfoIf this file is a photo, this may contain additional photo-related information.static JsonReader<DbxEntry.File>Readerstatic JsonReader<DbxEntry.File>ReaderMaybeDeletedjava.lang.StringrevThe revision of the file at this path.static longserialVersionUIDDbxEntry.File.VideoInfovideoInfoContains details about this file if it is a video-
Fields inherited from class com.dropbox.core.v1.DbxEntry
iconName, mightHaveThumbnail, name, path
-
-
Constructor Summary
Constructors Constructor Description File(java.lang.String path, java.lang.String iconName, boolean mightHaveThumbnail, long numBytes, java.lang.String humanSize, java.util.Date lastModified, java.util.Date clientMtime, java.lang.String rev)File(java.lang.String path, java.lang.String iconName, boolean mightHaveThumbnail, long numBytes, java.lang.String humanSize, java.util.Date lastModified, java.util.Date clientMtime, java.lang.String rev, DbxEntry.File.PhotoInfo photoInfo, DbxEntry.File.VideoInfo videoInfo)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DbxEntry.FileasFile()If this metadata entry is a file, return it as aDbxEntry.Fileinstance.DbxEntry.FolderasFolder()If this metadata entry is a folder, return it as aDbxEntry.Folderinstance.protected voiddumpFields(DumpWriter w)booleanequals(DbxEntry.File o)booleanequals(java.lang.Object o)protected java.lang.StringgetTypeName()inthashCode()booleanisFile()Whether this metadata is for a file, which can be cast to typeDbxEntry.File.booleanisFolder()Whether this metadata is for a folder, which can be cast to typeDbxEntry.Folder.-
Methods inherited from class com.dropbox.core.v1.DbxEntry
partialEquals, partialHashCode, read, readMaybeDeleted
-
Methods inherited from class com.dropbox.core.util.Dumpable
toString, toString, toStringMultiline, toStringMultiline
-
-
-
-
Field Detail
-
serialVersionUID
public static final long serialVersionUID
- See Also:
- Constant Field Values
-
numBytes
public final long numBytes
The size, in bytes, of the file content.
-
humanSize
public final java.lang.String humanSize
A human-readable string version of the file size (ex: "13 kb"). This string will be localized based on theLocaleinDbxRequestConfig.userLocale(passed in to theDbxClientV1constructor).
-
lastModified
public final java.util.Date lastModified
The time the file was added, moved, or last had it's contents changed on the Dropbox server. (This probably won't match the time on the Dropbox user's filesystem. For that theclientMtimeis a better estimate.)
-
clientMtime
public final java.util.Date clientMtime
The modification time sent up by the Dropbox desktop client when the file was added or modified. This time is based on the system clock of the particular host that the client was running on, as opposed to the system clock of the Dropbox servers.This field should not be used to determine if a file has changed, but only as a way to sort files by date (when displaying a list of files to the user).
-
rev
public final java.lang.String rev
The revision of the file at this path. This can be used withDbxClientV1.uploadFile(java.lang.String, com.dropbox.core.v1.DbxWriteMode, long, java.io.InputStream)and theDbxWriteMode.update(java.lang.String)mode to make sure you're overwriting the revision of the file you think you're overwriting.
-
photoInfo
public final DbxEntry.File.PhotoInfo photoInfo
If this file is a photo, this may contain additional photo-related information. This field is only populated if you use theincludeMediaInfo
-
videoInfo
public final DbxEntry.File.VideoInfo videoInfo
Contains details about this file if it is a video
-
Reader
public static final JsonReader<DbxEntry.File> Reader
-
ReaderMaybeDeleted
public static final JsonReader<DbxEntry.File> ReaderMaybeDeleted
-
-
Constructor Detail
-
File
public File(java.lang.String path, java.lang.String iconName, boolean mightHaveThumbnail, long numBytes, java.lang.String humanSize, java.util.Date lastModified, java.util.Date clientMtime, java.lang.String rev, DbxEntry.File.PhotoInfo photoInfo, DbxEntry.File.VideoInfo videoInfo)- Parameters:
path-DbxEntry.pathiconName-DbxEntry.iconNamemightHaveThumbnail-DbxEntry.mightHaveThumbnailnumBytes-numByteshumanSize-humanSizelastModified-lastModifiedclientMtime-clientMtimerev-revphotoInfo-photoInfovideoInfo-videoInfo
-
File
public File(java.lang.String path, java.lang.String iconName, boolean mightHaveThumbnail, long numBytes, java.lang.String humanSize, java.util.Date lastModified, java.util.Date clientMtime, java.lang.String rev)
-
-
Method Detail
-
dumpFields
protected void dumpFields(DumpWriter w)
- Overrides:
dumpFieldsin classDbxEntry
-
getTypeName
protected java.lang.String getTypeName()
- Overrides:
getTypeNamein classDumpable
-
isFolder
public boolean isFolder()
Description copied from class:DbxEntryWhether this metadata is for a folder, which can be cast to typeDbxEntry.Folder. (Every metadata object is either for a file or a folder.)
-
isFile
public boolean isFile()
Description copied from class:DbxEntryWhether this metadata is for a file, which can be cast to typeDbxEntry.File. (Every metadata object is either for a file or a folder.)
-
asFolder
public DbxEntry.Folder asFolder()
Description copied from class:DbxEntryIf this metadata entry is a folder, return it as aDbxEntry.Folderinstance. If it's not a folder, returnnull.
-
asFile
public DbxEntry.File asFile()
Description copied from class:DbxEntryIf this metadata entry is a file, return it as aDbxEntry.Fileinstance. If it's not a file, returnnull.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
equals
public boolean equals(DbxEntry.File o)
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-