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

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

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

ASF GitHub Bot (Jira)
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
            Priority: Minor


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

       
Reply | Threaded
Open this post in threaded view
|

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

ASF GitHub Bot (Jira)

     [ 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
Reply | Threaded
Open this post in threaded view
|

[jira] [Updated] (IO-261) Add FileUtils.getFile API with varargs parameter

ASF GitHub Bot (Jira)
In reply to this post by ASF GitHub Bot (Jira)

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

Gary D. Gregory updated IO-261:
-------------------------------

    Summary: Add FileUtils.getFile API with varargs parameter  (was: getFile with varargs parameter)

> 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.
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Closed] (IO-261) Add FileUtils.getFile API with varargs parameter

ASF GitHub Bot (Jira)
In reply to this post by ASF GitHub Bot (Jira)

     [ 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