Package com.dropbox.core.v1
Class DbxEntry
- java.lang.Object
-
- com.dropbox.core.util.Dumpable
-
- com.dropbox.core.v1.DbxEntry
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
DbxEntry.File
,DbxEntry.Folder
public abstract class DbxEntry extends Dumpable implements java.io.Serializable
Holds the metadata for a Dropbox file system entry. Can either be a regular file or a folder.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DbxEntry.File
The subclass ofDbxEntry
used to represent file metadata (as opposed to folder metadata).static class
DbxEntry.Folder
The subclass ofDbxEntry
used to represent folder metadata.static class
DbxEntry.WithChildren
Holds the metadata for a file or folder; if it's a folder, we also store the folder's hash and the metadata of its immediate children.static class
DbxEntry.WithChildrenC<C>
The more general case ofDbxEntry.WithChildren
.
-
Field Summary
Fields Modifier and Type Field Description java.lang.String
iconName
The name of the icon to use for this file.boolean
mightHaveThumbnail
Whether this file or folder might have a thumbnail image you can retrieve via theDbxClientV1.getThumbnail
call.java.lang.String
name
Just the last part ofpath
.java.lang.String
path
The path to the file or folder, relative to your application's root.static JsonReader<DbxEntry>
Reader
static JsonReader<DbxEntry>
ReaderMaybeDeleted
static long
serialVersionUID
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract DbxEntry.File
asFile()
If this metadata entry is a file, return it as aDbxEntry.File
instance.abstract DbxEntry.Folder
asFolder()
If this metadata entry is a folder, return it as aDbxEntry.Folder
instance.protected void
dumpFields(DumpWriter w)
abstract boolean
isFile()
Whether this metadata is for a file, which can be cast to typeDbxEntry.File
.abstract boolean
isFolder()
Whether this metadata is for a folder, which can be cast to typeDbxEntry.Folder
.protected boolean
partialEquals(DbxEntry o)
protected int
partialHashCode()
static <C> DbxEntry.WithChildrenC<C>
read(com.fasterxml.jackson.core.JsonParser parser, Collector<DbxEntry,? extends C> collector)
static <C> DbxEntry.WithChildrenC<C>
readMaybeDeleted(com.fasterxml.jackson.core.JsonParser parser, Collector<DbxEntry,? extends C> collector)
-
Methods inherited from class com.dropbox.core.util.Dumpable
getTypeName, toString, toString, toStringMultiline, toStringMultiline
-
-
-
-
Field Detail
-
serialVersionUID
public static final long serialVersionUID
- See Also:
- Constant Field Values
-
name
public final java.lang.String name
- See Also:
DbxPathV1.getName(java.lang.String)
-
path
public final java.lang.String path
The path to the file or folder, relative to your application's root. The path always starts with a"/"
.For full-Dropbox apps, the path is relative to the root of the user's Dropbox. For App Folder apps, the path is relative to your application's App Folder within the user's Dropbox.
-
iconName
public final java.lang.String iconName
The name of the icon to use for this file. The set of names returned by this call match up with icons in a set of icons provided by Dropbox. Read more about the icon field in Dropbox's documentation for the/metadata
HTTP endpoint.
-
mightHaveThumbnail
public final boolean mightHaveThumbnail
Whether this file or folder might have a thumbnail image you can retrieve via theDbxClientV1.getThumbnail
call. If this istrue
, there might be a thumbnail available. If this isfalse
, there is definitely no thumbnail available.
-
Reader
public static final JsonReader<DbxEntry> Reader
-
ReaderMaybeDeleted
public static final JsonReader<DbxEntry> ReaderMaybeDeleted
-
-
Method Detail
-
dumpFields
protected void dumpFields(DumpWriter w)
- Specified by:
dumpFields
in classDumpable
-
isFolder
public abstract boolean isFolder()
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 abstract boolean isFile()
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 abstract DbxEntry.Folder asFolder()
If this metadata entry is a folder, return it as aDbxEntry.Folder
instance. If it's not a folder, returnnull
.
-
asFile
public abstract DbxEntry.File asFile()
If this metadata entry is a file, return it as aDbxEntry.File
instance. If it's not a file, returnnull
.
-
partialEquals
protected boolean partialEquals(DbxEntry o)
-
partialHashCode
protected int partialHashCode()
-
readMaybeDeleted
public static <C> DbxEntry.WithChildrenC<C> readMaybeDeleted(com.fasterxml.jackson.core.JsonParser parser, Collector<DbxEntry,? extends C> collector) throws java.io.IOException, JsonReadException
- Throws:
java.io.IOException
JsonReadException
-
read
public static <C> DbxEntry.WithChildrenC<C> read(com.fasterxml.jackson.core.JsonParser parser, Collector<DbxEntry,? extends C> collector) throws java.io.IOException, JsonReadException
- Throws:
java.io.IOException
JsonReadException
-
-