коммит последних действий

This commit is contained in:
SashegDev
2026-05-06 15:49:14 +00:00
parent 04620d76c4
commit 523f659269
6 changed files with 73 additions and 1 deletions
+4 -1
View File
@@ -18,4 +18,7 @@ Thumbs.db
# Build outputs # Build outputs
server/builds/ server/builds/
server/logs/ server/logs/
# Colab
colab/
Binary file not shown.
+22
View File
@@ -0,0 +1,22 @@
public class Test {
public static void main(String[] args) {
String line = "{\"version\":\"1.0.8\",\"updated_at\":\"2026-05-06T04:38:07\"}";
System.out.println("Line: " + line);
int start = line.indexOf("\"version\":\"");
System.out.println("start (version): " + start);
if (start >= 0) {
start += 10;
System.out.println("start + 10: " + start);
int end = line.indexOf("\"", start + 1);
System.out.println("end: " + end);
if (end > start) {
String result = line.substring(start, end);
System.out.println("Result: [" + result + "]");
}
}
}
}
Binary file not shown.
+31
View File
@@ -0,0 +1,31 @@
public class Test2 {
public static void main(String[] args) {
String[] tests = {
"{\"version\":\"1.0.8\",\"updated_at\":\"2026-05-06T04:38:07\"}",
"{\"version\":\"1.0.2\"}",
"invalid json"
};
for (String line : tests) {
String result = getVersion(line);
System.out.println("Input: " + line);
System.out.println("Output: [" + result + "]");
System.out.println("Length: " + result.length());
System.out.println();
}
}
static String getVersion(String line) {
if (line != null && line.contains("version")) {
int start = line.indexOf("\"version\":\"");
if (start >= 0) {
start += 10;
int end = line.indexOf("\"", start + 1);
if (end > start) {
return line.substring(start, end);
}
}
}
return "unknown";
}
}
+16
View File
@@ -0,0 +1,16 @@
# Maven
*/target/
target/
# Build outputs
server/builds/
server/logs/
# IDE
.idea/
*.iml
.vscode/
# OS
.DS_Store
Thumbs.db