1 |
|
//---PACKAGE DECLARATION--- |
2 |
< |
package uk.ac.ukc.iscream.client; |
2 |
> |
package uk.org.iscream.client; |
3 |
|
|
4 |
|
//---IMPORTS--- |
5 |
< |
import uk.ac.ukc.iscream.componentmanager.*; |
6 |
< |
import uk.ac.ukc.iscream.core.*; |
7 |
< |
import uk.ac.ukc.iscream.util.*; |
5 |
> |
import uk.org.iscream.componentmanager.*; |
6 |
> |
import uk.org.iscream.core.*; |
7 |
> |
import uk.org.iscream.util.*; |
8 |
|
import java.io.*; |
9 |
|
|
10 |
|
/** |
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) { |
178 |
|
* Overrides the {@link java.lang.Object#toString() Object.toString()} |
179 |
|
* method to provide clean logging (every class should have this). |
180 |
|
* |
181 |
< |
* This uses the uk.ac.ukc.iscream.util.FormatName class |
181 |
> |
* This uses the uk.org.iscream.util.FormatName class |
182 |
|
* to format the toString() |
183 |
|
* |
184 |
|
* @return the name of this class and its CVS revision |