+ /**
+ * Check the given base path, and try (once) to create it if necessary
+ * @return true if base path can be written to
+ */
+ private static boolean checkBasePath(File inBasePath)
+ {
+ if (!inBasePath.exists() && !TRIED_TO_CREATE_BASEPATH)
+ {
+ TRIED_TO_CREATE_BASEPATH = true;
+ System.out.println("Base path '" + inBasePath.getAbsolutePath() + "' does not exist, trying to create");
+ return inBasePath.mkdirs();
+ }
+ return inBasePath.exists() && inBasePath.isDirectory() && inBasePath.canWrite();
+ }
+