/** * Get the output path from an {@link InOutToolOptions}. * @param options the {@link InOutToolOptions}. * @return the output path. */ public static Path getOutputPath(InOutToolOptions options) { return new Path(options.getOutput()); }
/** * Get the output path from an {@link InOutToolOptions}. * @param options the {@link InOutToolOptions}. * @return the output path. */ public static Path getOutputPath(InOutToolOptions options) { return new Path(options.getOutput()); }
/** * * @param tool options to get data from * @throws CmdLineException */ public static void validateOutput(InOutToolOptions tool) throws CmdLineException { try { if(tool.getOutput() == null) throw new CmdLineException(null,"No Output Specified"); URI outuri = SequenceFileUtility.convertToURI(tool.getOutput()); FileSystem fs = getFileSystem(outuri); Path p = new Path(outuri.toString()); if(fs.exists(p)) { if(tool.overwriteOutput()) { fs.delete(p, true); } else{ // throw new CmdLineException(null, "Output exists, couldn't delete"); System.out.println("Output exists, trying to use what is there..."); } } } catch (IOException e) { throw new CmdLineException(null, "Couldn't delete existing output"); } } /**
/** * * @param tool options to get data from * @throws CmdLineException */ public static void validateOutput(InOutToolOptions tool) throws CmdLineException { try { if(tool.getOutput() == null) throw new CmdLineException(null,"No Output Specified"); URI outuri = SequenceFileUtility.convertToURI(tool.getOutput()); FileSystem fs = getFileSystem(outuri); Path p = new Path(outuri.toString()); if(fs.exists(p)) { if(tool.overwriteOutput()) { fs.delete(p, true); } else{ // throw new CmdLineException(null, "Output exists, couldn't delete"); System.out.println("Output exists, trying to use what is there..."); } } } catch (IOException e) { throw new CmdLineException(null, "Couldn't delete existing output"); } } /**