Input is a regular directory (non-hdfs). Process files accordingly.

@param inputURI
@throws IOException
548740
private void processPlainFileSources(URI inputURI) throws IOException {
    LOG.info("Scheme specific part is: " + inputURI.getSchemeSpecificPart());

    File inputFile = new File(inputURI.getSchemeSpecificPart());

    // Check if input is a directory
    if (!inputFile.isDirectory()) {
      throw new IOException("Input is not a regular directory: " + input);
    }

    File[] files = inputFile.listFiles();
    int processedCount = 0;
    try {
      for (File f : files) {
        // Process only files, not (sub)directories.
        if (f.isFile()) {
          processPlainFile(hdfs, f, outputPath, skipExisting);
          processedCount++;
          // Print something each 100 files to show progress.
          if ((processedCount % 1000) == 0) {
            LOG.info("Processed " + processedCount + " files.");
          }
        }
      }
    } finally {
      LOG.info("Processed " + processedCount + " files.");
    }
  }
1022552
public void mkdirs() throws IOException {
        if ((!getParent().equals(separator)) && (!getParentFile().exists())) {
            getParentFile().mkdirs();
        }
        mkdir();
    }
1111501
public final URI toUri(
      URI fileSystemUri, String root, Iterable<String> names, boolean directory) {
    String path = toUriPath(root, names, directory);
    try {
      // it should not suck this much to create a new URI that's the same except with a path set =(
      // need to do it this way for automatic path escaping
      return new URI(
          fileSystemUri.getScheme(),
          fileSystemUri.getUserInfo(),
          fileSystemUri.getHost(),
          fileSystemUri.getPort(),
          path,
          null,
          null);
    } catch (URISyntaxException e) {
      throw new AssertionError(e);
    }
  }
226947
@Override
    public void watchInputSource(String inputSource) {
        File file = new File(inputSource);
        if (!file.exists()) {
            log.warn(MessageManager.getMessage("filewatcher.fileNotFound"), file.getAbsolutePath());
            return;
        }
        if (watchingFileMap.containsKey(file.getAbsolutePath())) {
            return;
        }
        log.info(MessageManager.getMessage("filewatcher.addFile"), file.getAbsolutePath());
        watchingFileMap.put(file.getAbsolutePath(),
                new InputSource(inputSource, file.lastModified()));

        File dir = file.getParentFile();
        if (watchingDirSet.contains(dir.getAbsolutePath())) {
            return;
        }
        log.info(MessageManager.getMessage("filewatcher.addDirectory"), dir.getAbsolutePath());
        watchingDirSet.add(dir.getAbsolutePath());

        Path dirPath = dir.toPath();

        try {
            if (watcher == null) {
                // TODO ファイル監視方式の統一
                watcher = FileSystems.getDefault().newWatchService();
            }
            WatchKey watchKey = dirPath.register(watcher, StandardWatchEventKinds.ENTRY_MODIFY);
            pathMap.put(watchKey, dirPath);
        } catch (IOException e) {
            throw new IllegalStateException(e);
        }
    }
525071
private Input processRegularFileInput(String input) throws IOException {
    File inputFile = new File(input);
    if (!inputFile.exists()) {
      throw new IOException("Input does not exist: " + input);
    }
    if (pipeFiles) {
      SamReader samReader = SamReaderFactory.makeDefault().open(inputFile);
      return new Input(input, STDIN_FILE_NAME, 
          new SamReaderToSAMFilePump(samReader)); 
    } else {
      return new Input(input, input, null);
    }
  }
723451
@Override
	public FileInputSplit[] createInputSplits(int minNumSplits) throws IOException {
		int numAvroFiles = 0;
		final Path path = this.filePath;
		// get all the files that are involved in the splits
		final FileSystem fs = path.getFileSystem();
		final FileStatus pathFile = fs.getFileStatus(path);

		if (!acceptFile(pathFile)) {
			throw new IOException("The given file does not pass the file-filter");
		}
		if (pathFile.isDir()) {
			// input is directory. list all contained files
			final FileStatus[] dir = fs.listStatus(path);
			for (int i = 0; i < dir.length; i++) {
				if (!dir[i].isDir() && acceptFile(dir[i])) {
					numAvroFiles++;
				}
			}
		} else {
			numAvroFiles = 1;
		}
		return super.createInputSplits(numAvroFiles);
	}
628003
public static void readRAMFiles(DataInput in, RAMDirectory dir)
      throws IOException {
    int numFiles = in.readInt();

    for (int i = 0; i < numFiles; i++) {
      String name = Text.readString(in);
      long length = in.readLong();

      if (length > 0) {
        // can we avoid the extra copy?
        IndexOutput output = null;
        try {
          output = dir.createOutput(name);

          int position = 0;
          byte[] buffer = new byte[BUFFER_SIZE];

          while (position < length) {
            int len =
                position + BUFFER_SIZE <= length ? BUFFER_SIZE
                    : (int) (length - position);
            in.readFully(buffer, 0, len);
            output.writeBytes(buffer, 0, len);
            position += len;
          }
        } finally {
          if (output != null) {
            output.close();
          }
        }
      }
    }
  }
1200151
protected void processLAandLI(File archive, RepositoryResourceWritable resource,
                                  ProvisioningFeatureDefinition feature) throws IOException, RepositoryException {
        String LAHeader = feature.getHeader(LA_HEADER_FEATURE);
        String LIHeader = feature.getHeader(LI_HEADER_FEATURE);
        processLAandLI(archive, resource, LAHeader, LIHeader);
    }
610777
public static URI create(String input) {
        if (isFile(input) || isURL(input)) {
            return URI.create(input);
        } else {
            return Paths.get(input).toUri();
        }
    }
988115
private static void createInputDirectory(FileSystem fs, 
                                           Path dir,
                                           Pentomino pent,
                                           int depth
                                           ) throws IOException {
    fs.mkdirs(dir);
    List<int[]> splits = pent.getSplits(depth);
    PrintStream file = 
      new PrintStream(new BufferedOutputStream
                      (fs.create(new Path(dir, "part1")), 64*1024));
    for(int[] prefix: splits) {
      for(int i=0; i < prefix.length; ++i) {
        if (i != 0) {
          file.print(',');          
        }
        file.print(prefix[i]);
      }
      file.print('\n');
    }
    file.close();
  }
1264625
public static void deleteDirectory(Path dir) throws IOException {
		if(dir == null || !Files.exists(dir))
			return;
		Files.walkFileTree(dir, new SimpleFileVisitor<Path>() {
	        @Override
	        public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
	            Files.delete(file);
	            return FileVisitResult.CONTINUE;
	        }

	        @Override
	        public FileVisitResult postVisitDirectory(Path dir, IOException e) throws IOException {
	            if (e != null) {
	                throw e;
	            }
	            Files.delete(dir);
	            return FileVisitResult.CONTINUE;
	        }
	    });
	}
294901
@Override
    public void checkRepositoryStatus() throws IOException {
        if (!exists(null)) {
            throw new FileNotFoundException("Could not find " + _root);
        }
        if (!hasChildren(null)) {
            throw new IOException("The root (" + _root + " is not a directory ");
        }
    }
247990
@Override
    public void checkRepositoryStatus() throws IOException {
        for (File f : assets) {
            if (!f.exists()) {
                throw new FileNotFoundException("Could not find " + f + " in the LooseFileRepository");
            }
        }
    }
1241820
public void file(String filename, InputStream input) {
        checkCommitted();

        // content type to OCTET_STREAM if it's not set
        if (getContentType() == null) {
            contentType(mimeTypes.getContentType(filename, HttpConstants.ContentType.APPLICATION_OCTET_STREAM));
        }

        if (isHeaderEmpty(HttpConstants.Header.CONTENT_DISPOSITION)) {
            filenameHeader(filename);
        }

        finalizeResponse();

        try {
            send(input);
        } catch (IOException e) {
            throw new PippoRuntimeException(e);
        }
    }
265416
function preprocessInputText(inputText, currentDirectory) {
  var processDirectory = process.cwd(),
      importedFilePaths = [];

  // If the file name is an absolute path, returns it normailzed. If it is
  // a relative path starting with "./" or "../", appends it to the path
  // of the parent file, which the specified file is being expanded to.
  // Otherwise the relative path is  appended to the current directory.
  function completeFilePath(fileName, currentDirectory) {
    var directory;
    if (!path.isAbsolute(fileName)) {
      fileName = fileName.replace(/\\/g, '/');
      if (fileName.indexOf('./') === 0 ||
          fileName.indexOf('../') === 0) {
        directory = currentDirectory;
      } else {
        directory = processDirectory;
      }
      fileName = path.join(directory, fileName);
    }
    return path.resolve(path.normalize(fileName));
  }

  function expandFileImports(inputText, currentDirectory) {
    return inputText.replace(/#import: *(.*)/g, function (all, fileName) {
      fileName = completeFilePath(fileName, currentDirectory);
      if (importedFilePaths.indexOf(fileName) >= 0) {
        return '';
      }
      importedFilePaths.push(fileName);
      return expandFileImports(
          fs.readFileSync(fileName, {encoding: 'utf8'}),
          path.dirname(fileName));
    });
  }

  return expandFileImports(inputText, currentDirectory || processDirectory);
}
1035270
public void setInput(final String input) {
        if (input == null) {
            throw (new IllegalArgumentException(
                    "You must provide a COBOL source folder or file"));
        }
        File file = new File(input);
        if (file.exists()) {
            if (file.isDirectory() && file.list().length == 0) {
                throw new IllegalArgumentException("Folder " + input
                        + " is empty");
            }
        } else {
            throw new IllegalArgumentException("Input file or folder " + input
                    + " not found");
        }
        _input = file;
    }
521429
private void validate(File root, Collection<URI> dirs) throws IOException {
    if (dirs == null)
      return;
    for (URI dir : dirs) {
      if (new File(dir.getPath()).getAbsolutePath().equals(
          root.getAbsolutePath())) {
        // we found the corresponding entry
        return;
      }
    }
    throwIOException("Error. Storage directory: " + root
        + " is not in the configured list of storage directories: " + dirs);
  }