Пример #1
0
 @Override
 public boolean canHandle(Path path) {
   if (path.getPath().endsWith(".css")) {
     return true;
   }
   return false;
 }
Пример #2
0
  @Override
  public Resource getFileContents(Path path, List<Resource> locations) {
    String cssPath = _Url.unVersion(path.getPath(), this.getVersion());
    String lessPath = cssPath.replace(".css", ".less");

    for (Resource location : locations) {
      Resource relativeResource = _Resource.findExistingRelative(location, "/resources" + lessPath);

      if (relativeResource == null) {
        relativeResource = _Resource.findExistingRelative(location, "/resources" + cssPath);
      }

      if (relativeResource != null) {
        return relativeResource;
      }
    }

    return null;
  }