private boolean preResourceExists(String path) {
   for (WebResourceSet webResourceSet : preResources) {
     WebResource webResource = webResourceSet.getResource(path);
     if (webResource.exists()) {
       return true;
     }
   }
   return false;
 }
  @Override
  public WebResource[] getResources(String path) {
    checkState();

    ArrayList<WebResource> result = new ArrayList<>();
    for (ArrayList<WebResourceSet> list : allResources) {
      for (WebResourceSet webResourceSet : list) {
        WebResource webResource = webResourceSet.getResource(path);
        if (webResource.exists()) {
          result.add(webResource);
        }
      }
    }

    if (result.size() == 0) {
      result.add(main.getResource(path));
    }

    return result.toArray(new WebResource[result.size()]);
  }
  protected WebResource getResourceInternal(String path) {
    checkState();

    WebResource result = null;
    for (ArrayList<WebResourceSet> list : allResources) {
      for (WebResourceSet webResourceSet : list) {
        result = webResourceSet.getResource(path);
        if (result.exists()) {
          return result;
        }
      }
    }

    // Default is empty resource in main resources
    return new EmptyResource(this, path);
  }