Isn't the issue with the original pattern?
I thought that even on windows you need to use a forward slash ("/") as the
path separator character. I thought the backwards slash ("\") is treated
as a regular expression escape of the following character.
Mark Waite
On Tue, Dec 23, 2014 at 7:54 AM, Ivo Bellin Salarin <
[email protected]> wrote:
> Good afternoon,
>
> I'm working on windows. I'm trying to evaluate a fileset (ant speaking).
>
> My code looks this way, today:
> private String[] expandFileSet(AbstractBuild<?, ?> build, String
> pattern) {
> List<String> fileNames = new ArrayList<String>();
> try {
> for (FilePath x: build.getWorkspace().list(pattern))
> fileNames.add(x.getRemote());
> } catch (IOException ioe) {}
> catch (InterruptedException inte) {}
> return fileNames.toArray(new String[fileNames.size()]);
> }
> where pattern looks like "**\*.Tests.dll"
>
> My problem is that the list() method always returns an empty list.
> Even with no parameter at all, list() returns an empty list. Even if the
> workspace contains a certain number of files or folders.
>
> Previous I was using a function similar to
> private String[] expandFileSet(AbstractBuild<?, ?> build, String
> pattern) {
> String[] result = new String[]{pattern};
> FileSet fileSet = new FileSet();
> org.apache.tools.ant.Project project = new
> org.apache.tools.ant.Project();
> fileSet.setProject(project);
> try {
> fileSet.setDir(new
> File(build.getWorkspace().toURI().getPath()));
> fileSet.setIncludes(pattern);
> } catch (IOException ioe) {
> return result;
> } catch (InterruptedException intE) {
> return result;
> }
> return fileSet.getDirectoryScanner(project).getIncludedFiles();
> }
> (including an ant FileSet).
>
> Well.. which is the best way to evaluate a fileset? Are there some
> considerations I should take into account on Windows?
>
> Thanks in advance,
> Ivo
>
> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-dev/CAPc4eF9OeR_PNQpQPgcqs-_kPQZkjz1qpzVLtQqEoLP5O7sB2Q%40mail.gmail.com
> <https://groups.google.com/d/msgid/jenkinsci-dev/CAPc4eF9OeR_PNQpQPgcqs-_kPQZkjz1qpzVLtQqEoLP5O7sB2Q%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
--
Thanks!
Mark Waite
--
You received this message because you are subscribed to the Google Groups
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-dev/CAO49JtEQafFDwy5o3muNHaNRJSdvEydCZGQ6o8dfeK%3DtBye6aQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.