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 ofDbxEntry
used to represent file metadata (as opposed to folder metadata).- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DbxEntry.File.Location
A geo locationstatic class
DbxEntry.File.PhotoInfo
Photo metadata that the Dropbox server extracted from the photo file.static class
DbxEntry.File.VideoInfo
Video 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.Date
clientMtime
The modification time sent up by the Dropbox desktop client when the file was added or modified.java.lang.String
humanSize
A human-readable string version of the file size (ex: "13 kb").java.util.Date
lastModified
The time the file was added, moved, or last had it's contents changed on the Dropbox server.long
numBytes
The size, in bytes, of the file content.DbxEntry.File.PhotoInfo
photoInfo
If this file is a photo, this may contain additional photo-related information.static JsonReader<DbxEntry.File>
Reader
static JsonReader<DbxEntry.File>
ReaderMaybeDeleted
java.lang.String
rev
The revision of the file at this path.static long
serialVersionUID
DbxEntry.File.VideoInfo
videoInfo
Contains 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.File
asFile()
If this metadata entry is a file, return it as aDbxEntry.File
instance.DbxEntry.Folder
asFolder()
If this metadata entry is a folder, return it as aDbxEntry.Folder
instance.protected void
dumpFields(DumpWriter w)
boolean
equals(DbxEntry.File o)
boolean
equals(java.lang.Object o)
protected java.lang.String
getTypeName()
int
hashCode()
boolean
isFile()
Whether this metadata is for a file, which can be cast to typeDbxEntry.File
.boolean
isFolder()
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 theLocale
inDbxRequestConfig.userLocale
(passed in to theDbxClientV1
constructor).
-
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 theclientMtime
is 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.path
iconName
-DbxEntry.iconName
mightHaveThumbnail
-DbxEntry.mightHaveThumbnail
numBytes
-numBytes
humanSize
-humanSize
lastModified
-lastModified
clientMtime
-clientMtime
rev
-rev
photoInfo
-photoInfo
videoInfo
-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:
dumpFields
in classDbxEntry
-
getTypeName
protected java.lang.String getTypeName()
- Overrides:
getTypeName
in classDumpable
-
isFolder
public boolean isFolder()
Description copied from class:DbxEntry
Whether 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:DbxEntry
Whether 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:DbxEntry
If this metadata entry is a folder, return it as aDbxEntry.Folder
instance. If it's not a folder, returnnull
.
-
asFile
public DbxEntry.File asFile()
Description copied from class:DbxEntry
If this metadata entry is a file, return it as aDbxEntry.File
instance. If it's not a file, returnnull
.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
equals
public boolean equals(DbxEntry.File o)
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-