File | Line |
---|
org/apache/geronimo/system/repository/UnpackArtifactTypeHandler.java | 35 |
org/apache/geronimo/system/repository/CopyArtifactTypeHandler.java | 33 |
public class CopyArtifactTypeHandler implements ArtifactTypeHandler {
private final static int TRANSFER_NOTIFICATION_SIZE = 10240; // announce every this many bytes
private final static int TRANSFER_BUF_SIZE = 10240; // try this many bytes at a time
public void install(InputStream source, int size, Artifact artifact, FileWriteMonitor monitor, File target) throws IOException {
// assure that the target directory exists
File parent = target.getParentFile();
if (!parent.exists() && !parent.mkdirs()) {
throw new RuntimeException("Unable to create directory " + parent.getAbsolutePath());
}
// copy it
if (monitor != null) {
monitor.writeStarted(artifact.toString(), size);
}
int total = 0; |