ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject DO NOT REPLY [Bug 49492] New: The fileset resource collection doesn't handle file/directory names with spaces
Date Wed, 23 Jun 2010 14:18:59 GMT

           Summary: The fileset resource collection doesn't handle
                    file/directory names with spaces
           Product: Ant
           Version: 1.8.1
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Core

The collection doesn't recognise the files
correctly when they contain spaces (windows os) because white space is
hard-coded as a delimiter in the setFiles() method:

public void setFiles(String filenames) {
        if (filenames != null && filenames.length() > 0) {
            StringTokenizer tok = new StringTokenizer(
                filenames, ", \t\n\r\f", false);
            while (tok.hasMoreTokens()) {

I have a comma separated list of files with spaces in the directory names and
it would not work until I used the short dos name format.

I thought I would try to create a custom task that subclasses the FileSet and
overrides setFiles() but the filenames Vector member variable is private and
has no access in subclasses.

Could the FileSet be updated so that the delimiter can be specified.  I think
this could be done simply by using a member variable and getter and setter for
the delimiter, the default value of the variable could just be set to ",
\t\n\r\f" to ensure backward compatibility.

I also wonder should the filenames Vector member variable have a protected
getter method to allow sub-classing?


Configure bugmail:
------- You are receiving this mail because: -------
You are the assignee for the bug.

View raw message