Package net.sourceforge.argparse4j.inf

Examples of net.sourceforge.argparse4j.inf.ArgumentParserException


    }
  }   
 
  private void verifyIsAbsolute(ArgumentParser parser, Path file) throws ArgumentParserException {
    if (!file.isAbsolute()) {
      throw new ArgumentParserException("Not an absolute file: " + file, parser);
    }
  }   
View Full Code Here


    }
  }   
 
  private void verifyHasScheme(ArgumentParser parser, Path file) throws ArgumentParserException {
    if (file.toUri().getScheme() == null) {
      throw new ArgumentParserException("URI scheme is missing in path: " + file, parser);
    }
  }
View Full Code Here

    }
  }

  private void verifyScheme(ArgumentParser parser, Path file) throws ArgumentParserException {
    if (!verifyScheme.equals(file.toUri().getScheme())) {
      throw new ArgumentParserException("Scheme of path: " + file + " must be: " + verifyScheme, parser);
    }
  }
View Full Code Here

      opts.inputFileFormat = getClass(inputFormatArg, ns, FileInputFormat.class, parser, INPUT_FORMAT_SUBSTITUTIONS);
     
      String sparkMaster = System.getProperty("spark.master");
      if (opts.pipelineType == PipelineType.spark) {
        if (sparkMaster == null) {
          throw new ArgumentParserException("--pipeline-type=" + PipelineType.spark + " must not run as a MapReduce job", parser);
        }
      } else if (opts.pipelineType == PipelineType.mapreduce) {
        if (sparkMaster != null) {
          throw new ArgumentParserException("--pipeline-type=" + PipelineType.mapreduce + " must not run as a Spark job", parser);
        }
      }
    } catch (ArgumentParserException e) {
      parser.handleError(e);
      return 1;
View Full Code Here

      return null;
    }
    try {
      return new Schema.Parser().parse(file);
    } catch (IOException e) {
      throw new ArgumentParserException(e, parser);
    }
  }
View Full Code Here

        clazz = Class.forName(className);
      } catch (Exception e) {
        throw new RuntimeException(e);
      }
      if (!baseClazz.isAssignableFrom(clazz)) {
        throw new ArgumentParserException("--" + arg.getDest().replace('_', '-') + " " + className
            + " must be an instance of class " + baseClazz.getName(), parser);
      }
    }
    return clazz;
  }
View Full Code Here

      }
      if (verifyCanExecute && !isSystemIn(file)) {
        verifyCanExecute(parser, file);
      }
    } catch (IOException e) {
      throw new ArgumentParserException(e, parser);
    }
    return file;
  }
View Full Code Here

    return file;
  }
 
  private void verifyExists(ArgumentParser parser, Path file) throws ArgumentParserException, IOException {
    if (!fs.exists(file)) {
      throw new ArgumentParserException("File not found: " + file, parser);
    }
  }   
View Full Code Here

    }
  }   
 
  private void verifyNotExists(ArgumentParser parser, Path file) throws ArgumentParserException, IOException {
    if (fs.exists(file)) {
      throw new ArgumentParserException("File found: " + file, parser);
    }
  }   
View Full Code Here

    }
  }   
 
  private void verifyIsFile(ArgumentParser parser, Path file) throws ArgumentParserException, IOException {
    if (!fs.isFile(file)) {
      throw new ArgumentParserException("Not a file: " + file, parser);
    }
  }   
View Full Code Here

TOP

Related Classes of net.sourceforge.argparse4j.inf.ArgumentParserException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.