Java Code Examples for org.apache.hadoop.security.AccessControlException#getMessage()

The following examples show how to use org.apache.hadoop.security.AccessControlException#getMessage() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DistributedFileSystemMetadata.java    From hdfs-metadata with GNU General Public License v3.0 5 votes vote down vote up
private int hasNextCode(RemoteIterator<LocatedFileStatus> statuses) throws IOException {
	try {
		if(statuses.hasNext())
			return 1;
		else
			return 0;
	} catch (AccessControlException e) {
		String message = e.getMessage();

		LOG.warn("Skipped file or directory because: " + message.substring(0, message.indexOf("\n")));
		
		return 2;
	}
}
 
Example 2
Source File: HadoopFileSystemImpl.java    From pentaho-hadoop-shims with Apache License 2.0 5 votes vote down vote up
public <T> T callAndWrapExceptions( IOExceptionCallable<T> ioExceptionCallable ) throws IOException {
  try {
    return ioExceptionCallable.call();
  } catch ( AccessControlException e ) {
    throw new org.pentaho.hadoop.shim.api.hdfs.exceptions.AccessControlException( e.getMessage(), e );
  }
}