Examples of PathIOException


Examples of org.apache.hadoop.fs.shell.PathExceptions.PathIOException

   
    @Override
    protected void postProcessPath(PathData src) throws IOException {
      if (!src.fs.delete(src.path, false)) {
        // we have no way to know the actual error...
        PathIOException e = new PathIOException(src.toString());
        e.setOperation("remove");
        throw e;
      }
    }
View Full Code Here

Examples of org.apache.hadoop.fs.shell.PathExceptions.PathIOException

    }

    @Override
    protected void processPath(PathData src, PathData target) throws IOException {
      if (!src.fs.getUri().equals(target.fs.getUri())) {
        throw new PathIOException(src.toString(),
            "Does not match target filesystem");
      }
      if (!target.fs.rename(src.path, target.path)) {
        // we have no way to know the actual error...
        throw new PathIOException(src.toString());
      }
    }
View Full Code Here

Examples of org.apache.hadoop.fs.shell.PathExceptions.PathIOException

      // false and it falls thru to fs.delete.  this doesn't seem right
      if (moveToTrash(item)) {
        return;
      }
      if (!item.fs.delete(item.path, deleteDirs)) {
        throw new PathIOException(item.toString());
      }
      out.println("Deleted " + item);
    }
View Full Code Here

Examples of org.apache.hadoop.fs.shell.PathExceptions.PathIOException

      if (!item.stat.isDirectory()) {
        throw new PathIsNotDirectoryException(item.toString());
      }     
      if (item.fs.listStatus(item.path).length == 0) {
        if (!item.fs.delete(item.path, false)) {
          throw new PathIOException(item.toString());
        }
      } else if (!ignoreNonEmpty) {
        throw new PathIsNotEmptyDirectoryException(item.toString());
      }
    }
View Full Code Here

Examples of org.apache.hadoop.fs.shell.PathExceptions.PathIOException

  protected String path = "some/file";
  protected String error = "KABOOM";

  @Test
  public void testWithDefaultString() throws Exception {
    PathIOException pe = new PathIOException(path);
    assertEquals(new Path(path), pe.getPath());
    assertEquals("`" + path + "': Input/output error", pe.getMessage());
  }
View Full Code Here

Examples of org.apache.hadoop.fs.shell.PathExceptions.PathIOException

  }

  @Test
  public void testWithThrowable() throws Exception {
    IOException ioe = new IOException("KABOOM");   
    PathIOException pe = new PathIOException(path, ioe);
    assertEquals(new Path(path), pe.getPath());
    assertEquals("`" + path + "': Input/output error: " + error, pe.getMessage());
  }
View Full Code Here

Examples of org.apache.hadoop.fs.shell.PathExceptions.PathIOException

    assertEquals("`" + path + "': Input/output error: " + error, pe.getMessage());
  }

  @Test
  public void testWithCustomString() throws Exception {
    PathIOException pe = new PathIOException(path, error);
    assertEquals(new Path(path), pe.getPath());
    assertEquals("`" + path + "': " + error, pe.getMessage());
  }
View Full Code Here

Examples of org.apache.hadoop.fs.shell.PathExceptions.PathIOException

  }

  @Override
  protected void processNonexistentPath(PathData item) throws IOException {
    if (!item.fs.mkdirs(item.path)) {
      throw new PathIOException(item.toString());
    }
  }
View Full Code Here

Examples of org.apache.hadoop.fs.shell.PathExceptions.PathIOException

          throw new PathNotFoundException(pathString);
        case 1:
          dst = items[0];
          break;
        default:
          throw new PathIOException(pathString, "Too many matches");
      }
    }
  }
View Full Code Here

Examples of org.apache.hadoop.fs.shell.PathExceptions.PathIOException

    if (src.stat.isDirectory() && src.fs.equals(dst.fs)) {
      PathData target = getTargetPath(src);
      String srcPath = src.fs.makeQualified(src.path).toString();
      String dstPath = dst.fs.makeQualified(target.path).toString();
      if (dstPath.equals(srcPath)) {
        PathIOException e = new PathIOException(src.toString(),
            "are identical");
        e.setTargetPath(dstPath.toString());
        throw e;
      }
      if (dstPath.startsWith(srcPath+Path.SEPARATOR)) {
        PathIOException e = new PathIOException(src.toString(),
            "is a subdirectory of itself");
        e.setTargetPath(target.toString());
        throw e;
      }
    }
    super.processPathArgument(src);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.