commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gary D. Gregory (Closed) (JIRA)" <j...@apache.org>
Subject [jira] [Closed] (IO-261) Add FileUtils.getFile API with varargs parameter
Date Mon, 10 Oct 2011 15:49:30 GMT

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

Gary D. Gregory closed IO-261.
------------------------------


Closing, we released version 2.1.
                
> Add FileUtils.getFile API 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.
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

        

Mime
View raw message