Update of /cvsroot/nutch/nutch/src/java/net/nutch/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3662/src/java/net/nutch/util
Modified Files: FileUtil.java LocalFileSystem.java Log Message: Fixed a bug that fails fullyDelete() in FileUtil.java for LocalFileSystem.java. This should also fix daily build failure problem (./db/webdb.old does not get cleaned) at sourceforge.net. Index: FileUtil.java =================================================================== RCS file: /cvsroot/nutch/nutch/src/java/net/nutch/util/FileUtil.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** FileUtil.java 20 Aug 2004 20:36:15 -0000 1.6 --- FileUtil.java 23 Oct 2004 00:40:59 -0000 1.7 *************** *** 18,35 **** } public static boolean fullyDelete(NutchFileSystem nfs, File dir) throws IOException { ! File contents[] = nfs.listFiles(dir); ! if (contents != null) { ! for (int i = 0; i < contents.length; i++) { ! if (nfs.isFile(contents[i])) { ! if (! nfs.delete(contents[i])) { ! return false; ! } ! } else { ! if (! fullyDelete(nfs, contents[i])) { ! return false; ! } ! } ! } ! } return nfs.delete(dir); } --- 18,25 ---- } public static boolean fullyDelete(NutchFileSystem nfs, File dir) throws IOException { ! // 20041022, xing. ! // Currently nfs.detele(File) means fully delete for both ! // LocalFileSystem.java and NDFSFileSystem.java. So we are okay now. ! // If implementation changes in future, it should be modified too. return nfs.delete(dir); } Index: LocalFileSystem.java =================================================================== RCS file: /cvsroot/nutch/nutch/src/java/net/nutch/util/LocalFileSystem.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** LocalFileSystem.java 7 Oct 2004 21:27:15 -0000 1.4 --- LocalFileSystem.java 23 Oct 2004 00:41:08 -0000 1.5 *************** *** 263,266 **** --- 263,275 ---- File[] files = f.listFiles(); if (files == null) return null; + // 20041022, xing, Watch out here: + // currently NDFSFile.java does not support those methods + // public boolean canRead() + // public boolean canWrite() + // public boolean createNewFile() + // public boolean delete() + // public void deleteOnExit() + // public boolean isHidden() + // so you can not rely on returned list for these operations. NDFSFile[] nfiles = new NDFSFile[files.length]; for (int i = 0; i < files.length; i++) { ------------------------------------------------------- This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more http://productguide.itmanagersjournal.com/guidepromo.tmpl _______________________________________________ Nutch-cvs mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/nutch-cvs