Package ro.isdc.wro.model.resource.locator.factory

Examples of ro.isdc.wro.model.resource.locator.factory.UriLocatorFactory.locate()


    final HashStrategy hashStrategy = manager.getHashStrategy();
    final UriLocatorFactory locatorFactory = manager.getUriLocatorFactory();
    // using AtomicBoolean because we need to mutate this variable inside an anonymous class.
    final AtomicBoolean changeDetected = new AtomicBoolean(false);
    try {
      final String fingerprint = hashStrategy.getHash(locatorFactory.locate(resource.getUri()));
      final String previousFingerprint = getBuildContextHolder().getValue(resource.getUri());

      final boolean newValue = fingerprint != null && !fingerprint.equals(previousFingerprint);
      changeDetected.set(newValue);
View Full Code Here


      final boolean newValue = fingerprint != null && !fingerprint.equals(previousFingerprint);
      changeDetected.set(newValue);

      if (!changeDetected.get() && resource.getType() == ResourceType.CSS) {
        final Reader reader = new InputStreamReader(locatorFactory.locate(resource.getUri()));
        getLog().debug("Check @import directive from " + resource);
        // detect changes in imported resources.
        detectChangeForCssImports(resource, reader, changeDetected);
      }
      return changeDetected.get();
View Full Code Here

    if (rememberedSet.contains(resource.getUri())) {
      // only calculate fingerprints and check imports if not already done
      getLog().debug("Resource with uri '" + resource.getUri() + "' has already been updated in this run.");
    } else {
      try {
        final String fingerprint = hashStrategy.getHash(locatorFactory.locate(resource.getUri()));
        getBuildContextHolder().setValue(resource.getUri(), fingerprint);
        rememberedSet.add(resource.getUri());
        getLog().debug("Persist fingerprint for resource '" + resource.getUri() + "' : " + fingerprint);
        if (resource.getType() == ResourceType.CSS) {
          final Reader reader = new InputStreamReader(locatorFactory.locate(resource.getUri()));
View Full Code Here

        final String fingerprint = hashStrategy.getHash(locatorFactory.locate(resource.getUri()));
        getBuildContextHolder().setValue(resource.getUri(), fingerprint);
        rememberedSet.add(resource.getUri());
        getLog().debug("Persist fingerprint for resource '" + resource.getUri() + "' : " + fingerprint);
        if (resource.getType() == ResourceType.CSS) {
          final Reader reader = new InputStreamReader(locatorFactory.locate(resource.getUri()));
          getLog().debug("Check @import directive from " + resource);
          // persist fingerprints in imported resources.
          persistFingerprintsForCssImports(resource, reader);
        }
      } catch (final IOException e) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.