com.atlassian.confluence.plugins.rest.resources
Class ContentResource

java.lang.Object
  extended by com.atlassian.confluence.plugins.rest.resources.AbstractResource
      extended by com.atlassian.confluence.plugins.rest.resources.ContentResource

public class ContentResource
extends AbstractResource

Rest resource for accessing Confluence content. Currently supports only read access for pages, blogs and comments.


Field Summary
 
Fields inherited from class com.atlassian.confluence.plugins.rest.resources.AbstractResource
authContext, uriInfo, userAccessor
 
Constructor Summary
ContentResource(UserAccessor userAccessor, RestContentManager restContentManager, SpacePermissionManager spacePermissionManager)
           
 
Method Summary
 javax.ws.rs.core.Response get()
          Returns HTTP 404 (not found) as there is no content to return if no ID is passed.
 javax.ws.rs.core.Response getAttachments(Long id, String startIndexString, String maxResultsString, Set<String> mime, Set<String> nice, boolean reverseOrder)
          Returns the attachments for a given resource.
 javax.ws.rs.core.Response getContent(Long id)
          Returns the content for the given ID.
 
Methods inherited from class com.atlassian.confluence.plugins.rest.resources.AbstractResource
createRequestContext, getAnonymousUserUriBuilder, getAttachmentUriBuilder, getContentUriBuilder, getCurrentUser, getMissingUserUriBuilder, getSpaceUriBuilder, getUserUriBuilder
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContentResource

public ContentResource(UserAccessor userAccessor,
                       RestContentManager restContentManager,
                       SpacePermissionManager spacePermissionManager)
Method Detail

get

public javax.ws.rs.core.Response get()
Returns HTTP 404 (not found) as there is no content to return if no ID is passed.

Returns:

getContent

public javax.ws.rs.core.Response getContent(Long id)
Returns the content for the given ID.

Parameters:
id -
Returns:

getAttachments

public javax.ws.rs.core.Response getAttachments(Long id,
                                                String startIndexString,
                                                String maxResultsString,
                                                Set<String> mime,
                                                Set<String> nice,
                                                boolean reverseOrder)
Returns the attachments for a given resource. The results are ordered by the creation date.

Parameters:
id - ID of resource (such as a page or blog post)
startIndexString - Index of first item (inclusive) to return.
maxResultsString - Maximum number of items to return. Default is 50.
mimeType - Mime types to filter the attachments by, such as: image/jpeg
attachmentType - 'Nice' type to filter the attachments by. Filtering is case insensititve. Can be one or more of: PDF, IMAGE, XML, HTML, TEXT, WORD, EXCEL, POWERPOINT, JAVA_SOURCE, JAVA_ARCHIVE, ZIP. You can specify multiple types like this: ?attachmentType=image&attachmentType=pdf
reverseOrder - set to true to have the results returned in reverse chronological order.
Returns:
attachmentEntityList


Copyright © 2003–2015 Atlassian. All rights reserved.