← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 20262: minor

 

------------------------------------------------------------
revno: 20262
committer: Halvdan Hoem Grelland <halvdanhg@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2015-09-21 15:01:26 +0200
message:
  minor
modified:
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/fileresource/DefaultFileResourceContentStore.java


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/fileresource/DefaultFileResourceContentStore.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/fileresource/DefaultFileResourceContentStore.java	2015-09-21 12:56:46 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/fileresource/DefaultFileResourceContentStore.java	2015-09-21 13:01:26 +0000
@@ -85,19 +85,19 @@
     // Property keys
     // -------------------------------------------------------------------------
 
-    private static final String FILESTORE_CONFIG_NAMESPACE = "filestore";
+    private static final String FILE_STORE_CONFIG_NAMESPACE = "filestore";
 
-    private static final String KEY_FILESTORE_PROVIDER = FILESTORE_CONFIG_NAMESPACE + ".provider";
-    private static final String KEY_FILESTORE_CONTAINER = FILESTORE_CONFIG_NAMESPACE + ".container";
-    private static final String KEY_FILESTORE_LOCATION = FILESTORE_CONFIG_NAMESPACE + ".location";
-    private static final String KEY_FILESTORE_IDENTITY = FILESTORE_CONFIG_NAMESPACE + ".identity";
-    private static final String KEY_FILESTORE_SECRET = FILESTORE_CONFIG_NAMESPACE + ".secret";
+    private static final String KEY_FILE_STORE_PROVIDER  = FILE_STORE_CONFIG_NAMESPACE + ".provider";
+    private static final String KEY_FILE_STORE_CONTAINER = FILE_STORE_CONFIG_NAMESPACE + ".container";
+    private static final String KEY_FILE_STORE_LOCATION  = FILE_STORE_CONFIG_NAMESPACE + ".location";
+    private static final String KEY_FILE_STORE_IDENTITY  = FILE_STORE_CONFIG_NAMESPACE + ".identity";
+    private static final String KEY_FILE_STORE_SECRET    = FILE_STORE_CONFIG_NAMESPACE + ".secret";
 
     // -------------------------------------------------------------------------
     // Defaults
     // -------------------------------------------------------------------------
 
-    private static final String DEFAULT_CONTAINER = "dhis2_filestore";
+    private static final String DEFAULT_CONTAINER = "dhis2-file-store";
 
     // -------------------------------------------------------------------------
     // Dependencies
@@ -131,13 +131,13 @@
         Properties properties = configurationProvider.getConfiguration().getProperties();
 
         Map<String, String> fileStoreConfiguration = properties
-            .entrySet().stream().filter( p -> ((String) p.getKey()).startsWith( FILESTORE_CONFIG_NAMESPACE ) )
+            .entrySet().stream().filter( p -> ((String) p.getKey()).startsWith( FILE_STORE_CONFIG_NAMESPACE ) )
             .collect( Collectors.toMap(
                 p -> StringUtils.strip( (String) p.getKey() ),
                 p -> StringUtils.strip( (String) p.getValue() )
             ) );
 
-        String provider = fileStoreConfiguration.getOrDefault( KEY_FILESTORE_PROVIDER, JCLOUDS_PROVIDER_KEY_FILESYSTEM );
+        String provider = fileStoreConfiguration.getOrDefault( KEY_FILE_STORE_PROVIDER, JCLOUDS_PROVIDER_KEY_FILESYSTEM );
 
         if ( !SUPPORTED_PROVIDERS.contains( provider ) )
         {
@@ -151,9 +151,9 @@
             provider = JCLOUDS_PROVIDER_KEY_TRANSIENT;
         }
 
-        container = fileStoreConfiguration.getOrDefault( KEY_FILESTORE_CONTAINER, DEFAULT_CONTAINER );
+        container = fileStoreConfiguration.getOrDefault( KEY_FILE_STORE_CONTAINER, DEFAULT_CONTAINER );
 
-        String location = fileStoreConfiguration.getOrDefault( KEY_FILESTORE_LOCATION, null );
+        String location = fileStoreConfiguration.getOrDefault( KEY_FILE_STORE_LOCATION, null );
         Properties overrides = new Properties();
         Credentials credentials = new Credentials( "Unused", "Unused" );
 
@@ -170,7 +170,7 @@
         else if ( provider.equals( JCLOUDS_PROVIDER_KEY_AWS_S3 ) )
         {
             credentials = new Credentials( fileStoreConfiguration.getOrDefault(
-                KEY_FILESTORE_IDENTITY, "" ), fileStoreConfiguration.getOrDefault( KEY_FILESTORE_SECRET, "" ) );
+                KEY_FILE_STORE_IDENTITY, "" ), fileStoreConfiguration.getOrDefault( KEY_FILE_STORE_SECRET, "" ) );
 
             log.info( "AWS S3 filestore provider configured." );