test_class.file: http/src/test/java/ro/polak/http/utilities/FileUtilitiesTest.java
test_class.identifier: FileUtilitiesTest
test_case.body: @Test
      public void shouldFormatFileSize() {
          assertThat(FileUtilities.fileSizeUnits(1), is("1 B"));
          assertThat(FileUtilities.fileSizeUnits(1024), is("1.00 KB"));
          assertThat(FileUtilities.fileSizeUnits(1025), is("1.00 KB"));
          assertThat(FileUtilities.fileSizeUnits(1048576), is("1.00 MB"));
          assertThat(FileUtilities.fileSizeUnits(1048577), is("1.00 MB"));
          assertThat(FileUtilities.fileSizeUnits(1073741824), is("1.00 GB"));
          assertThat(FileUtilities.fileSizeUnits(1073741825), is("1.00 GB"));
      }
test_case.class_method_signature: FileUtilitiesTest.shouldFormatFileSize()
test_case.full_signature: @Test public void shouldFormatFileSize()
test_case.identifier: shouldFormatFileSize
test_case.invocations: assertThat fileSizeUnits is assertThat fileSizeUnits is assertThat fileSizeUnits is assertThat fileSizeUnits is assertThat fileSizeUnits is assertThat fileSizeUnits is assertThat fileSizeUnits is
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void shouldFormatFileSize()
focal_class.declarator: LOGGER = Logger.getLogger(FileUtilities.class.getName())
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOGGER = Logger.getLogger(FileUtilities.class.getName());
focal_class.type: Logger
focal_class.var_name: LOGGER
focal_class.declarator: BYTES_IN_KILOBYTE = 1024
focal_class.modifier: private static final
focal_class.original_string: private static final int BYTES_IN_KILOBYTE = 1024;
focal_class.type: int
focal_class.var_name: BYTES_IN_KILOBYTE
focal_class.declarator: BYTES_IN_MEGABYTE = 1048576
focal_class.modifier: private static final
focal_class.original_string: private static final int BYTES_IN_MEGABYTE = 1048576;
focal_class.type: int
focal_class.var_name: BYTES_IN_MEGABYTE
focal_class.declarator: BYTES_IN_GIGABYTE = 1073741824
focal_class.modifier: private static final
focal_class.original_string: private static final int BYTES_IN_GIGABYTE = 1073741824;
focal_class.type: int
focal_class.var_name: BYTES_IN_GIGABYTE
focal_class.file: http/src/main/java/ro/polak/http/utilities/FileUtilities.java
focal_class.identifier: FileUtilities
focal_class.class_method_signature: FileUtilities.FileUtilities()
focal_class.full_signature: private  FileUtilities()
focal_class.identifier: FileUtilities
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.signature:  FileUtilities()
focal_class.class_method_signature: FileUtilities.getExtension(final String filename)
focal_class.full_signature: public static String getExtension(final String filename)
focal_class.identifier: getExtension
focal_class.modifiers: public static
focal_class.parameters: (final String filename)
focal_class.return: String
focal_class.signature: String getExtension(final String filename)
focal_class.class_method_signature: FileUtilities.clearDirectory(final String directoryPath)
focal_class.full_signature: public static void clearDirectory(final String directoryPath)
focal_class.identifier: clearDirectory
focal_class.modifiers: public static
focal_class.parameters: (final String directoryPath)
focal_class.return: void
focal_class.signature: void clearDirectory(final String directoryPath)
focal_class.class_method_signature: FileUtilities.fileSizeUnits(final long length)
focal_class.full_signature: public static String fileSizeUnits(final long length)
focal_class.identifier: fileSizeUnits
focal_class.modifiers: public static
focal_class.parameters: (final long length)
focal_class.return: String
focal_class.signature: String fileSizeUnits(final long length)
focal_method.body: public static String fileSizeUnits(final long length) {
          if (length < BYTES_IN_KILOBYTE) {
              return length + " B";
          }
  
          double size = (double) length;
          NumberFormat nf = NumberFormat.getNumberInstance(Locale.US);
          DecimalFormat format = (DecimalFormat) nf;
          format.applyPattern("####0.00");
  
          if (length < BYTES_IN_MEGABYTE) {
              return format.format(size / BYTES_IN_KILOBYTE) + " KB";
          } else if (length < BYTES_IN_GIGABYTE) {
              return format.format(size / BYTES_IN_MEGABYTE) + " MB";
          } else {
              return format.format(size / BYTES_IN_GIGABYTE) + " GB";
          }
      }
focal_method.class_method_signature: FileUtilities.fileSizeUnits(final long length)
focal_method.full_signature: public static String fileSizeUnits(final long length)
focal_method.identifier: fileSizeUnits
focal_method.invocations: getNumberInstance applyPattern format format format
focal_method.modifiers: public static
focal_method.parameters: (final long length)
focal_method.return: String
focal_method.signature: String fileSizeUnits(final long length)