ccc.api.jaxrs
Class FoldersImpl

java.lang.Object
  extended by ccc.api.jaxrs.JaxrsCollection
      extended by ccc.api.jaxrs.FoldersImpl
All Implemented Interfaces:
Folders

public class FoldersImpl
extends JaxrsCollection
implements Folders

Implementation of the Folders interface.

Author:
Civic Computing Ltd.

Field Summary
 
Fields inherited from interface ccc.api.core.Folders
NAME
 
Constructor Summary
FoldersImpl(Folders delegate)
          Constructor.
 
Method Summary
 ResourceSummary create(Folder folder)
          Create a folder with the specified name.
 ResourceSummary createFolder(java.util.UUID parentId, java.lang.String name, java.lang.String title, boolean publish)
          Create a folder with the specified name and title.
 ResourceSummary createRoot(java.lang.String name)
          Create a root folder with the specified name.
 PagedCollection<ResourceSummary> getAccessibleChildren(java.util.UUID folderId)
          List all of the children of the specified folder which are accessible to current user.
 java.lang.Boolean nameExistsInFolder(java.util.UUID folderId, java.lang.String name)
          Query whether given folder has a resource with given name.
 PagedCollection<ResourceSummary> roots()
          List the root folders available.
 void update(java.util.UUID folderId, Folder delta)
          Update the specified folder.
 
Methods inherited from class ccc.api.jaxrs.JaxrsCollection
convertException
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FoldersImpl

public FoldersImpl(Folders delegate)
Constructor.

Parameters:
delegate - The folders implementation delegated to.
Method Detail

getAccessibleChildren

public PagedCollection<ResourceSummary> getAccessibleChildren(java.util.UUID folderId)
List all of the children of the specified folder which are accessible to current user.

Specified by:
getAccessibleChildren in interface Folders
Parameters:
folderId - The folder.
Returns:
The folder's of children.

nameExistsInFolder

public java.lang.Boolean nameExistsInFolder(java.util.UUID folderId,
                                            java.lang.String name)
Query whether given folder has a resource with given name.

Specified by:
nameExistsInFolder in interface Folders
Parameters:
folderId - The id of the folder to check.
name - The name of the resource.
Returns:
Returns true in case folder has a resource with given name, false otherwise.

roots

public PagedCollection<ResourceSummary> roots()
List the root folders available.

Specified by:
roots in interface Folders
Returns:
A collection of resource summaries - one for each root folder.

create

public ResourceSummary create(Folder folder)
Create a folder with the specified name.

Specified by:
create in interface Folders
Parameters:
folder - Details of the new folder.
Returns:
A resource summary describing the new folder.

update

public void update(java.util.UUID folderId,
                   Folder delta)
Update the specified folder.

Specified by:
update in interface Folders
Parameters:
folderId - The id of the folder to update.
delta - The updated details of the folder.

createFolder

public ResourceSummary createFolder(java.util.UUID parentId,
                                    java.lang.String name,
                                    java.lang.String title,
                                    boolean publish)
Create a folder with the specified name and title.

Specified by:
createFolder in interface Folders
Parameters:
parentId - The folder in which the new folder should be created.
name - The name of the new folder.
title - The title of the folder.
publish - True if the title should be published, false otherwise.
Returns:
A resource summary describing the new folder.

createRoot

public ResourceSummary createRoot(java.lang.String name)
Create a root folder with the specified name.

Specified by:
createRoot in interface Folders
Parameters:
name - The name of the root folder.
Returns:
A resource summary describing the new root.


Copyright © 2010. All Rights Reserved.