br.com.objectos.way.etc.ResourceCopyEvalSelection Maven / Gradle / Ivy
The newest version!
/*
* ResourceCopyEvalSelection.java criado em 15/12/2013
*
* Propriedade de Objectos Fábrica de Software LTDA.
* Reprodução parcial ou total proibida.
*/
package br.com.objectos.way.etc;
import java.io.File;
import java.io.IOException;
import java.util.Set;
import com.google.common.io.ByteSource;
import com.google.common.io.Files;
/**
* @author [email protected] (Marcio Endo)
*/
class ResourceCopyEvalSelection extends ResourceCopyEval {
public ResourceCopyEvalSelection(ResourceSet set, Resource resource) {
super(set, resource);
}
@Override
void copy(String name, ByteSource source, File file) throws IOException {
Set evalNames = set.getEvalNames();
if (evalNames.contains(resource)) {
super.copy(name, source, file);
} else {
source.copyTo(Files.asByteSink(file));
}
}
}