public static final class DbxEntry.File extends DbxEntry
DbxEntry
used to represent file metadata (as opposed
to folder metadata).DbxEntry.File, DbxEntry.Folder, DbxEntry.WithChildren, DbxEntry.WithChildrenC<C>
Modifier and Type | Field and Description |
---|---|
Date |
clientMtime
The modification time sent up by the Dropbox desktop client when the file was added
or modified.
|
String |
humanSize
A human-readable string version of the file size (ex: "13 kb").
|
Date |
lastModified
The time the file was added, moved, or last had it's contents changed on the Dropbox
server.
|
String |
mimeType |
long |
numBytes
The size, in bytes, of the file content.
|
String |
revision
The revision of the file at this path.
|
static long |
serialVersionUID |
Constructor and Description |
---|
DbxEntry.File(String path,
String iconName,
boolean mightHaveThumbnail,
long numBytes,
String humanSize,
Date lastModified,
Date clientMtime,
String mimeType,
String revision) |
Modifier and Type | Method and Description |
---|---|
DbxEntry.File |
asFile()
If this metadata entry is a file, return it as a
DbxEntry.File
instance. |
DbxEntry.Folder |
asFolder()
If this metadata entry is a folder, return it as a
DbxEntry.Folder
instance. |
protected void |
dumpFields(DumpWriter w) |
protected String |
getTypeName() |
boolean |
isFile()
Whether this metadata is for a file, which can be cast to type
DbxEntry.File . |
boolean |
isFolder()
Whether this metadata is for a folder, which can be cast to type
DbxEntry.Folder . |
String |
toString()
A abbreviated version of
DbxDataObject.toStringMultiline() . |
dump, dump, dump, dump, dump, toStringDate, toStringMultiline, toStringMultiline
public static final long serialVersionUID
public final long numBytes
public final String humanSize
Locale
in DbxRequestConfig.userLocale
(passed in to the DbxClient
constructor).public final Date lastModified
clientMtime
is a better estimate.)public final Date clientMtime
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).
public final String mimeType
public final String revision
DbxClient.uploadFile(java.lang.String, com.dropbox.core.DbxWriteMode, long, java.io.InputStream)
and the DbxWriteMode.update(java.lang.String)
mode to make sure you're overwriting the revision of
the file you think you're overwriting.public DbxEntry.File(String path, String iconName, boolean mightHaveThumbnail, long numBytes, String humanSize, Date lastModified, Date clientMtime, String mimeType, String revision)
path
- DbxEntry.path
iconName
- DbxEntry.iconName
mightHaveThumbnail
- DbxEntry.mightHaveThumbnail
numBytes
- numBytes
humanSize
- humanSize
lastModified
- lastModified
clientMtime
- clientMtime
mimeType
- mimeType
revision
- revision
protected void dumpFields(DumpWriter w)
dumpFields
in class DbxEntry
protected String getTypeName()
getTypeName
in class DbxDataObject
public String toString()
DbxDataObject.toStringMultiline()
. Only includes the path.public boolean isFolder()
DbxEntry
DbxEntry.Folder
. (Every metadata object is either for a file or a folder.)public boolean isFile()
DbxEntry
DbxEntry.File
. (Every metadata object is either for a file or a folder.)public DbxEntry.Folder asFolder()
DbxEntry
DbxEntry.Folder
instance. If it's not a folder, return null
.public DbxEntry.File asFile()
DbxEntry
DbxEntry.File
instance. If it's not a file, return null
.Copyright © 2013. All rights reserved.