Example #1
0
 private void save(final ExecFileLoader loader) {
   log(format("Writing merged execution data to %s", destfile.getAbsolutePath()));
   try {
     loader.save(destfile, false);
   } catch (final IOException e) {
     throw new BuildException(
         format("Unable to write merged file %s", destfile.getAbsolutePath()), e, getLocation());
   }
 }
Example #2
0
  private void load(final ExecFileLoader loader) {
    final Iterator<?> resourceIterator = files.iterator();
    while (resourceIterator.hasNext()) {
      final Resource resource = (Resource) resourceIterator.next();

      if (resource.isDirectory()) {
        continue;
      }

      log(format("Loading execution data file %s", resource));

      InputStream resourceStream = null;
      try {
        resourceStream = resource.getInputStream();
        loader.load(resourceStream);
      } catch (final IOException e) {
        throw new BuildException(format("Unable to read %s", resource), e, getLocation());
      } finally {
        FileUtils.close(resourceStream);
      }
    }
  }