code: long freeSpaceOS(final String path, final int os, final boolean kb, final long timeout) throws IOException {
          if (path == null) {
              throw new IllegalArgumentException("Path must not be null");
          }
          switch (os) {
              case WINDOWS:
                  return kb ? freeSpaceWindows(path, timeout) / 1024 : freeSpaceWindows(path, timeout);
              case UNIX:
                  return freeSpaceUnix(path, kb, false, timeout);
              case POSIX_UNIX:
                  return freeSpaceUnix(path, kb, true, timeout);
              case OTHER:
                  throw new IllegalStateException("Unsupported operating system");
              default:
                  throw new IllegalStateException("Exception caught when determining operating system");
          }
      }
docs: Returns the free space on a drive or volume in a cross-platform manner.
  Note that some OS's are NOT currently supported, including OS/390.
  <pre>
  FileSystemUtils.freeSpace("C:");  // Windows
  FileSystemUtils.freeSpace("/volume");  // *nix
  </pre>
  The free space is calculated via the command line.
  It uses 'dir /-c' on Windows and 'df' on *nix.
  
  @param path  the path to get free space for, not null, not empty on Unix
  @param os  the operating system code
  @param kb  whether to normalize to kilobytes
  @param timeout The timeout amount in milliseconds or no timeout if the value
  is zero or less
  @return the amount of free drive space on the drive or volume
  @throws IllegalArgumentException if the path is invalid
  @throws IllegalStateException if an error occurred in initialisation
  @throws IOException if an error occurs when finding the free space