com.google.gdata.data.docs
Class DocumentListEntry

java.lang.Object
  extended by com.google.gdata.data.AbstractExtension
      extended by com.google.gdata.data.ExtensionPoint
          extended by com.google.gdata.data.BaseEntry<E>
              extended by com.google.gdata.data.media.MediaEntry<DocumentListEntry>
                  extended by com.google.gdata.data.docs.DocumentListEntry
All Implemented Interfaces:
Extension, IEntry, Kind.Adaptable, Kind.Adaptor
Direct Known Subclasses:
DocumentEntry, FolderEntry, PdfEntry, PhotoEntry, PresentationEntry, SpreadsheetEntry

public class DocumentListEntry
extends MediaEntry<DocumentListEntry>

An entry representing a single document of any type within a DocumentListFeed.


Nested Class Summary
static class DocumentListEntry.MediaType
          Represents the MIME types supported by the doclist GData feed
 
Nested classes/interfaces inherited from class com.google.gdata.data.BaseEntry
BaseEntry.AtomHandler, BaseEntry.EntryState
 
Nested classes/interfaces inherited from class com.google.gdata.data.ExtensionPoint
ExtensionPoint.CumulativeBlobHandler, ExtensionPoint.ExtensionHandler
 
Nested classes/interfaces inherited from class com.google.gdata.data.AbstractExtension
AbstractExtension.AttributesHandler
 
Field Summary
static java.lang.String DOCUMENT_NAMESPACE
           
static java.lang.String FOLDERS_NAMESPACE
           
static java.lang.String PARENT_NAMESPACE
           
static Category UNKNOWN_CATEGORY
          Category used to label entries which are of document type.
static java.lang.String UNKNOWN_KIND
          Kind category term used to label the entries which are of document type.
static java.lang.String UNKNOWN_LABEL
          Label for category.
 
Fields inherited from class com.google.gdata.data.BaseEntry
state
 
Fields inherited from class com.google.gdata.data.ExtensionPoint
xmlBlob
 
Fields inherited from class com.google.gdata.data.AbstractExtension
localName, namespace
 
Constructor Summary
DocumentListEntry()
          Constructs a new uninitialized entry, to be populated by the GData parsers.
DocumentListEntry(BaseEntry<?> sourceEntry)
          Constructs a new entry by doing a shallow copy from another BaseEntry instance.
 
Method Summary
 void addFolder(Person owner, java.lang.String folderName)
          Adds a user-specific folder that parents this document
 void declareExtensions(ExtensionProfile extProfile)
          Declares the set of expected Extension types for an ExtensionPoint within the target extension profile.
 AclFeed getAclFeed()
           
 DocumentListAclFeedLink getAclFeedLink()
           
 Link getDocumentLink()
          Gets the link with which you can open up the document in a Web browser.
 java.util.Set<java.lang.String> getFolders()
           
 java.lang.String getKey()
          Gets the non-user-friendly key that is used to access the document feed.
protected static java.lang.String getMimeTypeFromFileName(java.lang.String fileName)
          Returns the mime type given a file name.
 java.util.List<Link> getParentLinks()
           
 boolean isStarred()
           
 boolean isTrashed()
           
 void setFile(java.io.File file)
          Deprecated. Prefer setFile(File, String)
 void setFile(java.io.File file, java.lang.String mimeType)
          Associate a File with this entry with the specified mime type
 void setStarred(boolean starred)
          Sets the starred status of this document for the user this feed request has been authenticated under.
 void setTrashed(boolean trashed)
          Sets the trashed status of this document for the user this feed request has been authenticated under.
 
Methods inherited from class com.google.gdata.data.media.MediaEntry
getContentHandlerInfo, getMediaEditLink, getMediaSource, setMediaSource, setService, updateMedia
 
Methods inherited from class com.google.gdata.data.BaseEntry
addAdaptor, addHtmlLink, addLink, addLink, delete, generate, generateAtom, generateRss, getAdaptedEntry, getAdaptor, getAdaptors, getAuthors, getCanEdit, getCategories, getContent, getContributors, getEdited, getEditLink, getEtag, getHandler, getHtmlLink, getId, getLink, getLinks, getLinks, getPlainTextContent, getPubControl, getPublished, getRights, getSelf, getSelfLink, getService, getSource, getSummary, getTextContent, getTitle, getUpdated, getVersionId, isDraft, parseAtom, parseAtom, parseAtom, readEntry, readEntry, removeLinks, setCanEdit, setContent, setContent, setDraft, setEdited, setEtag, setId, setPubControl, setPublished, setRights, setSource, setSummary, setTitle, setUpdated, setVersionId, update, visitChildren
 
Methods inherited from class com.google.gdata.data.ExtensionPoint
addExtension, addExtension, addRepeatingExtension, addRepeatingExtension, checkRequiredExtensions, generate, generateCumulativeXmlBlob, generateExtensions, generateStartElement, getExtension, getExtensionHandler, getExtensions, getManifest, getRepeatingExtension, getRepeatingExtensions, getXmlBlob, hasExtension, hasRepeatingExtension, initializeArbitraryXml, parseCumulativeXmlBlob, removeExtension, removeExtension, removeRepeatingExtension, setExtension, setXmlBlob, visit, visitChild
 
Methods inherited from class com.google.gdata.data.AbstractExtension
consumeAttributes, eq, generateAttributes, getExtensionLocalName, getExtensionNamespace, isImmutable, putAttributes, sameClassAs, setImmutable, throwExceptionForMissingAttribute, throwExceptionIfImmutable, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DOCUMENT_NAMESPACE

public static final java.lang.String DOCUMENT_NAMESPACE
See Also:
Constant Field Values

UNKNOWN_LABEL

public static final java.lang.String UNKNOWN_LABEL
Label for category.

See Also:
Constant Field Values

UNKNOWN_KIND

public static final java.lang.String UNKNOWN_KIND
Kind category term used to label the entries which are of document type.

See Also:
Constant Field Values

UNKNOWN_CATEGORY

public static final Category UNKNOWN_CATEGORY
Category used to label entries which are of document type.


FOLDERS_NAMESPACE

public static final java.lang.String FOLDERS_NAMESPACE
See Also:
Constant Field Values

PARENT_NAMESPACE

public static final java.lang.String PARENT_NAMESPACE
See Also:
Constant Field Values
Constructor Detail

DocumentListEntry

public DocumentListEntry()
Constructs a new uninitialized entry, to be populated by the GData parsers.


DocumentListEntry

public DocumentListEntry(BaseEntry<?> sourceEntry)
Constructs a new entry by doing a shallow copy from another BaseEntry instance.

Method Detail

getMimeTypeFromFileName

protected static java.lang.String getMimeTypeFromFileName(java.lang.String fileName)
Returns the mime type given a file name. Not intended for extenal use, see setFile(File, String) instead. protected access for testing.

Throws:
java.lang.IllegalArgumentException - if the mime type is not known given the file name

declareExtensions

public void declareExtensions(ExtensionProfile extProfile)
Description copied from class: ExtensionPoint
Declares the set of expected Extension types for an ExtensionPoint within the target extension profile. The base implementation does not declare any extensions, but can be overridden by specific types of ExtensionPoints that always contain a well-defined set of extensions.

Specified by:
declareExtensions in interface Kind.Adaptor
Overrides:
declareExtensions in class ExtensionPoint
Parameters:
extProfile - the ExtensionProfile to initialize.
See Also:
ExtensionProfile.addDeclarations(Kind.Adaptor)

getDocumentLink

public Link getDocumentLink()
Gets the link with which you can open up the document in a Web browser. This is a link to the full document-specific UI (for edit if the requesting user has edit permission, and a read-only HTML rendering otherwise).

Returns:
a link to open up the web browser with

getKey

public java.lang.String getKey()
Gets the non-user-friendly key that is used to access the document feed. This is the key that can be used to construct the Atom id for this document, and to access the document-specific feed. http://docs.google.com/getdoc?id={id} http://spreadsheets.google.com/ccc?key={id}

Returns:
the Google Docs & Spreadsheets id

setFile

@Deprecated
public void setFile(java.io.File file)
Deprecated. Prefer setFile(File, String)

Associate a File with this entry, implicitly determining the mime type from the file's extension.


setFile

public void setFile(java.io.File file,
                    java.lang.String mimeType)
Associate a File with this entry with the specified mime type


setStarred

public void setStarred(boolean starred)
Sets the starred status of this document for the user this feed request has been authenticated under.

Parameters:
starred - true if the document should be starred

isStarred

public boolean isStarred()
Returns:
true if the document represented by this entry has been starred by the user this feed request has been authenticated under.

setTrashed

public void setTrashed(boolean trashed)
Sets the trashed status of this document for the user this feed request has been authenticated under.

Parameters:
trashed - true if the document should be trashed

isTrashed

public boolean isTrashed()
Returns:
true if the document represented by this entry has been trashed by the user this feed request has been authenticated under.

addFolder

public void addFolder(Person owner,
                      java.lang.String folderName)
Adds a user-specific folder that parents this document

Parameters:
owner - the owner of the folder
folderName - the name of the folder

getFolders

public java.util.Set<java.lang.String> getFolders()

getAclFeedLink

public DocumentListAclFeedLink getAclFeedLink()

getAclFeed

public AclFeed getAclFeed()

getParentLinks

public java.util.List<Link> getParentLinks()