private void processPlainFile(FileSystem hdfs, File f, Path outputPath,
      boolean skipExisting) throws IOException {
    long fileModTime = f.lastModified();
    Path targetDir = getTargetDirectory(hdfs, outputPath, fileModTime);

    boolean doCopy = true;
    Path sourceFile = new Path(f.getPath());
    if (skipExisting) {
      Path target = new Path(targetDir, sourceFile.getName());
      if (hdfs.exists(target)) {
        doCopy = false;
      }
    }
    if (doCopy) {
      hdfs.copyFromLocalFile(sourceFile, targetDir);
    }

  }
private void processPlainFile ( FileSystem hdfs , File f , Path outputPath , boolean skipExisting ) throws IOException { long fileModTime = f . lastModified ( ) ; Path targetDir = getTargetDirectory ( hdfs , outputPath , fileModTime ) ; boolean doCopy = true ; Path sourceFile = new Path ( f . getPath ( ) ) ; if ( skipExisting ) { Path target = new Path ( targetDir , sourceFile . getName ( ) ) ; if ( hdfs . exists ( target ) ) { doCopy = false ; } } if ( doCopy ) { hdfs . copyFromLocalFile ( sourceFile , targetDir ) ; } }
@param hdfs
FileSystem handle
@param f
file to copy to HDFS
@param outputPath
@param skipExisting
skip if the file already exist in the target. File will be
overwritten if already there and this argument is false.
@throws IOException
if target directory cannot be created or file cannot be copied to
target directory.