private static String determineMediaType(String path)
  {
    int extensionIndex = path.lastIndexOf('.');

    if (extensionIndex != -1)
    {
      String extension = path.substring(extensionIndex);

      if (extension.equals(".html"))
      {
        return HEADER_VALUE_TEXT_HTML;
      }
      else if (extension.equals(".js"))
      {
        return HEADER_VALUE_APPLICATION_JS;
      }
      else if (extension.equals(".css"))
      {
        return HEADER_VALUE_TEXT_CSS;
      }
      else if (extension.equals(".png"))
      {
        return HEADER_VALUE_IMAGE_PNG;
      }
    }

    return null;
  }
@Test
  public void testStaticContent() throws IOException
  {
    ClassLoader classLoader = ParseqTraceDebugRequestHandler.class.getClassLoader();

    //Collect all files under tracevis folder in the jar containing the parseq trace debug request handler.
    Enumeration<URL> resources = classLoader.getResources(
        ParseqTraceDebugRequestHandler.class.getName().replace('.', '/') + ".class");
    List<String> files = new ArrayList<>();

    while (resources.hasMoreElements())
    {
      URL url = resources.nextElement();
      URLConnection urlConnection = url.openConnection();

      if (urlConnection instanceof JarURLConnection)
      {
        JarURLConnection jarURLConnection = (JarURLConnection) urlConnection;
        JarFile jar = jarURLConnection.getJarFile();

        Enumeration<JarEntry> entries = jar.entries();
        while (entries.hasMoreElements())
        {
          JarEntry currentEntry = entries.nextElement();

          if (!currentEntry.isDirectory())
          {
            String entry = currentEntry.getName();
            if (entry.startsWith("tracevis/"))
            {
              files.add(entry);
            }
          }
        }
      }
    }

    Assert.assertTrue(files.size() > 0);

    //Go through the tracevis files and skip over the known metadata files
    // All other files should be retrievable from the parseq trace debug request handler.
    for (String file : files)
    {
      final String mimeType = determineMediaType(file);
      final URI uri = URI.create("http://host/abc/12/__debug/parseqtrace/" +
                               file.substring(file.indexOf('/') + 1));

      executeRequestThroughParseqDebugHandler(
              uri,
              new Callback<RestResponse>()
              {
                @Override
                public void onError(Throwable e)
                {
                  Assert.fail("Static content cannot be retrieved for " + uri.toString());
                }

                @Override
                public void onSuccess(RestResponse result)
                {
                  Assert.assertEquals(result.getHeader(RestConstants.HEADER_CONTENT_TYPE), mimeType);
                }
              });
    }
  }