// This is to support a use case where a developer wants their resources to
// be accessible through milton-json, but don't want to use DAV urls. Instead
// they use a parameter and DO NOT implement PostableResource.
if (request.getMethod().equals(Method.POST)) {
Resource wrappedResource = wrapped.getResource(host, sPath);
if (wrappedResource != null && !(wrappedResource instanceof PostableResource)) {
LogUtils.trace(log, "getResource: is post, and got a: ", wrappedResource.getClass());
return new PostJsonResource(host, encodedPath, wrappedResource, methodParamName, this);
}
}
if (request.getMethod().equals(Method.GET) && isMatchingContentType(request.getAcceptHeader())) {
Resource wrappedResource = wrapped.getResource(host, sPath);
if (wrappedResource != null) {
log.trace("getResource: matches content type, and found wrapped resource");
return wrapResource(host, wrappedResource, Method.PROPFIND.code, encodedPath);
} else {
LogUtils.trace(log, "getResource: is GET and matched type, but found no actual resource on", sPath);
}
}
if (isMatchingPath(parent)) {
log.trace("getResource: is matching path");
Path resourcePath = parent.getParent();
if (resourcePath != null) {
String method = path.getName();
Resource wrappedResource = wrapped.getResource(host, resourcePath.toString());
if (wrappedResource != null) {
return wrapResource(host, wrappedResource, method, encodedPath);
}
}
} else {