public static int getTypeOfFile(String path, boolean isDirectory) {
    String mimeType = MimeTypes.getMimeType(path, isDirectory);
    if (mimeType == null) return NOT_KNOWN;

    Integer type = sMimeIconIds.get(mimeType);
    if (type != null) return type;
    else {
      if (checkType(mimeType, "text")) return TEXT;
      else if (checkType(mimeType, "image")) return IMAGE;
      else if (checkType(mimeType, "video")) return VIDEO;
      else if (checkType(mimeType, "audio")) return AUDIO;
      else if (checkType(mimeType, "crypt")) return ENCRYPTED;
      else return NOT_KNOWN;
    }
  }
@Test
  public void testReturnArchiveTypes() {
    assertEquals(Icons.COMPRESSED, Icons.getTypeOfFile("archive.zip", false));
    assertEquals(Icons.COMPRESSED, Icons.getTypeOfFile("archive.rar", false));
    assertEquals(Icons.COMPRESSED, Icons.getTypeOfFile("archive.tar", false));
    assertEquals(Icons.COMPRESSED, Icons.getTypeOfFile("archive.tar.gz", false));
    assertEquals(Icons.COMPRESSED, Icons.getTypeOfFile("archive.tar.lzma", false));
    assertEquals(Icons.COMPRESSED, Icons.getTypeOfFile("archive.tar.xz", false));
    assertEquals(Icons.COMPRESSED, Icons.getTypeOfFile("archive.tar.bz2", false));
    assertEquals(Icons.COMPRESSED, Icons.getTypeOfFile("archive.txt.bz2", false));
    assertEquals(Icons.COMPRESSED, Icons.getTypeOfFile("archive.txt.gz", false));
    assertEquals(Icons.COMPRESSED, Icons.getTypeOfFile("archive.txt.gz", false));
  }