Examples of InvalidArgumentException


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

        if ((isExisting() && !f.exists()) || (isFile() && !f.getType().equals(FileType.FILE))
            || (isDirectory() && !f.getType().equals(FileType.FILE)) || (isHidden() && !f.isHidden())
            || (isReadable() && !f.isReadable()) || (isWritable() && !f.isWriteable()))
        {

          throw new InvalidArgumentException(name);
        }

        i.set(name);
      }
      catch (Exception ex)
      {
        ex.printStackTrace();
        throw new InvalidArgumentException(name);
      }
    }
  }
View Full Code Here

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

        for (Iterator it = values.iterator(); it.hasNext();)
        {
          String p = (String) it.next();
          if (!Pattern.matches("wrapper\\..*=.*", p))
          {
            throw new InvalidArgumentException(p);
          }
        }

      }

View Full Code Here

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

Examples of org.apache.empire.exceptions.InvalidArgumentException

    @Override
    public void checkDatabase(DBDatabase db, String owner, Connection conn)
    {
        // Check Params
        if (owner==null || owner.length()==0)
            throw new InvalidArgumentException("owner", owner);
        // Database definition
        OracleSYSDatabase sysDB = new OracleSYSDatabase(this);
        // Check Columns
        DBCommand sysDBCommand = sysDB.createCommand();
        sysDBCommand.select(sysDB.CI.getColumns());
View Full Code Here

Examples of org.apache.empire.exceptions.InvalidArgumentException

     */
    public static DBRowSet findById(String rowsetId)
    {
        int i = rowsetId.lastIndexOf('.');
        if (i<0)
            throw new InvalidArgumentException("rowsetId", rowsetId);
        // database suchen
        String dbid = rowsetId.substring(0, i);
        DBDatabase db = DBDatabase.findById(dbid);
        if (db==null)
            throw new ItemNotFoundException(dbid);
View Full Code Here

Examples of org.apache.empire.exceptions.InvalidArgumentException

     * @param target the target column to which the source column references
     */
    protected void addColumnReference(DBColumn source, DBColumn target)
    {
        if (source.getRowSet()!=this)
            throw new InvalidArgumentException("column", source.getFullName());
        if (columnReferences== null)
            columnReferences = new HashMap<DBColumn, DBColumn>();
        // Check if column is already there
        columnReferences.put(source, target);
    }
View Full Code Here

Examples of org.apache.empire.exceptions.InvalidArgumentException

     * @param state the state of this DBRowSet object
     */
    protected void prepareInitRecord(DBRecord rec, Object rowSetData, boolean insert)
    {
        if (rec==null)
            throw new InvalidArgumentException("rec", rec);
        if (columns.size() < 1)
            throw new ObjectNotValidException(this);
        // Init
        rec.initData(this, rowSetData, insert);
    }
View Full Code Here

Examples of org.apache.empire.exceptions.InvalidArgumentException

     */
    public void readRecord(DBRecord rec, Object[] key, Connection conn)
    {
        // Check Arguments
        if (conn == null || rec == null)
            throw new InvalidArgumentException("conn|rec", null);
        // Select
        DBCommand cmd = db.createCommand();
        cmd.select(columns);
        // Set key constraints
        setKeyConstraints(cmd, key);
View Full Code Here

Examples of org.apache.empire.exceptions.InvalidArgumentException

     */
    public boolean recordExists(Object[] key, Connection conn)
    {
        // Check Arguments
        if (conn == null)
            throw new InvalidArgumentException("conn", conn);
        // Select
        DBCommand cmd = db.createCommand();
        cmd.select(count());
        // Set key constraints
        setKeyConstraints(cmd, key);
View Full Code Here

Examples of org.apache.empire.exceptions.InvalidArgumentException

        // check updateable
        if (isUpdateable()==false)
            throw new NotSupportedException(this, "updateRecord");
        // Check Arguments
        if (rec == null)
            throw new InvalidArgumentException("record", rec);
        if (rec.isValid()==false)
            throw new ObjectNotValidException(rec);
        if (conn == null)
            throw new InvalidArgumentException("conn", conn);
        // Get the new Timestamp
        String name = getName();
        Timestamp timestamp = (timestampColumn!=null) ? db.getUpdateTimestamp(conn) : null;
        DBDatabaseDriver.DBSetGenKeys setGenKey = null;
        // Get the fields and the flags
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.