com.dropbox.client2
Class DropboxAPI.Entry

java.lang.Object
  extended by com.dropbox.client2.DropboxAPI.Entry
Enclosing class:
DropboxAPI<SESS_T extends Session>

public static class DropboxAPI.Entry
extends java.lang.Object

A metadata entry that describes a file or folder.


Field Summary
 long bytes
          Size of the file.
 java.lang.String clientMtime
          For a file, this is the modification time set by the client when the file was added to Dropbox.
 java.util.List<DropboxAPI.Entry> contents
          A list of immediate children if this is a directory.
 java.lang.String hash
          If a directory, the hash is its "current version".
 java.lang.String icon
          Name of the icon to display for this entry.
 boolean isDeleted
          Whether this entry has been deleted but not removed from the metadata yet.
 boolean isDir
          True if this entry is a directory, or false if it's a file.
static JsonExtractor<DropboxAPI.Entry> JsonExtractor
           
 java.lang.String mimeType
          The file's MIME type.
 java.lang.String modified
          Last modified date, in "EEE, dd MMM yyyy kk:mm:ss ZZZZZ" form (see RESTUtility#parseDate(String) for parsing this value.
 java.lang.String path
          Path to the file from the root.
 java.lang.String rev
          Full unique ID for this file's revision.
 java.lang.String root
          Name of the root, usually either "dropbox" or "app_folder".
 java.lang.String size
          Human-readable (and localized, if possible) description of the file size.
 boolean thumbExists
          Whether a thumbnail for this is available.
 
Constructor Summary
DropboxAPI.Entry()
           
DropboxAPI.Entry(java.util.Map<java.lang.String,java.lang.Object> map)
          Creates an entry from a map, usually received from the metadata call.
 
Method Summary
 java.lang.String fileName()
          Returns the file name if this is a file (the part after the last slash in the path).
 java.lang.String parentPath()
          Returns the path of the parent directory if this is a file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bytes

public long bytes
Size of the file.


hash

public java.lang.String hash
If a directory, the hash is its "current version". If the hash changes between calls, then one of the directory's immediate children has changed.


icon

public java.lang.String icon
Name of the icon to display for this entry. Corresponds to filenames (without an extension) in the icon library available at https://www.dropbox.com/static/images/dropbox-api-icons.zip.


isDir

public boolean isDir
True if this entry is a directory, or false if it's a file.


modified

public java.lang.String modified
Last modified date, in "EEE, dd MMM yyyy kk:mm:ss ZZZZZ" form (see RESTUtility#parseDate(String) for parsing this value.


clientMtime

public java.lang.String clientMtime
For a file, this is the modification time set by the client when the file was added to Dropbox. Since this time is not verified (the Dropbox server stores whatever the client sends up) this should only be used for display purposes (such as sorting) and not, for example, to determine if a file has changed or not.

This is not set for folders.


path

public java.lang.String path
Path to the file from the root.


root

public java.lang.String root
Name of the root, usually either "dropbox" or "app_folder".


size

public java.lang.String size
Human-readable (and localized, if possible) description of the file size.


mimeType

public java.lang.String mimeType
The file's MIME type.


rev

public java.lang.String rev
Full unique ID for this file's revision. This is a string, and not equivalent to the old revision integer.


thumbExists

public boolean thumbExists
Whether a thumbnail for this is available.


isDeleted

public boolean isDeleted
Whether this entry has been deleted but not removed from the metadata yet. Most likely you'll only want to show entries with isDeleted == false.


contents

public java.util.List<DropboxAPI.Entry> contents
A list of immediate children if this is a directory.


JsonExtractor

public static final JsonExtractor<DropboxAPI.Entry> JsonExtractor
Constructor Detail

DropboxAPI.Entry

public DropboxAPI.Entry(java.util.Map<java.lang.String,java.lang.Object> map)
Creates an entry from a map, usually received from the metadata call. It's unlikely you'll want to create these yourself.

Parameters:
map - the map representation of the JSON received from the metadata call, which should look like this:
 {
    "hash": "528dda36e3150ba28040052bbf1bfbd1",
    "thumb_exists": false,
    "bytes": 0,
    "modified": "Sat, 12 Jan 2008 23:10:10 +0000",
    "path": "/Public",
    "is_dir": true,
    "size": "0 bytes",
    "root": "dropbox",
    "contents": [
    {
        "thumb_exists": false,
        "bytes": 0,
        "modified": "Wed, 16 Jan 2008 09:11:59 +0000",
        "path": "/Public/♥asdas♥",
        "is_dir": true,
        "icon": "folder",
        "size": "0 bytes"
    },
    {
        "thumb_exists": false,
        "bytes": 4392763,
        "modified": "Thu, 15 Jan 2009 02:52:43 +0000",
        "path": "/Public/名称未設定フォルダ.zip",
        "is_dir": false,
        "icon": "page_white_compressed",
        "size": "4.2MB"
    }
    ],
    "icon": "folder_public"
 }
 

DropboxAPI.Entry

public DropboxAPI.Entry()
Method Detail

fileName

public java.lang.String fileName()
Returns the file name if this is a file (the part after the last slash in the path).


parentPath

public java.lang.String parentPath()
Returns the path of the parent directory if this is a file.