mirror of
https://github.com/Rogiel/l2jserver2
synced 2025-12-06 07:32:46 +00:00
Fix for ProxyConfigurationService
Signed-off-by: Rogiel <rogiel@rogiel.com>
This commit is contained in:
4
dist/config/database.properties
vendored
Normal file
4
dist/config/database.properties
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
jdbc.mysql.url = jdbc:mysql://localhost/l2jserver2
|
||||
jdbc.mysql.driver = com.mysql.jdbc.Driver
|
||||
jdbc.mysql.username = l2j
|
||||
jdbc.mysql.password = changeme
|
||||
8
pom.xml
8
pom.xml
@@ -168,6 +168,14 @@
|
||||
<build>
|
||||
<defaultGoal>package</defaultGoal>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>2.8.1</version>
|
||||
<configuration>
|
||||
<skipTests>true</skipTests>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
|
||||
@@ -55,7 +55,7 @@ public class ProxyConfigurationService extends AbstractService implements
|
||||
/**
|
||||
* The directory in which configuration files are stored
|
||||
*/
|
||||
private File directory = new File("./config");
|
||||
private final File directory = new File("./config");
|
||||
/**
|
||||
* The logger
|
||||
*/
|
||||
@@ -85,6 +85,7 @@ public class ProxyConfigurationService extends AbstractService implements
|
||||
Properties properties;
|
||||
try {
|
||||
properties = findProperties(config);
|
||||
System.out.println(properties);
|
||||
} catch (IOException e) {
|
||||
properties = new Properties();
|
||||
logger.info(
|
||||
@@ -248,9 +249,15 @@ public class ProxyConfigurationService extends AbstractService implements
|
||||
|
||||
ConfigurationName config = findAnnotation(ConfigurationName.class,
|
||||
clazz);
|
||||
if (config == null)
|
||||
return null;
|
||||
final Properties prop = new Properties();
|
||||
Properties prop;
|
||||
if (config == null) {
|
||||
for (final Class<?> parent : clazz.getInterfaces()) {
|
||||
prop = findProperties(parent);
|
||||
if(prop != null)
|
||||
return prop;
|
||||
}
|
||||
}
|
||||
prop = new Properties();
|
||||
final File file = new File(directory, config.value() + ".properties");
|
||||
final InputStream in = new FileInputStream(file);
|
||||
try {
|
||||
@@ -297,15 +304,4 @@ public class ProxyConfigurationService extends AbstractService implements
|
||||
public File getDirectory() {
|
||||
return directory;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the configuration store directory
|
||||
*
|
||||
* @param directory
|
||||
* the directory
|
||||
*/
|
||||
public void setDirectory(File directory) {
|
||||
Preconditions.checkNotNull(directory, "directory");
|
||||
this.directory = directory;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user