Commit 4c649228 authored by Erik Leckner's avatar Erik Leckner
Browse files

file-azure

parent a99c2e8a
......@@ -44,14 +44,10 @@ public class StorageRepository implements IStorageRepository {
@Inject
final Storage storage;
@Value("${azure.storage.account}")
private static String azureStorageAccount;
private String storageAccount;
private String storageAccount = getStorageAccount();
public StorageRepository(Storage storage) {
this.storage = storage;
this.storageAccount = getStorageAccount();
}
@Override
......@@ -62,7 +58,7 @@ public class StorageRepository implements IStorageRepository {
.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE)
.build();
Blob blob = storage.create(blobInfo, ArrayUtils.EMPTY_BYTE_ARRAY);
log.debug("Created the blob in container {} for path {}", containerName, filepath);
log.debug("Created the blob in container {} for path {}", containerName, filepath);
System.out.println(String.format("Created the blob in container %s for path %s", containerName, filepath));
URL signedUrl = storage.signUrl(blobInfo, 7L, TimeUnit.DAYS);
log.debug("Signed URL for created storage object. Object ID : {} , Signed URL : {}",
......@@ -74,7 +70,7 @@ public class StorageRepository implements IStorageRepository {
}
public static String getStorageAccount() {
return azureStorageAccount;
return System.getProperty("AZURE_STORAGE_ACCOUNT", System.getenv("AZURE_STORAGE_ACCOUNT"));
}
private URI getObjectUri(Blob blob) {
......
......@@ -97,10 +97,10 @@ public class StorageImpl implements Storage {
return null;
}
@SneakyThrows
@Override
public URL signUrl(BlobInfo blobInfo, long duration, TimeUnit timeUnit) {
URL url = null;
try {
log.debug("Signing the blob in container {} for path {}", blobInfo.getContainer(), blobInfo.getName());
System.out.println(String.format("Signing the blob in container %s for path %s", blobInfo.getContainer(), blobInfo.getName()));
......
......@@ -23,8 +23,8 @@ azure.cosmosdb.database=${cosmosdb_database}
azure.keyvault.url=${keyvault_url}
# Azure Blob Storage configuration
file.location.containerName=odes-os-file-temp
file.location.userId=common-user
file.location.containerName=osdu-container
file.location.userId=osdu-user
azure.storage.account=${AZURE_STORAGE_ACCOUNT}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment