Allow other types of content URLs other than store://...

Enforce restriction that all content URLs must be of form protocol://identifier
Allow for read-only stores.
Improved tests so that it is easier, when writing a new store, to determine if the store is compliant or not.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5899 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2007-06-09 00:43:02 +00:00
parent 9b03b15674
commit f30ccf8d6c
28 changed files with 1685 additions and 628 deletions

View File

@@ -40,6 +40,7 @@ import org.alfresco.repo.transaction.TransactionUtil.TransactionWork;
import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
import org.alfresco.service.cmr.dictionary.DictionaryService;
import org.alfresco.service.cmr.repository.ContentData;
import org.alfresco.service.cmr.repository.ContentIOException;
import org.alfresco.service.cmr.repository.ContentReader;
import org.alfresco.service.transaction.TransactionService;
import org.alfresco.util.PropertyCheck;
@@ -220,7 +221,16 @@ public class ContentStoreCleaner
// now clean each store in turn
for (ContentStore store : stores)
{
clean(validUrls, store);
try
{
clean(validUrls, store);
}
catch (UnsupportedOperationException e)
{
throw new ContentIOException(
"Unable to clean store as the necessary operations are not supported: " + store,
e);
}
}
}

View File

@@ -88,7 +88,7 @@ public class ContentStoreCleanerTest extends TestCase
{
cleaner.setProtectDays(0);
// add some content to the store
ContentWriter writer = store.getWriter(null, null);
ContentWriter writer = store.getWriter(ContentStore.NEW_CONTENT_CONTEXT);
writer.putContent("ABC");
String contentUrl = writer.getContentUrl();
@@ -104,7 +104,7 @@ public class ContentStoreCleanerTest extends TestCase
{
cleaner.setProtectDays(1);
// add some content to the store
ContentWriter writer = store.getWriter(null, null);
ContentWriter writer = store.getWriter(ContentStore.NEW_CONTENT_CONTEXT);
writer.putContent("ABC");
String contentUrl = writer.getContentUrl();