mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
Merged HEAD (5.2) to 5.2.N (5.2.1)
126536 jkaabimofrad: Merged FILE-FOLDER-API (5.2.0) to HEAD (5.2) 123214 gjames: RA-812: Changed http 400 to 404 git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@126880 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -32,7 +32,6 @@ import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import org.alfresco.rest.framework.Api;
|
||||
import org.alfresco.rest.framework.core.exceptions.InvalidArgumentException;
|
||||
import org.alfresco.rest.framework.core.exceptions.NotFoundException;
|
||||
import org.alfresco.rest.framework.core.exceptions.UnsupportedResourceOperationException;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
@@ -53,20 +52,20 @@ public class ResourceLookupDictionary implements ResourceLocator
|
||||
private ResourceDictionary dictionary;
|
||||
|
||||
@Override
|
||||
public ResourceWithMetadata locateEntityResource(Api api, String entityResource, HttpMethod httpMethod) throws InvalidArgumentException, UnsupportedResourceOperationException
|
||||
public ResourceWithMetadata locateEntityResource(Api api, String entityResource, HttpMethod httpMethod) throws NotFoundException, UnsupportedResourceOperationException
|
||||
{
|
||||
return locateRelationResource(api, entityResource, (String)null, httpMethod);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResourceWithMetadata locateRelationPropertyResource(Api api, String entityResource, String relationResource, String property, HttpMethod httpMethod) throws InvalidArgumentException,UnsupportedResourceOperationException
|
||||
public ResourceWithMetadata locateRelationPropertyResource(Api api, String entityResource, String relationResource, String property, HttpMethod httpMethod) throws NotFoundException,UnsupportedResourceOperationException
|
||||
{
|
||||
String resourceKey = ResourceDictionary.resourceKey(entityResource, relationResource);
|
||||
String propertyResourceKey = ResourceDictionary.propertyResourceKey(resourceKey, property);
|
||||
Map<String, ResourceWithMetadata> apiResources = dictionary.getAllResources().get(api);
|
||||
if (apiResources == null)
|
||||
{
|
||||
throw new InvalidArgumentException(InvalidArgumentException.DEFAULT_INVALID_API);
|
||||
throw new NotFoundException(NotFoundException.DEFAULT_MESSAGE_ID);
|
||||
}
|
||||
|
||||
ResourceWithMetadata resource = apiResources.get(propertyResourceKey);
|
||||
@@ -78,12 +77,12 @@ public class ResourceLookupDictionary implements ResourceLocator
|
||||
}
|
||||
|
||||
logger.warn("Unable to locate resource resource for :"+entityResource+" "+relationResource==null?"":relationResource+" "+property==null?"":property);
|
||||
throw new InvalidArgumentException("Unable to locate resource resource for :"+entityResource+" "+(relationResource==null?"":relationResource+" "+property==null?"":property));
|
||||
throw new NotFoundException("Unable to locate resource resource for :"+entityResource+" "+(relationResource==null?"":relationResource+" "+property==null?"":property));
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResourceWithMetadata locateRelationResource(Api api, String entityResource, String relationResource, HttpMethod httpMethod) throws InvalidArgumentException,UnsupportedResourceOperationException
|
||||
public ResourceWithMetadata locateRelationResource(Api api, String entityResource, String relationResource, HttpMethod httpMethod) throws NotFoundException,UnsupportedResourceOperationException
|
||||
{
|
||||
String resourceKey = ResourceDictionary.resourceKey(entityResource, relationResource);
|
||||
if (logger.isDebugEnabled())
|
||||
@@ -93,7 +92,7 @@ public class ResourceLookupDictionary implements ResourceLocator
|
||||
Map<String, ResourceWithMetadata> apiResources = dictionary.getAllResources().get(api);
|
||||
if (apiResources == null)
|
||||
{
|
||||
throw new InvalidArgumentException(InvalidArgumentException.DEFAULT_INVALID_API);
|
||||
throw new NotFoundException(NotFoundException.DEFAULT_MESSAGE_ID);
|
||||
}
|
||||
ResourceWithMetadata resource = apiResources.get(resourceKey);
|
||||
if (resource == null)
|
||||
@@ -111,7 +110,7 @@ public class ResourceLookupDictionary implements ResourceLocator
|
||||
}
|
||||
}
|
||||
logger.warn("Unable to locate resource resource for :"+entityResource+" "+relationResource==null?"":relationResource);
|
||||
throw new InvalidArgumentException("Unable to locate resource resource for :"+entityResource+" "+(relationResource==null?"":relationResource));
|
||||
throw new NotFoundException("Unable to locate resource resource for :"+entityResource+" "+(relationResource==null?"":relationResource));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Reference in New Issue
Block a user