[EMAIL PROTECTED] wrote:
> "The scanner itself is in a helper class called DirectoryScanner. For now,
> the only directory scanning related 'behaviour' in the Tasks are the
> setIncludes, setExcludes and setDefaultexcludes (and of course a call in
> the execute method)."
>
> Excellent! molto +1's
>
> "The '**' is needed to cater for the following situations:
>
> 1. match files in 1 directory, but not it's subdirectories. e.g.
> /test/*.java which matches all .java files in the /test/ directory.
> 2. match files in 1 directory, and all (or a subset of) it's
> subdirectories.
> e.g. /test/**/*.java which matches all .java files in all directories under
> /test/.
> 3. match directories on the leafs of the tree e.g. **/CVS/* which matches
> all CVS directories and their files.
>
> If you don't have an extra special character ('**') besides the usual '*'
> and '?', it is impossible to cater for all described situations.
>
> If you can show me how to do it without '**', please tell me. I would be
> very grateful."
>
> Infozip does this with a "recurse into directories' flag (-R), that is used
> in combination with the mask to determine which files are selected.
>
> Does the following cover things (it does as far as I can tell).
>
> 1) Includes="/test/*.java" recurse="false"
> 2) Includes="/test/*/*.java" recurse="true"
> 3) Includes="*/CVS/*" recurse="true"
>
This requires more typing than '**' is not near as expressive. The problem with
'*' is that it does not matches '/' which is the directory separator. So '**'
is just shorthand for the regular expression "([^/]*/)*".
Notice that on your your rule (3) there is no way to write a rule that only
takes one of this two files:
(a) a/b/c/CVS/d
(b) a/CVS/b/c/d
With '**' the rules are:
(a) **/CVS/*
(b) */CVS/**
It seems to have more expressive power.
Jose Alberto
--
------------------------------------------------------------------------
Jose Alberto Fernandez 500 Oracle Parkway, M/S 9op4
Development Manager Redwood Shores, CA 94065
ORACLE Corp. Phone: (650) 506-8830
Java Products Group Fax: (650) 506-7303
Languages & Obj-Relational Tech Email: [EMAIL PROTECTED]
begin:vcard
n:Fernandez;Jose Alberto
tel;work:(650) 506-8830
x-mozilla-html:TRUE
org:Oracle Corp. <A HREF="http://www.oracle.com/go/?&URL=http://www.oracle.com/"><img src="http://www.oracle.com/signature/obanner.gif"></A>;Java Products Group <A HREF="http://www.oracle.com/go/?&URL=http://www.oracle.com/">Visit us at http://www.oracle.com</A>
version:2.1
email;internet:[EMAIL PROTECTED]
title:Development Manager
adr;quoted-printable:;;500 Oracle Parkway=0D=0AM/S: 4op9;Redwood Shores;California;94065;USA
x-mozilla-cpt:;19904
fn:Fernandez, Jose Alberto
end:vcard