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.14 by tdb, Fri Mar 16 16:43:50 2001 UTC vs.
Revision 1.15 by tdb, Fri Mar 16 16:47:33 2001 UTC

# Line 148 | Line 148 | public class WebFeeder extends Thread {
148              
149              // list the files and delete as appropriate
150              File alertsDir = new File(rootPath, alertSubDir);
151 +            // get all the hostnames directories
152              File[] contents = alertsDir.listFiles();
153              for(int i=0; i < contents.length; i++) {
154 +                // get a single directory from the array..
155                  File hostdir = contents[i];
156 +                // ..and check it's a directory
157                  if(hostdir.isDirectory()) {
158 +                    // get all the contents of that directory
159                      File[] hostdirContents = hostdir.listFiles();
160                      for(int j=0; j < hostdirContents.length; j++) {
161                          File alertFile = hostdirContents[j];
162 +                        // get the filename..
163                          String filename = alertFile.getName();
164 +                        // ..and see if it ends with OK or FINAL
165                          if(filename.endsWith(Alert.alertLevels[0]) ||
166                             filename.endsWith(Alert.alertLevels[Alert.alertLevels.length-1])) {
167 <                            // it ends with either OK or FINAL
167 >                            // it does end with either OK or FINAL
168                              // ... so we can check it for deletion
169                              long lastModified = alertFile.lastModified();
170                              long age = System.currentTimeMillis() - lastModified;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines