package org.datavaultplatform.common.io;

public class FileUtils extends org.apache.commons.io.FileUtils {
    
    public static char[] units = new char[] { 'K','M','G','T' };
    
    public static long parseFormattedSizeToBytes(String humanReadableSize) {
        int identifier = -1;
        long value = -1;
        int units_index = -1;
        
        while ( identifier == -1 && units_index < (units.length-1) ) {
            units_index++;
            identifier = humanReadableSize.toUpperCase().indexOf(units[units_index]);
        }
        
        if (identifier >= 0) {
            value = Long.parseLong(humanReadableSize.substring(0,identifier).trim());
            
            boolean si = true;
            if( identifier == (humanReadableSize.length()-3) &&
                    humanReadableSize.charAt(identifier+1) == 'i' &&
                    humanReadableSize.charAt(identifier+2) == 'B' ) {
                // identifier followed by "iB" then use Binary size i.e. GiB, MiB, KiB ect...
                si = false;
            }
            
            for (int i = 0; i <= units_index; i++) {
                value = value * (si ? 1000 : 1024);
            }
        } else {
            value = Long.parseLong(humanReadableSize.trim());
        }
        
        return value;
    }
}

@@ -35,16 +35,162 @@
 on.io;%0A%0A
+/**%0A * This Class is an extension of %7B@link org.apache.commons.io.FileUtils%7D to add some util features required for the%0A * datavault project.%0A */%0A
 public c
@@ -316,20 +316,214 @@
 ,'T' %7D;%0A
+%0A%0A
     
+/**%0A     * Take a human readable size (i.e 1GB, 50MB, 10K) and turn it in a long representing the number of Bytes.%0A     *%0A     * @param humanReadableSize%0A     * @return Number of Bytes%0A     */
 %0A    pub
@@ -639,21 +639,16 @@
 ng value
- = -1
 ;%0A      
@@ -671,24 +671,16 @@
 x = -1;%0A
-        
 %0A       
@@ -992,28 +992,16 @@
 rim());%0A
-            
 %0A       

Add a few comments in datavaultplatform.common.io.FileUtils