mirror of
https://github.com/tiennm99/BSK-All-in-One-Clinic-Management-System.git
synced 2026-09-08 20:19:47 +00:00
[update] Enhance CheckUpPage with ultrasound folder scanning functionality, replacing the previous watcher implementation. Introduce scheduled scanning for images in ultrasound folders, improving media handling. Update DataDialog to support delete functionality for checkup records, including confirmation prompts and response handling. Adjust launch configurations in VSCode for debugging. Update .gitignore to include new media files and binary database changes.
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
public class DebugFileWalk {
|
||||
|
||||
public static void main(String[] args) {
|
||||
// ▼▼▼ IMPORTANT ▼▼▼
|
||||
// Change this path to the EXACT folder you are trying to scan.
|
||||
// Use double backslashes "\\" for Windows paths.
|
||||
// Example: "C:\\Users\\YourName\\Pictures\\MyEvent"
|
||||
Path mediaPath = Paths.get("ANH SIEU AM");
|
||||
// ▲▲▲ IMPORTANT ▲▲▲
|
||||
|
||||
|
||||
System.out.println("--- Starting Scan ---");
|
||||
System.out.println("Scanning Path: " + mediaPath.toAbsolutePath());
|
||||
System.out.println("Does path exist? " + Files.exists(mediaPath));
|
||||
System.out.println("--------------------------------\n");
|
||||
|
||||
System.out.println(">>> ALL files and folders found by Files.walk():");
|
||||
try (Stream<Path> pathStream = Files.walk(mediaPath)) {
|
||||
pathStream.forEach(path -> {
|
||||
System.out.println(" -> Found: " + path);
|
||||
});
|
||||
} catch (IOException e) {
|
||||
System.err.println("An ERROR occurred during the scan:");
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
System.out.println("\n--------------------------------");
|
||||
System.out.println(">>> Files that match the '.jpg' filter:");
|
||||
try (Stream<Path> pathStream = Files.walk(mediaPath)) {
|
||||
pathStream
|
||||
.filter(path -> !Files.isDirectory(path))
|
||||
.filter(path -> path.toString().toLowerCase().endsWith(".jpg"))
|
||||
.forEach(path -> {
|
||||
System.out.println(" -> Matched: " + path);
|
||||
});
|
||||
} catch (IOException e) {
|
||||
System.err.println("An ERROR occurred during the filtered scan:");
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
System.out.println("\n--- Scan Finished ---");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user