|
|
@ -120,11 +120,11 @@ public class RedissonRegionFactory extends RegionFactoryTemplate {
|
|
|
|
|
|
|
|
|
|
|
|
private Config loadConfig(String configPath) {
|
|
|
|
private Config loadConfig(String configPath) {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
return Config.fromJSON(new File(configPath));
|
|
|
|
return Config.fromYAML(new File(configPath));
|
|
|
|
} catch (IOException e) {
|
|
|
|
} catch (IOException e) {
|
|
|
|
// trying next format
|
|
|
|
// trying next format
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
return Config.fromYAML(new File(configPath));
|
|
|
|
return Config.fromJSON(new File(configPath));
|
|
|
|
} catch (IOException e1) {
|
|
|
|
} catch (IOException e1) {
|
|
|
|
throw new CacheException("Can't parse default yaml config", e1);
|
|
|
|
throw new CacheException("Can't parse default yaml config", e1);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -135,11 +135,11 @@ public class RedissonRegionFactory extends RegionFactoryTemplate {
|
|
|
|
InputStream is = classLoader.getResourceAsStream(fileName);
|
|
|
|
InputStream is = classLoader.getResourceAsStream(fileName);
|
|
|
|
if (is != null) {
|
|
|
|
if (is != null) {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
return Config.fromJSON(is);
|
|
|
|
return Config.fromYAML(is);
|
|
|
|
} catch (IOException e) {
|
|
|
|
} catch (IOException e) {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
is = classLoader.getResourceAsStream(fileName);
|
|
|
|
is = classLoader.getResourceAsStream(fileName);
|
|
|
|
return Config.fromYAML(is);
|
|
|
|
return Config.fromJSON(is);
|
|
|
|
} catch (IOException e1) {
|
|
|
|
} catch (IOException e1) {
|
|
|
|
throw new CacheException("Can't parse yaml config", e1);
|
|
|
|
throw new CacheException("Can't parse yaml config", e1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|