* source = DataSourceManager.getSource(sourceName); if (source ==
* null) source = AliasIds.getAliasHandler(sourceName); } else
* source = null;
*/
String method = request.getMethod().toUpperCase();
Identification targetId = Identification.idForString(path);
if (log.isDebugEnabled()) {
log.debug("Identification targetId:" + targetId);
log.debug("Request Method: " + method);
}
reason = null;
if ("GET".equals(method) || "POST".equals(method)) {
// allow the HTTP method to be defined with a parameter
String explicitMethod = getHeader(request, "method");
if (explicitMethod != null)
method = explicitMethod;
else if ("GET".equals(method))
// if there is not explicit method, than we can assume cookie authorization is allowed
requestHelper.authorizeCookieAuthentication();
}
try {
if (targetId instanceof ObjectNotFoundId ||
(targetId.getSource() instanceof LocalDataSource && ((LocalDataSource) targetId.getSource()).passThrough()) ||
("GET".equals(method) && !objectExistsForId(targetId))) {
if ("PUT".equals(method)) {
if (UserSecurity.hasPermission(SystemPermission.javaScriptCoding)) {
// if the user has permission they can also update files with PUT
File targetFile = new File(((HttpServletRequest) request).getRealPath(path));