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>
|
<build>
|
||||||
<defaultGoal>package</defaultGoal>
|
<defaultGoal>package</defaultGoal>
|
||||||
<plugins>
|
<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>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-jar-plugin</artifactId>
|
<artifactId>maven-jar-plugin</artifactId>
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ public class ProxyConfigurationService extends AbstractService implements
|
|||||||
/**
|
/**
|
||||||
* The directory in which configuration files are stored
|
* The directory in which configuration files are stored
|
||||||
*/
|
*/
|
||||||
private File directory = new File("./config");
|
private final File directory = new File("./config");
|
||||||
/**
|
/**
|
||||||
* The logger
|
* The logger
|
||||||
*/
|
*/
|
||||||
@@ -85,6 +85,7 @@ public class ProxyConfigurationService extends AbstractService implements
|
|||||||
Properties properties;
|
Properties properties;
|
||||||
try {
|
try {
|
||||||
properties = findProperties(config);
|
properties = findProperties(config);
|
||||||
|
System.out.println(properties);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
properties = new Properties();
|
properties = new Properties();
|
||||||
logger.info(
|
logger.info(
|
||||||
@@ -248,9 +249,15 @@ public class ProxyConfigurationService extends AbstractService implements
|
|||||||
|
|
||||||
ConfigurationName config = findAnnotation(ConfigurationName.class,
|
ConfigurationName config = findAnnotation(ConfigurationName.class,
|
||||||
clazz);
|
clazz);
|
||||||
if (config == null)
|
Properties prop;
|
||||||
return null;
|
if (config == null) {
|
||||||
final Properties prop = new Properties();
|
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 File file = new File(directory, config.value() + ".properties");
|
||||||
final InputStream in = new FileInputStream(file);
|
final InputStream in = new FileInputStream(file);
|
||||||
try {
|
try {
|
||||||
@@ -297,15 +304,4 @@ public class ProxyConfigurationService extends AbstractService implements
|
|||||||
public File getDirectory() {
|
public File getDirectory() {
|
||||||
return directory;
|
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