private boolean ensureTargetIsValid(){
  String targetDir=getTargetDirectory();
  if (!ensureTargetDirectoryIsValid(targetDir)) {
    return false;
  }
  String fileName=getTargetFileName();
  if (!ensureTargetFileIsValid(new File(targetDir,fileName))) {
    return false;
  }
  return true;
}

private boolean ensureTargetIsValid ( ) { String targetDir = getTargetDirectory ( ) ; if ( ! ensureTargetDirectoryIsValid ( targetDir ) ) { return false ; } String fileName = getTargetFileName ( ) ; if ( ! ensureTargetFileIsValid ( new File ( targetDir , fileName ) ) ) { return false ; } return true ; }
ensures that the target output file and its containing directory are both valid and able to be used . answer a boolean indicating validity .
