} else {
path = new File(".").getCanonicalPath();
}
} catch (IOException ex) {
log.error("Failed to get path");
throw new JMeterStopTestNowException("Failed to get path");
}
log.info("and by wildcard at " + path + getFilemask());
if (file.exists()) {
log.error("Lock file found: " + getFilename());
throw new JMeterStopTestNowException("Lock file found: " + getFilename());
} else if (getFilemask() != null && getFilemask().length() > 0
&& FileSystem.checkFileExistByPattern(path, getFilemask())) {
log.error("Lock file found by pattern " + getFilemask());
throw new JMeterStopTestNowException("Lock file found by pattern " + getFilemask());
} else {
try {
log.info("Create lockfile at " + getFilename());
file.createNewFile();
} catch (IOException e) {
log.error("Could not create lock file: " + e.getLocalizedMessage());
throw new JMeterStopTestNowException("Could not create lock file: " + e.getLocalizedMessage());
}
}
} else {
log.debug("Filename: " + getFilename());
log.warn("No lockfile set. Ignore.");