public boolean validate(){
  outputFile=new File(outputPath);
  if (outputFile.exists() || outputFile.isDirectory()) {
    invalidMessage="Output file already exists.";
    return valid=false;
  }
  if (!signMode) {
    keyFile=new File(keyFilePath);
    if (!keyFile.exists() || keyFile.isDirectory()) {
      invalidMessage="Key file not found.";
      return valid=false;
    }
  }
  return valid=true;
}

public boolean validate ( ) { outputFile = new File ( outputPath ) ; if ( outputFile . exists ( ) || outputFile . isDirectory ( ) ) { invalidMessage = "Output file already exists." ; return valid = false ; } if ( ! signMode ) { keyFile = new File ( keyFilePath ) ; if ( ! keyFile . exists ( ) || keyFile . isDirectory ( ) ) { invalidMessage = "Key file not found." ; return valid = false ; } } return valid = true ; }
initialises and checks validity of files . this objects tostring ( ) method changes to reflect failures in validation in order for the user to be informed .
