ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 12632] - [PATCH] New <lsync> to synchronize a local directory from one or more <fileset>s
Date Thu, 16 Jan 2003 22:44:07 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12632>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12632

[PATCH] New <lsync> to synchronize a local directory from one or more <fileset>s





------- Additional Comments From daniel.armbrust@mayo.edu  2003-01-16 22:44 -------
I tried this out, and it worked nearly perfect for me.

The one thing that it doesn't do it remove orphaned directories.

I changed the removeOrphanedFilesMethod to the following:

	private int removeOrphanFiles(Hashtable nonOrphans, File file) {
		int removedCount = 0;
		if (file.isDirectory()) {
			File[] children = file.listFiles();
			for (int i=0; i<children.length; ++i) {
				removedCount += removeOrphanFiles(nonOrphans, children[i]);
			}
			if (nonOrphans.get(file) == null) {
				log("Removing orphan directory: "+file, Project.MSG_DEBUG);
				file.delete();
				++removedCount;
			}
		}
		else {
			if (nonOrphans.get(file) == null) {
				log("Removing orphan file: "+file, Project.MSG_DEBUG);
				file.delete();
				++removedCount;
			}
		}
		return removedCount;
	}

to cause it to remove orphaned directories.  This works perfectly (in function)
however, the messages printed to the screen are now incorrect, as it counts the
removed directories as files.  I'm not very familiar with ant tasks, and the
syntax of writing the log output, and I'm not sure how the author would like to
fix this.  Suggestions?

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message