no message
This commit is contained in:
@@ -4,9 +4,9 @@ import org.apache.commons.io.FileUtils;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.concurrent.Callable;
|
||||
public class InterruptThread extends Thread{
|
||||
public class InterruptThread extends Thread {
|
||||
//------------
|
||||
public InterruptThread(int sleep_ms, Callable action){
|
||||
public InterruptThread(int sleep_ms, Callable action) {
|
||||
super(() -> {
|
||||
File interruptFile = new File(Constants.INTERRUPT);
|
||||
try {
|
||||
|
||||
@@ -22,28 +22,10 @@ import java.util.concurrent.Semaphore;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.stream.Collectors;
|
||||
public class Utils_ {
|
||||
static String HomePath = System.getProperty("user.dir");
|
||||
public static void setHomePath(String path_in){
|
||||
HomePath = path_in;
|
||||
}
|
||||
//Текущая оперционная система
|
||||
public static boolean isWindows() {
|
||||
return System.getProperty("os.name").startsWith("Windows");
|
||||
}
|
||||
public static String getHomePath(){
|
||||
return HomePath;
|
||||
}
|
||||
public static File getHomeDirectory(){
|
||||
return new File(getHomePath());
|
||||
};
|
||||
//ГЛОБАЛЬНЫЙ ЖУРНАЛ
|
||||
public static Loggable MainLog;
|
||||
public static Semaphore date_semaphore = new Semaphore(1);
|
||||
public static long last_ticks = CommonConstants.Nan;
|
||||
//--------------------------------------------------
|
||||
public static Object requireNonNullElse(Object value, Object default_value) {
|
||||
return (value != null) ? value : default_value;
|
||||
}
|
||||
//--
|
||||
//JSON
|
||||
//--
|
||||
@@ -55,6 +37,25 @@ public class Utils_ {
|
||||
// }
|
||||
//--
|
||||
public static Gson gson = new GsonBuilder().excludeFieldsWithoutExposeAnnotation().setPrettyPrinting().create();
|
||||
static String HomePath = System.getProperty("user.dir");
|
||||
;
|
||||
//Текущая оперционная система
|
||||
public static boolean isWindows() {
|
||||
return System.getProperty("os.name").startsWith("Windows");
|
||||
}
|
||||
public static String getHomePath() {
|
||||
return HomePath;
|
||||
}
|
||||
public static void setHomePath(String path_in) {
|
||||
HomePath = path_in;
|
||||
}
|
||||
public static File getHomeDirectory() {
|
||||
return new File(getHomePath());
|
||||
}
|
||||
//--------------------------------------------------
|
||||
public static Object requireNonNullElse(Object value, Object default_value) {
|
||||
return (value != null) ? value : default_value;
|
||||
}
|
||||
//------------------------------------------------------------------
|
||||
//-
|
||||
public static <T> T jsonFromFile(File file, Class<T> json_class) throws Exception {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package Common.Utils;
|
||||
import java.util.Vector;
|
||||
public class Vector_<T> extends Vector<T> {
|
||||
public Vector_(T... data){
|
||||
for (T object: data)
|
||||
public Vector_(T... data) {
|
||||
for (T object : data)
|
||||
this.add(object);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user