* @throws IOException\r
*/\r
public String setAppender(String appender) throws IOException {\r
- File f = new File(String.format(FIRST_FILE_FORMAT_STR, dir, root, appender));\r
- File lock = new File(f.getAbsoluteFile()+".lock");\r
- if(f.exists()) {\r
- if(lock.exists()) {\r
- int i = 0;\r
- while ((f = new File(String.format(FILE_FORMAT_STR, dir, root, appender, i))).exists() &&\r
- (lock = new File(f.getAbsoluteFile()+".lock")).exists()) {\r
- ++i;\r
- }\r
- }\r
- }\r
+ File f = new File(String.format(FIRST_FILE_FORMAT_STR, dir, root, appender));\r
+ File lock = new File(f.getAbsoluteFile()+".lock");\r
+ if(f.exists()) {\r
+ if(lock.exists()) {\r
+ int i = 0;\r
+ while ((f = new File(String.format(FILE_FORMAT_STR, dir, root, appender, i))).exists() &&\r
+ (lock = new File(f.getAbsoluteFile()+".lock")).exists()) {\r
+ ++i;\r
+ }\r
+ }\r
+ }\r
\r
try {\r
- lock.createNewFile();\r
- lock.deleteOnExit();\r
- f.createNewFile();\r
+ lock.createNewFile();\r
+ lock.deleteOnExit();\r
+ f.createNewFile();\r
} catch (IOException e) {\r
- throw new IOException("Cannot create file '" + f.getCanonicalPath() + '\'', e);\r
+ throw new IOException("Cannot create file '" + f.getCanonicalPath() + '\'', e);\r
}\r
System.setProperty("LOG4J_FILENAME_" + appender, f.getCanonicalPath());\r
return appender;\r