public class

DocumentListEntry

extends MediaEntry<E extends BaseEntry<E>>
java.lang.Object
   ↳ com.google.gdata.data.AbstractExtension
     ↳ com.google.gdata.data.ExtensionPoint
       ↳ com.google.gdata.data.BaseEntry<E extends com.google.gdata.data.BaseEntry>
         ↳ com.google.gdata.data.media.MediaEntry<E extends com.google.gdata.data.BaseEntry<E>>
           ↳ com.google.gdata.data.docs.DocumentListEntry
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

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

Summary

Nested Classes
enum DocumentListEntry.MediaType Represents the MIME types supported by the doclist GData feed  
Constants
String FOLDERS_NAMESPACE
String KIND Kind category term used to label the entries which are of item type.
String LABEL Label for category.
String PARENT_NAMESPACE
String REVISIONS_NAMESPACE
String THUMBNAIL_NAMESPACE
String UNKNOWN_KIND This constant is deprecated. Use KIND instead.
String UNKNOWN_LABEL This constant is deprecated. Use LABEL instead.
Fields
public static final Category CATEGORY Category used to label entries which are of item type.
private static final Pattern FOLDER_PATTERN
public static final Category UNKNOWN_CATEGORY This field is deprecated. Use CATEGORY instead.
[Expand]
Inherited Fields
From class com.google.gdata.data.BaseEntry
From class com.google.gdata.data.ExtensionPoint
From class com.google.gdata.data.AbstractExtension
Public Constructors
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.
Public Methods
void addFolder(Person owner, String folderName)
This method is deprecated. use addLink(Link) with link relation PARENT_NAMESPACE instead.
void declareExtensions(ExtensionProfile extProfile)
Declares the set of expected Extension types for an ExtensionPoint within the target extension profile.
AclFeed getAclFeed()
DocumentListAclFeedLink getAclFeedLink()
String getDescription()
Returns the description of this document.
String getDocId()
Gets the docId or spreadsheet key from the resource id.
Link getDocumentLink()
Gets the link with which you can open up the document in a Web browser.
String getFilename()
Returns the original filename for this document.
Set<String> getFolders()
This method is deprecated. use getParentLinks() instead.
String getKey()
This method is deprecated. use getResourceId() instead.
DateTime getLastCommented()
Returns the time when the document was last commented by the user.
LastModifiedBy getLastModifiedBy()
Returns the user who last modified the document.
DateTime getLastViewed()
Returns the time when the document was last viewed by the user.
String getMd5Checksum()
Returns the MD5 checksum calculated for the document.
List<Link> getParentLinks()
Long getQuotaBytesUsed()
Returns the amount of quota consumed by the document.
String getResourceId()
Returns the document's resource id.
String getSuggestedFilename()
Returns the suggested filename for this document.
String getType()
Returns the type document entry from the resource id.
boolean isHidden()
boolean isRestrictedDownload()
boolean isStarred()
boolean isTrashed()
boolean isViewed()
Boolean isWritersCanInvite()
Returns a flag for whether writers can invite other collaborators
void setDescription(String description)
Sets the description of this document.
void setFile(File file, String mimeType)
Associate a File with this entry with the specified mime type
void setFile(File file)
This method is deprecated. use setFile(File, String) instead.
void setFilename(String filename)
Sets the filename of this document.
void setHidden(boolean hidden)
Sets the hidden status of this document for the user this feed request has been authenticated under.
void setLastCommented(DateTime lastCommented)
Sets the time when the document was last commented by the user.
void setLastModifiedBy(LastModifiedBy lastModifiedBy)
Sets the amount of quota consumed by the document.
void setLastViewed(DateTime lastViewed)
Sets the time when the document was last viewed by the user.
void setMd5Checksum(String md5Checksum)
Set the MD5 checksum calculated for the document.
void setQuotaBytesUsed(Long quotaBytesUsed)
Sets the amount of quota consumed by the document.
void setResourceId(String resourceId)
Sets the document's resource id.
void setRestrictedDownload(boolean restrictedDownload)
Sets the restricted download status for this document.
void setStarred(boolean starred)
Sets the starred status of this document for the user this feed request has been authenticated under.
void setSuggestedFilename(String filename)
Sets the suggested filename for this document.
void setTrashed(boolean trashed)
Sets the trashed status of this document for the user this feed request has been authenticated under.
void setViewed(boolean viewed)
Sets the viewed status of this document for the user this feed request has been authenticated under.
void setWritersCanInvite(Boolean writersCanInvite)
Sets whether users classed as writers can invite other collaborators
Protected Methods
static String getMimeTypeFromFileName(String fileName)
Returns the mime type given a file name.
[Expand]
Inherited Methods
From class com.google.gdata.data.media.MediaEntry
From class com.google.gdata.data.BaseEntry
From class com.google.gdata.data.ExtensionPoint
From class com.google.gdata.data.AbstractExtension
From class java.lang.Object
From interface com.google.gdata.data.Extension
From interface com.google.gdata.data.IAtom
From interface com.google.gdata.data.IEntry
From interface com.google.gdata.data.Kind.Adaptable
From interface com.google.gdata.data.Kind.Adaptor
From interface com.google.gdata.data.media.IMediaEntry

Constants

public static final String FOLDERS_NAMESPACE

Constant Value: "http://schemas.google.com/docs/2007/folders"

public static final String KIND

Kind category term used to label the entries which are of item type.

Constant Value: "http://schemas.google.com/docs/2007#item"

public static final String LABEL

Label for category.

Constant Value: "item"

public static final String PARENT_NAMESPACE

Constant Value: "http://schemas.google.com/docs/2007#parent"

public static final String REVISIONS_NAMESPACE

Constant Value: "http://schemas.google.com/docs/2007/revisions"

public static final String THUMBNAIL_NAMESPACE

Constant Value: "http://schemas.google.com/docs/2007/thumbnail"

public static final String UNKNOWN_KIND

This constant is deprecated.
Use KIND instead.

Kind category term used to label the entries which are of document type.

Constant Value: "http://schemas.google.com/docs/2007#unknown"

public static final String UNKNOWN_LABEL

This constant is deprecated.
Use LABEL instead.

Label for category.

Constant Value: "unknown"

Fields

public static final Category CATEGORY

Category used to label entries which are of item type.

private static final Pattern FOLDER_PATTERN

public static final Category UNKNOWN_CATEGORY

This field is deprecated.
Use CATEGORY instead.

Category used to label entries which are of document type.

Public Constructors

public DocumentListEntry ()

Constructs a new uninitialized entry, to be populated by the GData parsers.

public DocumentListEntry (BaseEntry<?> sourceEntry)

Constructs a new entry by doing a shallow copy from another BaseEntry instance.

Parameters
sourceEntry

Public Methods

public void addFolder (Person owner, String folderName)

This method is deprecated.
use addLink(Link) with link relation PARENT_NAMESPACE instead.

Adds a user-specific folder that parents this document

Parameters
owner The owner of the folder
folderName The name of the folder

public void declareExtensions (ExtensionProfile extProfile)

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.

Parameters
extProfile The ExtensionProfile to initialize.

public AclFeed getAclFeed ()

public DocumentListAclFeedLink getAclFeedLink ()

public String getDescription ()

Returns the description of this document.

Returns
  • the description (null means no description was set, whereas the empty-string means the description is empty)

public String getDocId ()

Gets the docId or spreadsheet key from the resource id. This is the id that can be used to construct the export url or link to google docs. http://docs.google.com/present/edit?id={id} http://spreadsheets.google.com/ccc?key={id}

Returns
  • the Google Docs doc id .

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

public String getFilename ()

Returns the original filename for this document.

Returns
  • the filename

public Set<String> getFolders ()

This method is deprecated.
use getParentLinks() instead.

public String getKey ()

This method is deprecated.
use getResourceId() instead.

Gets the resource id that is used to access the document entry or export the document. http://docs.google.com/getdoc?id={id} http://spreadsheets.google.com/ccc?key={id}

Returns
  • the Google Docs & Spreadsheets id

public DateTime getLastCommented ()

Returns the time when the document was last commented by the user.

Returns
  • the last commented time

public LastModifiedBy getLastModifiedBy ()

Returns the user who last modified the document.

Returns
  • the user who last modified the document

public DateTime getLastViewed ()

Returns the time when the document was last viewed by the user.

Returns
  • the last viewed time

public String getMd5Checksum ()

Returns the MD5 checksum calculated for the document.

Returns
  • the MD5 checksum

public List<Link> getParentLinks ()

public Long getQuotaBytesUsed ()

Returns the amount of quota consumed by the document.

Returns
  • the quota used

public String getResourceId ()

Returns the document's resource id.

Returns
  • the resource id.

public String getSuggestedFilename ()

Returns the suggested filename for this document.

Returns
  • the filename

public String getType ()

Returns the type document entry from the resource id. If the resource id id "document:12345", then "document" is returned.

Returns
  • the document type .

public boolean isHidden ()

Returns
  • true if the document represented by this entry has been hidden by the user this feed request has been authenticated under.

public boolean isRestrictedDownload ()

Returns
  • true if the document has restricted downloading

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.

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.

public boolean isViewed ()

Returns
  • true if the document represented by this entry has been viewed by the user this feed request has been authenticated under.

public Boolean isWritersCanInvite ()

Returns a flag for whether writers can invite other collaborators

Returns
  • whether writers can invite

public void setDescription (String description)

Sets the description of this document.

Parameters
description The description

public void setFile (File file, String mimeType)

Associate a File with this entry with the specified mime type

Parameters
file
mimeType

public void setFile (File file)

This method is deprecated.
use setFile(File, String) instead.

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

Parameters
file

public void setFilename (String filename)

Sets the filename of this document.

Parameters
filename The filename

public void setHidden (boolean hidden)

Sets the hidden status of this document for the user this feed request has been authenticated under.

Parameters
hidden True if the document should be hidden

public void setLastCommented (DateTime lastCommented)

Sets the time when the document was last commented by the user.

Parameters
lastCommented The last commented time

public void setLastModifiedBy (LastModifiedBy lastModifiedBy)

Sets the amount of quota consumed by the document.

Parameters
lastModifiedBy The quota used

public void setLastViewed (DateTime lastViewed)

Sets the time when the document was last viewed by the user.

Parameters
lastViewed The last viewed time

public void setMd5Checksum (String md5Checksum)

Set the MD5 checksum calculated for the document.

Parameters
md5Checksum The MD5 checksum

public void setQuotaBytesUsed (Long quotaBytesUsed)

Sets the amount of quota consumed by the document.

Parameters
quotaBytesUsed The quota used

public void setResourceId (String resourceId)

Sets the document's resource id.

Parameters
resourceId The resource id.

public void setRestrictedDownload (boolean restrictedDownload)

Sets the restricted download status for this document.

Parameters
restrictedDownload true if the document has restricted downloading

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

public void setSuggestedFilename (String filename)

Sets the suggested filename for this document.

Parameters
filename The filename

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

public void setViewed (boolean viewed)

Sets the viewed status of this document for the user this feed request has been authenticated under.

Parameters
viewed True if the document has been viewed

public void setWritersCanInvite (Boolean writersCanInvite)

Sets whether users classed as writers can invite other collaborators

Parameters
writersCanInvite True if writers can invite

Protected Methods

protected static String getMimeTypeFromFileName (String fileName)

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

Parameters
fileName
Throws
IllegalArgumentException if the mime type is not known given the file name