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

@@ -29,6 +29,7 @@ import java.util.Locale;
import java.util.StringTokenizer;
import org.alfresco.i18n.I18NUtil;
import org.alfresco.repo.content.AbstractContentStore;
import org.alfresco.service.cmr.repository.datatype.DefaultTypeConverter;
import org.alfresco.util.EqualsHelper;
@@ -239,6 +240,14 @@ public class ContentData implements Serializable
}
}
}
// Check that the protocol separator is present
if (contentUrl != null && !AbstractContentStore.isValidContentUrl(contentUrl))
{
throw new IllegalArgumentException(
"The content URL must be of the form 'protocol://identifier': \n" +
" Content URL: " + contentUrl);
}
// check that mimetype is present if URL is present
if (mimetype == null)
{