commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aaron Digulla (Commented) (JIRA)" <>
Subject [jira] [Commented] (IO-237) Add Additional toFiles() and toURLs() Methods to FileUtils
Date Mon, 26 Mar 2012 10:09:26 GMT


Aaron Digulla commented on IO-237:

I suggest to close this.

With Java 5, you can use the generic {{Arrays.asList()}} for this.

If you need to modify the list, you need to wrap the call in {{new ArrayList()}}. Due to internal
optimizations, this is a pretty fast operation.
> Add Additional toFiles() and toURLs() Methods to FileUtils
> ----------------------------------------------------------
>                 Key: IO-237
>                 URL:
>             Project: Commons IO
>          Issue Type: Improvement
>          Components: Utilities
>    Affects Versions: 2.0
>         Environment: Java 1.5+
>            Reporter: Michael Wooten
>             Fix For: 3.x
>         Attachments: path-convert-fileArray-andURLArray-into-varargs.patch
>   Original Estimate: 10h
>  Remaining Estimate: 10h
> I suggest modifying the signatures of the toFiles() and toURLs() to use varargs since
that approach will automatically accept arrays and also allow the user to send an arbitrary
number of them.
> Convert File[] toFiles(URL[]) to File[] toFiles(URL...)
> Convert URL[] toURLs(File[]) to URL[] toURLs(File...)
> I also suggest adding new methods for converting a collection of URLs or Files to an
array, or to a List.
> File[] toFiles(Collection<URL>)
> List<File> toFilesList(URL...)
> List<File> toFilesList(Collection<URL>)
> URL[] toURLs(Collection<File>)
> List<URL> toURLsList(File...)
> List<URL> toURLsList(Collection<File>)

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message