[jira] [Commented] (IO-237) Add Additional toFiles() and toURLs() Methods to FileUtils
[ https://issues.apache.org/jira/browse/IO-237?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17804031#comment-17804031 ] Elliotte Rusty Harold commented on IO-237: -- I agree this is not particularly useful. We should close as won't do. > Add Additional toFiles() and toURLs() Methods to FileUtils > -- > > Key: IO-237 > URL: https://issues.apache.org/jira/browse/IO-237 > Project: Commons IO > Issue Type: Improvement > Components: Utilities >Affects Versions: 2.0 > Environment: Java 1.5+ >Reporter: Michael Wooten >Priority: Major > 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) > List toFilesList(URL...) > List toFilesList(Collection) > URL[] toURLs(Collection) > List toURLsList(File...) > List toURLsList(Collection) -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (IO-237) Add Additional toFiles() and toURLs() Methods to FileUtils
[ https://issues.apache.org/jira/browse/IO-237?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13290952#comment-13290952 ] Sebb commented on IO-237: - Using varargs instead of an array changes the API slightly, in that one can additionally call the method with no parameters, e.g. FileUtils.toURLs() This is not particularly useful - it's equivalent to passing an empty array - but should probably be added to the unit tests if implemented. As to supporting Collections: the proposal would add 6 new methods. Assuming that there is a use case for supporting collections as input, it ought to be sufficient to add just the following: List toFiles(Collection) List toURLs(Collection) Is there really a use case for the additional conversions to/from arrays? > Add Additional toFiles() and toURLs() Methods to FileUtils > -- > > Key: IO-237 > URL: https://issues.apache.org/jira/browse/IO-237 > 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) > List toFilesList(URL...) > List toFilesList(Collection) > URL[] toURLs(Collection) > List toURLsList(File...) > List toURLsList(Collection) -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (IO-237) Add Additional toFiles() and toURLs() Methods to FileUtils
[ https://issues.apache.org/jira/browse/IO-237?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13238246#comment-13238246 ] 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: https://issues.apache.org/jira/browse/IO-237 > 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) > List toFilesList(URL...) > List toFilesList(Collection) > URL[] toURLs(Collection) > List toURLsList(File...) > List toURLsList(Collection) -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira