--- projects/cms/source/server/uk/org/iscream/cms/server/client/WebFeeder.java 2001/03/16 02:40:04 1.13 +++ projects/cms/source/server/uk/org/iscream/cms/server/client/WebFeeder.java 2001/03/16 16:43:50 1.14 @@ -15,7 +15,7 @@ import java.io.*; * !! that to a file. * * @author $Author: tdb $ - * @version $Id: WebFeeder.java,v 1.13 2001/03/16 02:40:04 tdb Exp $ + * @version $Id: WebFeeder.java,v 1.14 2001/03/16 16:43:50 tdb Exp $ */ public class WebFeeder extends Thread { @@ -24,7 +24,7 @@ public class WebFeeder extends Thread { /** * The current CVS revision of this class */ - public static final String REVISION = "$Revision: 1.13 $"; + public static final String REVISION = "$Revision: 1.14 $"; /** * Default check period in seconds (30 minutes) @@ -36,6 +36,11 @@ public class WebFeeder extends Thread { */ public final int DEFAULT_AGE = 3600; + /** + * The default path seperator, here for convienience + */ + private final String sep = File.separator; + //---STATIC METHODS--- /** @@ -71,9 +76,9 @@ public class WebFeeder extends Thread { alertSubDir = cp.getProperty("WebFeeder", "WebFeeder.alertSubDir"); File alertsDir = new File(rootPath, alertSubDir); if(deleteContents(alertsDir)) { - _logger.write(this.toString(), Logger.DEBUG, "Deleted all files and directories from: "+rootPath+"/"+alertSubDir); + _logger.write(this.toString(), Logger.DEBUG, "Deleted all files and directories from: "+rootPath+sep+alertSubDir); } else { - _logger.write(this.toString(), Logger.WARNING, "Failed to delete all files and directories from: "+rootPath+"/"+alertSubDir); + _logger.write(this.toString(), Logger.WARNING, "Failed to delete all files and directories from: "+rootPath+sep+alertSubDir); } // cleanup complete } catch (PropertyNotFoundException e) { @@ -200,8 +205,8 @@ public class WebFeeder extends Thread { String data = packet.printAll(); String hostname = packet.getParam("packet.attributes.machine_name"); // set paths - File outDir = new File(rootPath, latestSubDir+"/"+hostname); - File outFile = new File(rootPath, latestSubDir+"/"+hostname+"/"+latestFileName); + File outDir = new File(rootPath, latestSubDir+sep+hostname); + File outFile = new File(rootPath, latestSubDir+sep+hostname+sep+latestFileName); // write the data out writeData(outDir, outFile, data); } @@ -230,8 +235,8 @@ public class WebFeeder extends Thread { String data = alert.printAll(); String hostname = alert.getSource(); // set paths - File outDir = new File(rootPath, alertSubDir+"/"+hostname); - String destFile = alertSubDir+"/"+hostname+"/"+alertFileName+"."+String.valueOf(alert.getInitialAlertTime()); + File outDir = new File(rootPath, alertSubDir+sep+hostname); + String destFile = alertSubDir+sep+hostname+sep+alertFileName+"."+String.valueOf(alert.getInitialAlertTime()); File outFile; // check if we're at a special "end case" (OK or FINAL) if(alert.getLevel()==0 || alert.getLevel()==Alert.alertLevels.length-1) {