You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by bu...@apache.org on 2004/06/09 16:22:04 UTC
DO NOT REPLY [Bug 29469] New: -
[vfs] selector, toolbox and ant packages
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=29469>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=29469
[vfs] selector, toolbox and ant packages
Summary: [vfs] selector, toolbox and ant packages
Product: Commons
Version: unspecified
Platform: All
OS/Version: All
Status: NEW
Severity: Enhancement
Priority: Other
Component: Sandbox
AssignedTo: commons-dev@jakarta.apache.org
ReportedBy: rami.ojares@elisa.fi
Hi folks,
Here comes a BIG ADDITION suggestion.
35 files, 30 classes, 3 packages.
But let me tell you right away that the code is well documented.
Selector package
----------------
This takes the FileSelector API to the next level.
Crucial to note is the FileSetSelector that extends
FileSelector by adding one more method namely
traverseDescendentsInverted(FileInfo).
The point is to allow selectors to combine with logical
operators AND, OR, NOT. NOT is the only problem when considering
when should we traverse further the directory tree and when can we stop.
Think of 3 sets:
A = All files under baseDir
S = All selected files under baseDir
I = All not selected files under baseDir (A DIFFERENCE S = I)
If you know that everything under foo/bar is not included
then when negating this you know that everything under foo/bar is included.
For most of the selectors this is very easy to implement
but with PatternSelector it is a challange and that is also
where most of the performace gain can be achieved.
The purpose of this package is to replace Ant's selectors with
a version that is VFS enabled and more "set oriented" (sorry the vague expression).
NOTE: Using regexes, makes this package jdk1.4 and up. Is that a problem?
I am sure it is problem if pushing this package to Ant.
In any case a separate regex package can be used or this can be coded
without regexes (maybe it would become more efficient that way).
I have also extended the existing FileSelectors (FileDepthSelector etc.)
to show how the FileSetSelector works.
Toolbox
-------
Toolbox has 4 tools:
- FileScanner
- Copier
- Deleter
- Synchronizer
These tools do the work of the corresponding
Ant tasks but are fully usable through the API.
FileScanner and the set oriented selectors are
in close relationship.
Ant
---
I thought making a new package for Ant tasks so that they
would not get mixed with the existing "tasks" package.
There are also 2 properties files that define ant tasks and types.
I have used the same names as in ant prefixed with "vfs-".
Eg. vfs-fileset, vfs-copy ...
To make these packages compile a few tiny patches need to be applied
to existing code
===================================================================
retrieving revision 1.8
diff -B -b -u -r1.8 AllFileSelector.java
@@ -21,7 +21,7 @@
*/
-public final class AllFileSelector
+public class AllFileSelector
implements FileSelector
{
/**
===================================================================
retrieving revision 1.9
diff -B -b -u -r1.9 FileDepthSelector.java
@@ -21,11 +21,11 @@
*/
-public final class FileDepthSelector
+public class FileDepthSelector
implements FileSelector
{
- private final int minDepth;
- private final int maxDepth;
+ protected int minDepth;
+ protected int maxDepth;
public FileDepthSelector(int minDepth, int maxDepth)
{
===================================================================
retrieving revision 1.6
diff -B -b -u -r1.6 FileTypeSelector.java
@@ -24,7 +24,7 @@
public class FileTypeSelector
implements FileSelector
{
- private final FileType type;
+ protected final FileType type;
public FileTypeSelector(final FileType type)
{
This makes the extending of these classes possible.
- Rami Ojares
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org