Commons IO
  1. Commons IO
  2. IO-238

Add sizeOf(File) Method to FileUtils

    Details

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

      Java 1.4+

      Description

      I suggest adding a "size of" method to FileUtils that will appropriately call File.length() or FileUtils.sizeOfDirectory(File) based on whether or not the file is a regular file or a directory. I propose the following signature:

      long sizeOf(File)

        Activity

        Hide
        Niall Pemberton added a comment -
        Show
        Niall Pemberton added a comment - Fixed, thanks for the patch: http://svn.apache.org/viewvc?view=revision&revision=1002367
        Hide
        Michael Wooten added a comment -

        The patch was created with Eclipse and contains the sizeOf() method described in the description, as well as a test case for it.

        Show
        Michael Wooten added a comment - The patch was created with Eclipse and contains the sizeOf() method described in the description, as well as a test case for it.

          People

          • Assignee:
            Unassigned
            Reporter:
            Michael Wooten
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

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

                Development