use of io.codekvast.javaagent.model.v3.CodeBasePublication3 in project codekvast by crispab.
the class HttpCodeBasePublisherImpl method doPublishCodeBase.
@Override
public void doPublishCodeBase(CodeBase codeBase) throws CodekvastPublishingException {
String url = getConfig().getCodeBaseUploadEndpoint();
File file = null;
try {
CodeBasePublication3 publication = codeBase.getCodeBasePublication(getCustomerId(), this.getSequenceNumber());
file = FileUtils.serializeToFile(publication, getConfig().getFilenamePrefix("codebase-"), ".ser");
doPost(file, url, codeBase.getFingerprint().toString(), publication.getEntries().size());
logger.fine(String.format("Codekvast uploaded %d methods (%s) to %s", publication.getEntries().size(), LogUtil.humanReadableByteCount(file.length()), url));
} catch (IOException e) {
throw new CodekvastPublishingException("Cannot upload code base to " + url, e);
} finally {
FileUtils.safeDelete(file);
}
}
Aggregations