Package org.apache.commons.cli2.validation

Examples of org.apache.commons.cli2.validation.InvalidArgumentException


          // Note : This code doesnt belong here, it should be changed to
          // an can exec check in java 6
          for (String file : (List<String>)values) {
            File f = new File(file)
            if (!f.exists()) {
              throw new InvalidArgumentException("Argument : " +
                                                 f.getAbsolutePath() + " doesn't exist.");
            }
            if (!f.isFile()) {
              throw new InvalidArgumentException("Argument : " +
                                                 f.getAbsolutePath() + " is not a file.");
            }
            if (!f.canRead()) {
              throw new InvalidArgumentException("Argument : " +
                                                 f.getAbsolutePath() + " is not accessible");
            }
          }
        }     
      };
View Full Code Here


          // Note : This code doesnt belong here, it should be changed to
          // an can exec check in java 6
          for (String file : (List<String>)values) {
            File f = new File(file)
            if (!f.exists()) {
              throw new InvalidArgumentException("Argument : " +
                                                 f.getAbsolutePath() + " doesn't exist.");
            }
            if (!f.isFile()) {
              throw new InvalidArgumentException("Argument : " +
                                                 f.getAbsolutePath() + " is not a file.");
            }
            if (!f.canRead()) {
              throw new InvalidArgumentException("Argument : " +
                                                 f.getAbsolutePath() + " is not accessible");
            }
          }
        }     
      };
View Full Code Here

          // Note : This code doesnt belong here, it should be changed to
          // an can exec check in java 6
          for (String file : (List<String>)values) {
            File f = new File(file)
            if (!f.exists()) {
              throw new InvalidArgumentException("Argument : " +
                                                 f.getAbsolutePath() + " doesn't exist.");
            }
            if (!f.isFile()) {
              throw new InvalidArgumentException("Argument : " +
                                                 f.getAbsolutePath() + " is not a file.");
            }
            if (!f.canRead()) {
              throw new InvalidArgumentException("Argument : " +
                                                 f.getAbsolutePath() + " is not accessible");
            }
          }
        }     
      };
View Full Code Here

          // Note : This code doesnt belong here, it should be changed to
          // an can exec check in java 6
          for (String file : (List<String>)values) {
            File f = new File(file)
            if (!f.exists()) {
              throw new InvalidArgumentException("Argument : " +
                                                 f.getAbsolutePath() + " doesn't exist.");
            }
            if (!f.isFile()) {
              throw new InvalidArgumentException("Argument : " +
                                                 f.getAbsolutePath() + " is not a file.");
            }
            if (!f.canRead()) {
              throw new InvalidArgumentException("Argument : " +
                                                 f.getAbsolutePath() + " is not accessible");
            }
          }
        }     
      };
View Full Code Here

        // Note : This code doesnt belong here, it should be changed to
        // an can exec check in java 6
        for (String file : (List<String>)values) {
          File f = new File(file)
          if ( ! f.exists() ) {
            throw new InvalidArgumentException("Argument : " +
                f.getAbsolutePath() + " doesn't exist.");
          }
          if ( ! f.isFile() ) {
            throw new InvalidArgumentException("Argument : " +
                f.getAbsolutePath() + " is not a file.");
          }
          if ( ! f.canRead() ) {
            throw new InvalidArgumentException("Argument : " +
                f.getAbsolutePath() + " is not accessible");
          }
        }
      }     
    };
View Full Code Here

                    if (list.size() > 0) {
                        String cmd = list.get(0).toString();
                        try {
                            list.set(0, Sync.Command.valueOf(cmd.toUpperCase()));
                        } catch (IllegalArgumentException e) {
                            throw new InvalidArgumentException("Invalid command: " + cmd);
                        }
                    }
                }
            })
            .create();
View Full Code Here

          // Note : This code doesnt belong here, it should be changed to
          // an can exec check in java 6
          for (String file : (List<String>)values) {
            File f = new File(file)
            if (!f.exists()) {
              throw new InvalidArgumentException("Argument : " +
                                                 f.getAbsolutePath() + " doesn't exist.");
            }
            if (!f.isFile()) {
              throw new InvalidArgumentException("Argument : " +
                                                 f.getAbsolutePath() + " is not a file.");
            }
            if (!f.canRead()) {
              throw new InvalidArgumentException("Argument : " +
                                                 f.getAbsolutePath() + " is not accessible");
            }
          }
        }     
      };
View Full Code Here

          // Note : This code doesnt belong here, it should be changed to
          // an can exec check in java 6
          for (String file : (List<String>)values) {
            File f = new File(file)
            if (!f.exists()) {
              throw new InvalidArgumentException("Argument : " +
                                                 f.getAbsolutePath() + " doesn't exist.");
            }
            if (!f.isFile()) {
              throw new InvalidArgumentException("Argument : " +
                                                 f.getAbsolutePath() + " is not a file.");
            }
            if (!f.canRead()) {
              throw new InvalidArgumentException("Argument : " +
                                                 f.getAbsolutePath() + " is not accessible");
            }
          }
        }     
      };
View Full Code Here

          // Note : This code doesnt belong here, it should be changed to
          // an can exec check in java 6
          for (String file : (List<String>)values) {
            File f = new File(file)
            if (!f.exists()) {
              throw new InvalidArgumentException("Argument : " +
                                                 f.getAbsolutePath() + " doesn't exist.");
            }
            if (!f.isFile()) {
              throw new InvalidArgumentException("Argument : " +
                                                 f.getAbsolutePath() + " is not a file.");
            }
            if (!f.canRead()) {
              throw new InvalidArgumentException("Argument : " +
                                                 f.getAbsolutePath() + " is not accessible");
            }
          }
        }     
      };
View Full Code Here

          // Note : This code doesnt belong here, it should be changed to
          // an can exec check in java 6
          for (String file : (List<String>)values) {
            File f = new File(file)
            if (!f.exists()) {
              throw new InvalidArgumentException("Argument : " +
                                                 f.getAbsolutePath() + " doesn't exist.");
            }
            if (!f.isFile()) {
              throw new InvalidArgumentException("Argument : " +
                                                 f.getAbsolutePath() + " is not a file.");
            }
            if (!f.canRead()) {
              throw new InvalidArgumentException("Argument : " +
                                                 f.getAbsolutePath() + " is not accessible");
            }
          }
        }     
      };
View Full Code Here

TOP

Related Classes of org.apache.commons.cli2.validation.InvalidArgumentException

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.