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

Add FileUtils.getFile API with varargs parameter

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 2.1
    • None

    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

              niallp Niall Pemberton
              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