mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Added getDirectoryListingDirect() and getDeleted() to AVMService
interface. These return respectively those nodes directly contained by a directory and the names of those nodes that have been deleted in a directory. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@3383 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -245,6 +245,38 @@ class AVMServiceImpl implements AVMService
|
||||
return doit.listing;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the listing of nodes contained directly in a directory. This is the
|
||||
* same as getDirectoryListing for PlainDirectories, but returns only those that
|
||||
* are directly contained in a layered directory.
|
||||
* @param version The version to look up.
|
||||
* @param path The full path to get listing for.
|
||||
* @return A Map of names to descriptors.
|
||||
* @throws AVMNotFoundException If <code>path</code> does not exist.
|
||||
* @throws AVMWrongTypeException If <code>path</code> contains any non-directory
|
||||
* elements.
|
||||
*/
|
||||
public SortedMap<String, AVMNodeDescriptor>
|
||||
getDirectoryListingDirect(final int version, final String path)
|
||||
{
|
||||
if (path == null)
|
||||
{
|
||||
throw new AVMBadArgumentException("Null path.");
|
||||
}
|
||||
class TxnCallback implements RetryingTransactionCallback
|
||||
{
|
||||
public SortedMap<String, AVMNodeDescriptor> listing;
|
||||
|
||||
public void perform()
|
||||
{
|
||||
listing = fAVMRepository.getListingDirect(version, path);
|
||||
}
|
||||
}
|
||||
TxnCallback doit = new TxnCallback();
|
||||
fTransaction.perform(doit, false);
|
||||
return doit.listing;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a directory listing from a node descriptor.
|
||||
* @param dir The directory node descriptor.
|
||||
@@ -270,6 +302,35 @@ class AVMServiceImpl implements AVMService
|
||||
return doit.listing;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the names of nodes that have been deleted in a directory.
|
||||
* @param version The version to look under.
|
||||
* @param path The path of the directory.
|
||||
* @return A List of names.
|
||||
* @throws AVMNotFoundException If <code>path</code> does not exist.
|
||||
* @throws AVMWrongTypeException If <code>path</code> contains any elements
|
||||
* that are not directories.
|
||||
*/
|
||||
public List<String> getDeleted(final int version, final String path)
|
||||
{
|
||||
if (path == null)
|
||||
{
|
||||
throw new AVMBadArgumentException("Null path.");
|
||||
}
|
||||
class TxnCallback implements RetryingTransactionCallback
|
||||
{
|
||||
public List<String> listing;
|
||||
|
||||
public void perform()
|
||||
{
|
||||
listing = fAVMRepository.getDeleted(version, path);
|
||||
}
|
||||
}
|
||||
TxnCallback doit = new TxnCallback();
|
||||
fTransaction.perform(doit, false);
|
||||
return doit.listing;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new file. The file must not exist.
|
||||
* @param path The path to the containing directory.
|
||||
|
Reference in New Issue
Block a user