ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/cms/source/server/uk/org/iscream/cms/server/client/WebFeeder.java
(Generate patch)

Comparing projects/cms/source/server/uk/org/iscream/cms/server/client/WebFeeder.java (file contents):
Revision 1.13 by tdb, Fri Mar 16 02:40:04 2001 UTC vs.
Revision 1.14 by tdb, Fri Mar 16 16:43:50 2001 UTC

# Line 36 | Line 36 | public class WebFeeder extends Thread {
36       */
37      public final int DEFAULT_AGE = 3600;
38      
39 +    /**
40 +     * The default path seperator, here for convienience
41 +     */
42 +    private final String sep = File.separator;
43 +    
44   //---STATIC METHODS---
45  
46      /**
# Line 71 | Line 76 | public class WebFeeder extends Thread {
76              alertSubDir = cp.getProperty("WebFeeder", "WebFeeder.alertSubDir");
77              File alertsDir = new File(rootPath, alertSubDir);
78              if(deleteContents(alertsDir)) {
79 <                _logger.write(this.toString(), Logger.DEBUG, "Deleted all files and directories from: "+rootPath+"/"+alertSubDir);
79 >                _logger.write(this.toString(), Logger.DEBUG, "Deleted all files and directories from: "+rootPath+sep+alertSubDir);
80              } else {
81 <                _logger.write(this.toString(), Logger.WARNING, "Failed to delete all files and directories from: "+rootPath+"/"+alertSubDir);
81 >                _logger.write(this.toString(), Logger.WARNING, "Failed to delete all files and directories from: "+rootPath+sep+alertSubDir);
82              }
83              // cleanup complete
84          } catch (PropertyNotFoundException e) {
# Line 200 | Line 205 | public class WebFeeder extends Thread {
205          String data = packet.printAll();
206          String hostname = packet.getParam("packet.attributes.machine_name");
207          // set paths
208 <        File outDir = new File(rootPath, latestSubDir+"/"+hostname);
209 <        File outFile = new File(rootPath, latestSubDir+"/"+hostname+"/"+latestFileName);
208 >        File outDir = new File(rootPath, latestSubDir+sep+hostname);
209 >        File outFile = new File(rootPath, latestSubDir+sep+hostname+sep+latestFileName);
210          // write the data out
211          writeData(outDir, outFile, data);
212      }
# Line 230 | Line 235 | public class WebFeeder extends Thread {
235          String data = alert.printAll();
236          String hostname = alert.getSource();
237          // set paths
238 <        File outDir = new File(rootPath, alertSubDir+"/"+hostname);
239 <        String destFile = alertSubDir+"/"+hostname+"/"+alertFileName+"."+String.valueOf(alert.getInitialAlertTime());
238 >        File outDir = new File(rootPath, alertSubDir+sep+hostname);
239 >        String destFile = alertSubDir+sep+hostname+sep+alertFileName+"."+String.valueOf(alert.getInitialAlertTime());
240          File outFile;
241          // check if we're at a special "end case" (OK or FINAL)
242          if(alert.getLevel()==0 || alert.getLevel()==Alert.alertLevels.length-1) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines