@Override public void copyFromFileSystem(final String hdfsPath, final File localPath) { if (isRunningAsUser()) { super.copyFromFileSystem(hdfsPath, localPath); return; } UserGroupInformation uig = getCurrentUserGroup(); try { // if(true) throw new UnsupportedOperationException("Uncomment when using version // 1.0.*"); uig.doAs( new PrivilegedExceptionAction<Void>() { public Void run() throws Exception { FileSystem fileSystem = getDFS(); Path src = new Path(hdfsPath); Path dst = new Path(localPath.getAbsolutePath()); fileSystem.copyToLocalFile(src, dst); return null; } }); } catch (Exception e) { throw new RuntimeException( "Failed to copyFromFileSystem because " + e.getMessage() + " exception of class " + e.getClass(), e); } }