#8 stronger FileUtil.findFile method

David Stern

The changes I submitted earlier did not work with a
file path containing spaces due to System.getResource
returning a URL (and encoding spaces as %20). The
changes affect FileUtil, FileResultFactory and
XMLResultFactory since I changed the method to throw
FileNotFoundException. My view on it is that as a
utility class, FileUtil should allow for full
recoverability. The patch also contains a few changes
to FileResultFactory involving removing the member
variable for the fileName String as I don't see a need
for it anymore due to the stronger findFile. I also
added something that you may not like (but that we find
useful in our project). I wanted the ability to add
values that cannot be expressed in a flat file, the
most common being an emptry string for NOT NULL
database columns.


  • David Stern

    David Stern - 2005-06-30
  • Alwin Ibba

    Alwin Ibba - 2005-07-01
    • assigned_to: nobody --> aibba
  • Alwin Ibba

    Alwin Ibba - 2005-07-01

    Logged In: YES

    Ok, I applied this patch after some refactoring. There was
    an issue with JDK 1.3 (the method URLDecoder.decode(String
    s, String enc) was introduced with 1.4) which caused the
    build to break. I changed it to use the deprecated
    URLDecoder.decode(String s) method. This method uses the
    default encoding. This is a bit sloppy but the FileReader of
    FileResultSetFactory also uses the default encoding (it ever
    did), so this is ok for now (until we find a better solution).

    I like the label stuff. However I did some modifications. I
    replaced the term "label" with "template", I replaced
    "emptyString" with "defaultString" and introduced
    "defaultInteger". I also added a method to customize the
    templates and the $ marker and implemented some tests.
    Thanks for this, it's a nice feature.

    Please, when submitting a patch, run the build, run all
    tests (some were broken due to changed behaviour), write new
    tests for new features and update the JavaDocs when changing
    behaviour. I would really appreciate this, since it saves me
    a lot of time and work when integrating the patch.

    Kind regards,


  • Alwin Ibba

    Alwin Ibba - 2005-09-30
    • status: open --> closed

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks