org.pentaho.platform.repository2.unified.jcr
Interface IDeleteHelper

All Known Implementing Classes:
DefaultDeleteHelper

public interface IDeleteHelper

Handles delete, undelete, and permanent delete. Handles listing deleted files and purging some or all deleted files.

Author:
mlowery

Method Summary
 void deleteFile(javax.jcr.Session session, PentahoJcrConstants pentahoJcrConstants, Serializable fileId)
          Deletes a file in a way that it can be recovered.
 List<RepositoryFile> getDeletedFiles(javax.jcr.Session session, PentahoJcrConstants pentahoJcrConstants)
          Lists deleted files for this user.
 List<RepositoryFile> getDeletedFiles(javax.jcr.Session session, PentahoJcrConstants pentahoJcrConstants, Serializable folderId, String filter)
          Lists deleted files for this folder and user.
 Serializable getOriginalParentFolderId(javax.jcr.Session session, PentahoJcrConstants pentahoJcrConstants, Serializable fileId)
          Returns the ID of the original parent folder.
 void permanentlyDeleteFile(javax.jcr.Session session, PentahoJcrConstants pentahoJcrConstants, Serializable fileId)
          Deletes a file in a way that it cannot be recovered.
 void undeleteFile(javax.jcr.Session session, PentahoJcrConstants pentahoJcrConstants, Serializable fileId)
          Recovers a deleted file to its original location.
 

Method Detail

deleteFile

void deleteFile(javax.jcr.Session session,
                PentahoJcrConstants pentahoJcrConstants,
                Serializable fileId)
                throws javax.jcr.RepositoryException
Deletes a file in a way that it can be recovered.

Parameters:
fileId -
Throws:
javax.jcr.RepositoryException

undeleteFile

void undeleteFile(javax.jcr.Session session,
                  PentahoJcrConstants pentahoJcrConstants,
                  Serializable fileId)
                  throws javax.jcr.RepositoryException
Recovers a deleted file to its original location.

Parameters:
fileId -
Throws:
javax.jcr.RepositoryException

permanentlyDeleteFile

void permanentlyDeleteFile(javax.jcr.Session session,
                           PentahoJcrConstants pentahoJcrConstants,
                           Serializable fileId)
                           throws javax.jcr.RepositoryException
Deletes a file in a way that it cannot be recovered. (Note that "cannot be recovered" doesn't mean "shred"--it means that the file cannot be recovered using this API.)

Parameters:
fileId -
Throws:
javax.jcr.RepositoryException

getDeletedFiles

List<RepositoryFile> getDeletedFiles(javax.jcr.Session session,
                                     PentahoJcrConstants pentahoJcrConstants,
                                     Serializable folderId,
                                     String filter)
                                     throws javax.jcr.RepositoryException
Lists deleted files for this folder and user.

Parameters:
folderId -
filter - filter may be a full name or a partial name with one or more wildcard characters ("*")
Returns:
list of deleted files IDs for this folder and user
Throws:
javax.jcr.RepositoryException

getDeletedFiles

List<RepositoryFile> getDeletedFiles(javax.jcr.Session session,
                                     PentahoJcrConstants pentahoJcrConstants)
                                     throws javax.jcr.RepositoryException
Lists deleted files for this user. In this case, the path field of each file is the original path where it was located prior to deletion. This is the "recycle bin" view.

Returns:
list of deleted files for this user
Throws:
javax.jcr.RepositoryException

getOriginalParentFolderId

Serializable getOriginalParentFolderId(javax.jcr.Session session,
                                       PentahoJcrConstants pentahoJcrConstants,
                                       Serializable fileId)
                                       throws javax.jcr.RepositoryException
Returns the ID of the original parent folder. Can be used by caller to checkout parent folder before calling undeleteFile(Session, PentahoJcrConstants, Serializable).

Parameters:
fileId - file id of deleted file
Throws:
javax.jcr.RepositoryException