use of org.sonatype.nexus.blobstore.api.Blob in project nexus-repository-r by sonatype-nexus-community.
the class RRestoreBlobIT method runBlobRestore.
private void runBlobRestore(final boolean isDryRun) {
Asset asset;
Blob blob;
try (StorageTx tx = getStorageTx(proxyRepository)) {
tx.begin();
asset = tx.findAssetWithProperty(AssetEntityAdapter.P_NAME, AGRICOLAE_131_TARGZ.fullPath, tx.findBucket(proxyRepository));
assertThat(asset, Matchers.notNullValue());
blob = tx.getBlob(asset.blobRef());
}
testHelper.simulateAssetMetadataLoss();
Properties properties = new Properties();
properties.setProperty(HEADER_PREFIX + REPO_NAME_HEADER, proxyRepository.getName());
properties.setProperty(HEADER_PREFIX + BLOB_NAME_HEADER, asset.name());
properties.setProperty(HEADER_PREFIX + CONTENT_TYPE_HEADER, asset.contentType());
rRestoreBlobStrategy.restore(properties, blob, BlobStoreManager.DEFAULT_BLOBSTORE_NAME, isDryRun);
}
Aggregations