39 |
|
|
40 |
|
private WebFeeder() { |
41 |
|
// do something, or nothing.. but must be private |
42 |
+ |
// need to clean up all the alerts |
43 |
+ |
// don't need to cleanup latest data |
44 |
|
} |
45 |
|
|
46 |
|
//---PUBLIC METHODS--- |
136 |
|
String hostname = alert.getSource(); |
137 |
|
// set paths |
138 |
|
String destDir = rootPath+"/"+alertSubDir+"/"+hostname; |
139 |
< |
String destFile = destDir+"/"+alertFileName; |
139 |
> |
String destFile = destDir+"/"+alertFileName+"."+String.valueOf(alert.getInitialAlertTime()); |
140 |
|
// try to create directory |
141 |
|
File outDir = new File(destDir); |
142 |
|
if(!outDir.exists()) { |
162 |
|
if(outFile.canWrite()) { |
163 |
|
PrintWriter out; |
164 |
|
try { |
165 |
< |
out = new PrintWriter(new FileWriter(outFile.getPath(), true)); |
165 |
> |
out = new PrintWriter(new FileWriter(outFile)); |
166 |
|
out.println(data); |
167 |
|
out.close(); |
168 |
|
} catch (IOException e) { |