public void verifyPath_orThrowException(String pathToSnapshot){
  if (null == pathToSnapshot || 0 == pathToSnapshot.length())   throw new Profiler4JError("File path for snapshotOnExit feature is empty.");
  File file=new File(pathToSnapshot);
  if (!file.exists()) {
    try {
      file.createNewFile();
    }
 catch (    IOException e) {
      throw new Profiler4JError("Could not create a file for the snapshotOnExit feature: " + pathToSnapshot);
    }
 finally {
      file.delete();
    }
  }
 else {
    if (!file.isFile() || !file.canWrite())     throw new Profiler4JError("Cannot open file for snapshotOnExit feature: " + pathToSnapshot);
  }
}

public void verifyPath_orThrowException ( String pathToSnapshot ) { if ( null == pathToSnapshot || 0 == pathToSnapshot . length ( ) ) throw new Profiler4JError ( "File path for snapshotOnExit feature is empty." ) ; File file = new File ( pathToSnapshot ) ; if ( ! file . exists ( ) ) { try { file . createNewFile ( ) ; } catch ( IOException e ) { throw new Profiler4JError ( "Could not create a file for the snapshotOnExit feature: " + pathToSnapshot ) ; } finally { file . delete ( ) ; } } else { if ( ! file . isFile ( ) || ! file . canWrite ( ) ) throw new Profiler4JError ( "Cannot open file for snapshotOnExit feature: " + pathToSnapshot ) ; } }
verifies the given path can be used to open a file and write to it . < p > in case this is not possible , an exception is thrown .
