You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Niall Pemberton (JIRA)" <ji...@apache.org> on 2011/03/13 01:47:59 UTC

[jira] Resolved: (IO-261) getFile with varargs parameter

     [ https://issues.apache.org/jira/browse/IO-261?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Niall Pemberton resolved IO-261.
--------------------------------

       Resolution: Fixed
    Fix Version/s: 2.1
         Assignee: Niall Pemberton

Fixed thanks

http://svn.apache.org/viewvc?view=revision&revision=1081025

> getFile with varargs parameter
> ------------------------------
>
>                 Key: IO-261
>                 URL: https://issues.apache.org/jira/browse/IO-261
>             Project: Commons IO
>          Issue Type: Improvement
>            Reporter: Gabriele Kahlout
>            Assignee: Niall Pemberton
>            Priority: Minor
>              Labels: features
>             Fix For: 2.1
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> Why not have those in FileUtils?    
> public static File getFile(final String... dirs) {
>         File ret = null;
>         for (String dir : dirs) {
>             if (ret == null) {
>                 ret = new File(dir);
>             } else {
>                 ret = new File(ret.getPath(), dir);
>             }
>         }
>         return ret;
>     }
>     public static File getFile(final File dir, final String... dirs) {
>         File ret = dir;
>         for (String dir1 : dirs) {
>             if (ret == null) {
>                 ret = new File(dir1);
>             } else {
>                 ret = new File(ret.getPath(), dir1);
>             }
>         }
>         return ret;
>     }

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira