ccc.api.jaxrs
Class FilesImpl

java.lang.Object
  extended by ccc.api.jaxrs.JaxrsCollection
      extended by ccc.api.jaxrs.FilesImpl
All Implemented Interfaces:
Files

public class FilesImpl
extends JaxrsCollection
implements Files

Implementation of the Files API.

Author:
Civic Computing Ltd.

Field Summary
 
Fields inherited from interface ccc.api.core.Files
NAME
 
Constructor Summary
FilesImpl(Files files)
          Constructor.
 
Method Summary
 ResourceSummary create(File file)
          Create a new CCC file.
 ResourceSummary createTextFile(File textFile)
          Create a new text file in CCC.
 PagedCollection<File> getPagedImages(java.util.UUID folderId, int pageNo, int pageSize)
          List all images of the given folder id.
 File retrieve(java.util.UUID fileId)
          Get the representation of an existing CCC file.
 void retrieve(java.util.UUID file, StreamAction action)
          Process the contents of a file with an action.
 void retrieveRevision(java.util.UUID file, int revision, StreamAction action)
          Process the contents of a file revision with an action.
 void retrieveWorkingCopy(java.util.UUID file, StreamAction action)
          Process the contents of a file's working copy with an action.
 void update(java.util.UUID id, File file)
          Update an existing CCC file.
 ResourceSummary updateFile(java.util.UUID fileId, File file)
          Update an existing CCC file.
 
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

FilesImpl

public FilesImpl(Files files)
Constructor.

Parameters:
files - The files implementation delegated to.
Method Detail

retrieve

public File retrieve(java.util.UUID fileId)
Get the representation of an existing CCC file.

Specified by:
retrieve in interface Files
Parameters:
fileId - The ID of the file to get.
Returns:
The file for the specified ID.

update

public void update(java.util.UUID id,
                   File file)
Update an existing CCC file.

Specified by:
update in interface Files
Parameters:
id - The ID of the file to update.
file - The new file representation.

createTextFile

public ResourceSummary createTextFile(File textFile)
Create a new text file in CCC.

Specified by:
createTextFile in interface Files
Parameters:
textFile - The textFile details.
Returns:
A resource summary describing the new text file.

getPagedImages

public PagedCollection<File> getPagedImages(java.util.UUID folderId,
                                            int pageNo,
                                            int pageSize)
List all images of the given folder id.

Specified by:
getPagedImages in interface Files
Parameters:
folderId - The id of the folder.
pageNo - The page to display.
pageSize - The number of results per page.
Returns:
The list of images.

create

public ResourceSummary create(File file)
Create a new CCC file.

Specified by:
create in interface Files
Parameters:
file - The file to create.
Returns:
A summary of the newly created file.

retrieve

public void retrieve(java.util.UUID file,
                     StreamAction action)
Process the contents of a file with an action.

Specified by:
retrieve in interface Files
Parameters:
file - The file's ID.
action - The action to perform.

retrieveRevision

public void retrieveRevision(java.util.UUID file,
                             int revision,
                             StreamAction action)
Process the contents of a file revision with an action.

Specified by:
retrieveRevision in interface Files
Parameters:
file - The file's ID.
revision - The file revision to retrieve.
action - The action to perform.

retrieveWorkingCopy

public void retrieveWorkingCopy(java.util.UUID file,
                                StreamAction action)
Process the contents of a file's working copy with an action.

Specified by:
retrieveWorkingCopy in interface Files
Parameters:
file - The file's ID.
action - The action to perform.

updateFile

public ResourceSummary updateFile(java.util.UUID fileId,
                                  File file)
Update an existing CCC file.

Specified by:
updateFile in interface Files
Parameters:
fileId - The id of the file to update.
file - The changes to apply.
Returns:
A summary of the updated file.


Copyright © 2010. All Rights Reserved.