no message

This commit is contained in:
2024-10-14 15:19:13 +03:00
parent 8eef367bd4
commit 5e09fb44ea
634 changed files with 3751 additions and 3263 deletions

View File

@@ -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 {

View File

@@ -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 {

View File

@@ -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);
}
}