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.15 by tdb, Fri Mar 16 16:47:33 2001 UTC vs.
Revision 1.16 by tdb, Mon Mar 19 21:30:30 2001 UTC

# Line 170 | Line 170 | public class WebFeeder extends Thread {
170                              long age = System.currentTimeMillis() - lastModified;
171                              if(age > ((long) deleteOlderThan*1000)) {
172                                  // it's also older than our age to delete older than
173 <                                if(!alertFile.delete()) {
173 >                                if(alertFile.delete()) {
174 >                                    // do a quick check to see if the directory is now empty
175 >                                    File[] newHostdirContents = hostdir.listFiles();
176 >                                    if(newHostdirContents.length == 0) {
177 >                                        // it does seem to be, try and delete it
178 >                                        // this will fail anyway if files still remain
179 >                                        if(!hostdir.delete()) {
180 >                                            _logger.write(this.toString(), Logger.WARNING, "Failed to delete the following empty host directory: "+hostdir.getPath());
181 >                                        }
182 >                                    }
183 >                                }
184 >                                else {
185                                      _logger.write(this.toString(), Logger.WARNING, "Failed to delete the following 'old' alert file: "+alertFile.getPath());
186                                  }
187                              }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines