Package de.matrixweb.smaller.resource

Examples of de.matrixweb.smaller.resource.ResourceGroup


    if (!(resource instanceof ResourceGroup) || typeOption != null
        && resource.getType() != Type.valueOf(typeOption.toString())) {
      return resource;
    }

    final ResourceGroup group = (ResourceGroup) resource;
    final Resource input = group.getResources().get(0);

    final VFile snapshot = vfs.stack();
    try {
      final VFile target = vfs.find(input.getPath());
      final Writer writer = VFSUtils.createWriter(target);
      try {
        writer.write(group.getMerger().merge(group.getResources()));
      } finally {
        IOUtils.closeQuietly(writer);
      }
      return input.getResolver().resolve(target.getPath());
    } catch (final IOException e) {
View Full Code Here


        final List<Resource> res = resources.getByType(type);
        if (entry.processor.supportsType(type)) {
          LOGGER.info("Executing processor {} for type {}", entry.name, type);
          final List<Resource> results = new ArrayList<Resource>();
          // TODO: SourceMerger should not be required here
          final ResourceGroup group = new ResourceGroup(res, new SourceMerger(
              GlobalOptions.isSourceOnce(task)));
          group.apply(vfs, entry.processor, entry.options);
          results.addAll(group.getResources());
          resources.replace(res, results);
        }
      }
    }
  }
View Full Code Here

TOP

Related Classes of de.matrixweb.smaller.resource.ResourceGroup

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.