Change fallback work dir to ignite/work, put README.txt in ignite/ - Fixes
@@ -9330,7 +9330,28 @@ public abstract class IgniteUtils {
IgniteSystemProperties.IGNITE_WORK_DIR + ") must be explicitly set."
);
- workDir = new File(userDir, DEFAULT_WORK_DIR);
+ File igniteDir = new File(userDir, "ignite");
+
+ try {
+ igniteDir.mkdirs();
+
+ File readme = new File(igniteDir, "README.txt");
+
+ if (!readme.exists()) {
+ U.writeStringToFile(readme,
+ "This is Apache Ignite working directory that contains information that \n" +
+ " Ignite nodes need in order to function normally.\n" +
+ "Don't delete it unless you're sure you know what you're doing.\n\n" +
+ "You can change the location of working directory with \n" +
+ " igniteConfiguration.setWorkingDirectory(location) or \n" +
+ " <property name=\"workingDirectory\" value=\"location\"/> in IgniteConfiguration <bean>.\n");
+ }
+ }
+ catch (Exception e) {
+ // Ignore.
+ }
+
+ workDir = new File(igniteDir, DEFAULT_WORK_DIR);
}
if (!workDir.isAbsolute())
