/** * Get the input paths from an {@link InOutToolOptions}. This will resolve the input path * and return either a {@link Path} object representing the string * or, if the path string is a directory, a list of {@link Path}s * representing all the "part" files. * @param options the {@link InOutToolOptions}. * @return the input path * @throws IOException */ public static Path[] getInputPaths(InOutToolOptions options) throws IOException { return SequenceFileUtility.getFilePaths(options.getAllInputs(), "part"); }
/** * Get the input paths from an {@link InOutToolOptions}. This will resolve the input path * and return either a {@link Path} object representing the string * or, if the path string is a directory, a list of {@link Path}s * representing all the "part" files. * @param options the {@link InOutToolOptions}. * @return the input path * @throws IOException */ public static Path[] getInputPaths(InOutToolOptions options) throws IOException { return SequenceFileUtility.getFilePaths(options.getAllInputs(), "part"); }
/** * @param tool * @throws CmdLineException */ public static void validateInput(InOutToolOptions tool) throws CmdLineException { try { FileSystem fs = null ; if(tool.getAllInputs() == null) throw new IOException(); for (String input : tool.getAllInputs()) { URI outuri = SequenceFileUtility.convertToURI(input); if(fs == null) fs = getFileSystem(outuri); if(!fs.exists(new Path(outuri.toString()))) throw new CmdLineException(null, "Couldn't find input file"); } } catch (IOException e) { throw new CmdLineException(null, "Couldn't find input file filesystem"); } }
/** * @param tool * @throws CmdLineException */ public static void validateInput(InOutToolOptions tool) throws CmdLineException { try { FileSystem fs = null ; if(tool.getAllInputs() == null) throw new IOException(); for (String input : tool.getAllInputs()) { URI outuri = SequenceFileUtility.convertToURI(input); if(fs == null) fs = getFileSystem(outuri); if(!fs.exists(new Path(outuri.toString()))) throw new CmdLineException(null, "Couldn't find input file"); } } catch (IOException e) { throw new CmdLineException(null, "Couldn't find input file filesystem"); } }
toret.add(f); } else { String[] allinputs = tool.getAllInputs(); for (String floc : allinputs) { File f = new File(floc);
toret.add(f); } else { String[] allinputs = tool.getAllInputs(); for (String floc : allinputs) { File f = new File(floc);