Ejemplo n.º 1
0
  @Override
  public void validate() throws CruiseControlException {
    // Must be set
    ValidationHelper.assertEncoding(this.encoding, getClass());
    ValidationHelper.assertIsSet(this.file, "file", getClass());
    // Invalid combination
    ValidationHelper.assertFalse(!this.overwrite && this.append, "action not set properly");

    // Set the file
    this.file = joinPath(this.file);
    ValidationHelper.assertIsNotDirectory(this.file, "file", getClass());

    if (!this.overwrite) {
      // When overwrite is disabled, the file must not exist
      try {
        ValidationHelper.assertNotExists(this.file, "file", getClass());
      } catch (CruiseControlException e) {
        ValidationHelper.fail("Trying to overwrite file without permition.");
      }
    }

    for (Content c : this.messages) {
      c.validate();
    }
  }
Ejemplo n.º 2
0
 @Override
 public void validate() throws CruiseControlException {
   // Validate
   ValidationHelper.assertEncoding(this.encoding, getClass());
   ValidationHelper.assertIsSet(this.file, "file", getClass());
   //
   //            // Check if exists, ...
   //            ValidationHelper.assertExists(this.file, "file", getClass());
   //            ValidationHelper.assertIsReadable(this.file, "file", getClass());
   //            ValidationHelper.assertIsNotDirectory(this.file, "file", getClass());
 }