Uploaded image for project: 'Commons IO'
  1. Commons IO
  2. IO-261

Add FileUtils.getFile API with varargs parameter

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.1
    • Component/s: None
    • Labels:

      Description

      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;
      }

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                niallp Niall Pemberton
                Reporter:
                simpatico Gabriele Kahlout
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 24h
                  24h
                  Remaining:
                  Remaining Estimate - 24h
                  24h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified