How to scan inner directory if I provide wildcard in directory only irrespective of include

20 views
Skip to first unread message

Uday Patil

unread,
May 22, 2019, 2:32:28 AM5/22/19
to wildcard-users
I have to scan all files and inner directories of path - root/dir1/dir2
now inside /dir2 I have other directories too and want to scan those as well by only providing directory path as - /root/dir1/dir* and include will match files in side dir2

Nate

unread,
May 22, 2019, 3:44:12 AM5/22/19
to wildcar...@googlegroups.com
What is an "inner directory"? You mean all subdirectories?

Sorry, I don't understand the question.


On Wed, May 22, 2019 at 8:32 AM Uday Patil <patil...@gmail.com> wrote:
I have to scan all files and inner directories of path - root/dir1/dir2
now inside /dir2 I have other directories too and want to scan those as well by only providing directory path as - /root/dir1/dir* and include will match files in side dir2

--
You received this message because you are subscribed to the "wildcard-users" group.
http://groups.google.com/group/wildcard-users
---
You received this message because you are subscribed to the Google Groups "wildcard-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wildcard-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/wildcard-users/e2ab2c48-074c-4e67-a957-6f14fac22f82%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Message has been deleted

Uday Patil

unread,
May 22, 2019, 4:40:24 AM5/22/19
to wildcard-users
Yes, subdirectories.

consider directories like - 
/root/dir1/dire2
              /dire2/testFile1.log              -file
              /dire2/testFile2.log              -file
              /dire2/testFile3.log              -file
              /dire2/testFile4.log              -file
              /dire2/dir3/testFile5.log       -directory/file
              /dire2/dir3/testFile6.log       -directory/file
              /dire2/dir3/testFile7.log       -directory/file
              /dire2/dir3/testFile8.log       -directory/file
              /dire2/dir4/testFile9.log       -directory/file
              /dire2/dir4/testFile10.log       -directory/file
              /dire2/dir5/dir6/testFile11.log       -directory/directory/file
              /dire2/dir5/dir6/testFile12.log       -directory/directory/file

GlobScanner constructor is - GlobScanner(rootDirectory, includes, excludes, ignoreCase).matches();

My inputs :
rootDirectory - /root/dir1/dire*/
includes        - testFile*.log
excludes       - null
ignoreCase   - false

here I want to scan directories upto - /root/dir1/dire*/anydirectoryInside(allMatchingFiles-matching with includes) and only upto 1 level ie /root/dir1/dire2/dire3 and /root/dir1/dire2/dire4 and /root/dir1/dire2/dire5 and matching files in /root/dir1/dir*/allMatchingFiles(matching with includes)
and should not scan more than 1 level ie /root/dir1/dire2/dire5/dir6


On Wednesday, May 22, 2019 at 1:14:12 PM UTC+5:30, Nate wrote:
What is an "inner directory"? You mean all subdirectories?

Sorry, I don't understand the question.


On Wed, May 22, 2019 at 8:32 AM Uday Patil <patil...@gmail.com> wrote:
I have to scan all files and inner directories of path - root/dir1/dir2
now inside /dir2 I have other directories too and want to scan those as well by only providing directory path as - /root/dir1/dir* and include will match files in side dir2

--
You received this message because you are subscribed to the "wildcard-users" group.
http://groups.google.com/group/wildcard-users
---
You received this message because you are subscribed to the Google Groups "wildcard-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wildcar...@googlegroups.com.

Nate

unread,
May 22, 2019, 4:47:37 AM5/22/19
to wildcar...@googlegroups.com
That's a lot of information but not presented very clearly. With this library you can use glob wildcards ?, *, ** or regex, explained here:
For example:
Paths paths = new Paths();
paths.glob("/root/dir1/dire2", "dir?/*.log");
Reply all
Reply to author
Forward
0 new messages