private FileOperationResult getFailureFileOperationResult(List<String> paths, int failedIndex, String message) {
    List<String> succeeded = new ArrayList<>();
    List<String> unprocessed = new ArrayList<>();
    List<String> failed = new ArrayList<>();
    ListIterator<String> iter = paths.listIterator();
    while (iter.hasNext()) {
      int index = iter.nextIndex();
      String path = iter.next();
      if (index < failedIndex) {
        succeeded.add(path);
      } else if (index == failedIndex) {
        failed.add(path);
      } else {
        unprocessed.add(path);
      }
    }
    return new FileOperationResult(false, message, succeeded, failed, unprocessed);
  }
Remove
@param request remove request
@return response with success
contrib/views/commons/src/main/java/org/apache/ambari/view/commons/hdfs/FileOperationService.java