Package ro.isdc.wro

Examples of ro.isdc.wro.WroRuntimeException


        if (factory instanceof ConfigurableWroManagerFactory) {
          ((ConfigurableWroManagerFactory) factory).addConfigProperties(properties);
        }
        return factory;
      } catch (final Exception e) {
        throw new WroRuntimeException("Exception while loading WroManagerFactory class:" + wroManagerClassName, e);
      }
    }
  }
View Full Code Here


   * @return
   */
  private String replaceVariable(final Properties properties, final String variableName) {
    final String variableValue = properties.getProperty(variableName);
    if (!ignoreMissingVariables && variableValue == null) {
      throw new WroRuntimeException("No value defind for variable called: [" + variableName + "]");
    }

    final String result = variableValue == null ? StringUtils.EMPTY : variableValue;
    LOG.debug("replacing: [{}] with [{}]", variableName, result);
    return result;
View Full Code Here

      final String hash = new BigInteger(1, digest).toString(16);

      LOG.debug("{} hash: {}", getClass().getSimpleName(), hash);
      return hash;
    } catch (final NoSuchAlgorithmException e) {
      throw new WroRuntimeException("Exception occured while computing hash", e);
    }finally{
      IOUtils.closeQuietly(input);
    }
  }
View Full Code Here

      if (isValidateXml()) {
        validate(document);
      }
      return document;
    } catch (final Exception e) {
      throw new WroRuntimeException("Cannot build model from XML: " + e.getMessage(), e);
    }
  }
View Full Code Here

    final Group foundGroup = modelInspector.getGroupByName(groupName);
    if (foundGroup == null) {
      Collection<Resource> groupResources = null;
      final Element groupElement = allGroupElements.get(groupName);
      if (groupElement == null) {
        throw new WroRuntimeException("Invalid group-ref: " + groupName);
      }
      groupResources = parseGroup(groupElement);
      return groupResources;
    }
    return foundGroup.getResources();
View Full Code Here

  @Test
  public void shouldBuildConfigurationEvenWhenDefaultPropertiesFileIsNotAvailable() {
    factory = new PropertiesAndFilterConfigWroConfigurationFactory(filterConfig) {
      @Override
      protected Properties newDefaultProperties(){
        throw new WroRuntimeException("Cannot build default properties found");
      }
    };
    Assert.assertNotNull(factory.create());
  }
View Full Code Here

          }
        } else {
          parseHeader(headersAsString);
        }
      } catch (final Exception e) {
        throw new WroRuntimeException("Invalid header init-param value: " + headersAsString
            + ". A correct value should have the following format: "
            + "<HEADER_NAME1>: <VALUE1> | <HEADER_NAME2>: <VALUE2>. " + "Ex: <look like this: "
            + "Expires: Thu, 15 Apr 2010 20:00:00 GMT | cache-control: public", e);
      }
    }
View Full Code Here

  public void process(final Resource resource, final Reader reader, final Writer writer)
      throws IOException {
    final ResourcePreProcessor decoratedProcessor = getDecoratedObject();
    if (decoratedProcessor instanceof SupportAware) {
      if (!((SupportAware) decoratedProcessor).isSupported()) {
        throw new WroRuntimeException(toString() + " processor is not supported on this environment");
      }
    }
    super.process(resource, reader, writer);
  }
View Full Code Here

      injector.inject(transformer);
      LOG.debug("using transformer: {}", transformer.getClass());
      try {
        model = transformer.transform(model);
      } catch (final Exception e) {
        throw new WroRuntimeException("Exception during model transformation", e);
      }
    }
    return model;
  }
View Full Code Here

      LOG.error("Error while creating the model", e);
    }
    if (newModel == null) {
      LOG.warn("Couldn't load new model, reusing last Valid Model!");
      if (lastValidModel == null) {
        throw new WroRuntimeException("No valid model was found!");
      }
      return lastValidModel;
    }
    lastValidModel = newModel;
    return lastValidModel;
View Full Code Here

TOP

Related Classes of ro.isdc.wro.WroRuntimeException

Copyright © 2018 www.massapicom. 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.