List of usage examples for org.apache.hadoop.fs PathAccessDeniedException PathAccessDeniedException
public PathAccessDeniedException(String path)
From source file:org.apache.slider.core.exceptions.ExceptionConverter.java
License:Apache License
/** * Convert a Jersey Exception into an IOE or subclass * @param targetURL URL being targeted /*from w w w .j ava 2s . c o m*/ * @param exception original exception * @return a new exception, the original one nested as a cause */ public static IOException convertJerseyException(String targetURL, UniformInterfaceException exception) { IOException ioe = null; ClientResponse response = exception.getResponse(); if (response != null) { int status = response.getStatus(); if (status == 401) { ioe = new PathAccessDeniedException(targetURL); } if (status >= 400 && status < 500) { ioe = new FileNotFoundException(targetURL); } } if (ioe == null) { ioe = new IOException("Failed to GET " + targetURL + ": " + exception); } ioe.initCause(exception); return ioe; }