REPO-2724 Add repository.properties to ServerDescriptor configuration

This commit is contained in:
Alex Mukha
2017-08-04 13:17:34 +01:00
parent 497217a560
commit e6a93099bd
2 changed files with 47 additions and 41 deletions

View File

@@ -62,15 +62,17 @@ public class ServerDescriptorDAOImpl implements DescriptorDAO
/** /**
* Sets the server descriptor from a resource file. * Sets the server descriptor from a resource file.
* *
* @param descriptorResource * @param locations
* resource containing server descriptor meta-data * resources containing server descriptor meta-data
* @throws IOException * @throws IOException
* Signals that an I/O exception has occurred. * Signals that an I/O exception has occurred.
*/ */
public void setResource(final Resource descriptorResource) throws IOException public void setResource(final Resource[] locations) throws IOException
{ {
this.serverProperties = new Properties(); this.serverProperties = new Properties();
InputStream is = descriptorResource.getInputStream(); for (int i=0; i< locations.length; i++)
{
InputStream is = locations[i].getInputStream();
try try
{ {
this.serverProperties.load(is); this.serverProperties.load(is);
@@ -80,6 +82,7 @@ public class ServerDescriptorDAOImpl implements DescriptorDAO
if (is != null) try { is.close(); } catch (IOException e) {} if (is != null) try { is.close(); } catch (IOException e) {}
} }
} }
}
public Descriptor getDescriptor() public Descriptor getDescriptor()
{ {

View File

@@ -859,7 +859,10 @@
<value>${repository.name}</value> <value>${repository.name}</value>
</property> </property>
<property name="resource"> <property name="resource">
<list>
<value>classpath:alfresco/version.properties</value> <value>classpath:alfresco/version.properties</value>
<value>classpath:alfresco/repository.properties</value>
</list>
</property> </property>
</bean> </bean>