Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Kelly Domico
OS Core Lib Azure
Commits
d70eef96
Commit
d70eef96
authored
Sep 04, 2020
by
Aman Verma
Committed by
Kishore Battula
Sep 04, 2020
Browse files
Adding conditional propery for blobStore class
parent
923d8013
Changes
4
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
d70eef96
...
...
@@ -79,4 +79,9 @@ Enabled transaction logger and slf4jlogger
| --- | --- | --- |
|
`tenantInfo.container.name`
|
`TenantInfo`
| cosmos container name |
|
`azure.cosmosdb.database`
| ex
`dev-osdu-r2-db`
| cosmos database name |
|
`storage_account`
| ex
`testStorage`
| storage account name |
\ No newline at end of file
## Settings to be added in application.properties to consume the BlobStore
| name | value | description |
| --- | --- | --- |
|
`azure.blobStore.required`
|
`true`
| - |
|
`azure.storage.account-name`
| ex
`testStorage`
| storage account name |
pom.xml
View file @
d70eef96
...
...
@@ -21,7 +21,7 @@
<groupId>
org.opengroup.osdu
</groupId>
<artifactId>
core-lib-azure
</artifactId>
<packaging>
jar
</packaging>
<version>
0.0.2
3
</version>
<version>
0.0.2
4
</version>
<name>
core-lib-azure
</name>
<properties>
...
...
src/main/java/org/opengroup/osdu/azure/blobstorage/BlobServiceClientFactoryImpl.java
View file @
d70eef96
...
...
@@ -20,12 +20,14 @@ import com.azure.storage.blob.BlobServiceClientBuilder;
import
org.opengroup.osdu.azure.di.BlobStoreConfiguration
;
import
org.opengroup.osdu.common.Validators
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
;
import
org.springframework.stereotype.Component
;
/**
* Implementation for IBlobServiceClientFactory.
*/
@Component
@ConditionalOnProperty
(
value
=
"azure.blobStore.required"
,
havingValue
=
"true"
,
matchIfMissing
=
false
)
public
class
BlobServiceClientFactoryImpl
implements
IBlobServiceClientFactory
{
private
BlobServiceClient
blobServiceClient
;
...
...
src/main/java/org/opengroup/osdu/azure/blobstorage/BlobStore.java
View file @
d70eef96
...
...
@@ -22,7 +22,7 @@ import com.azure.storage.blob.specialized.BlockBlobClient;
import
org.opengroup.osdu.core.common.logging.ILogger
;
import
org.opengroup.osdu.core.common.model.http.AppException
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.
context.annotation.Laz
y
;
import
org.springframework.
boot.autoconfigure.condition.ConditionalOnPropert
y
;
import
org.springframework.stereotype.Component
;
import
java.io.ByteArrayOutputStream
;
...
...
@@ -78,7 +78,7 @@ import java.util.Collections;;
*/
@Component
@
Lazy
@
ConditionalOnProperty
(
value
=
"azure.blobStore.required"
,
havingValue
=
"true"
,
matchIfMissing
=
false
)
public
class
BlobStore
{
@Autowired
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment