рефакторинг публикации компонентов
This commit is contained in:
@@ -520,10 +520,10 @@ public class Utils_ {
|
||||
}
|
||||
//--
|
||||
public static <T extends Properties> T SynschronizeProperties(File propertiesFile, Class<T> properties_class) {
|
||||
T res= null;
|
||||
T res = null;
|
||||
try {
|
||||
res= properties_class.newInstance();
|
||||
if (propertiesFile.exists()){
|
||||
res = properties_class.newInstance();
|
||||
if (propertiesFile.exists()) {
|
||||
//файл существует. нужно его ссчитать.
|
||||
res = (T) Utils_.jsonFromFile(propertiesFile, properties_class);
|
||||
}
|
||||
@@ -535,8 +535,8 @@ public class Utils_ {
|
||||
}
|
||||
return res;
|
||||
}
|
||||
public static <T extends Properties> T ReadProperties(File propertiesFile, Class<T>properties_class){
|
||||
T res= null;
|
||||
public static <T extends Properties> T ReadProperties(File propertiesFile, Class<T> properties_class) {
|
||||
T res = null;
|
||||
try {
|
||||
res = (T) Utils_.jsonFromFile(propertiesFile, properties_class);
|
||||
res.setFile(propertiesFile);
|
||||
@@ -546,4 +546,12 @@ public class Utils_ {
|
||||
}
|
||||
return res;
|
||||
}
|
||||
public static File getFile(String... paths) {
|
||||
if (paths.length == 0)
|
||||
return null;
|
||||
File res = new File(paths[0]);
|
||||
for (int i = 1; i < paths.length; ++i)
|
||||
res = new File(res, paths[i]);
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user