Add base files

This commit is contained in:
Hosein
2026-06-12 12:18:48 +03:30
commit 240eac0504
17 changed files with 530 additions and 0 deletions
@@ -0,0 +1,25 @@
package com.university.chat.Server;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
public class FileManager {
private static final String BASE_DIR = "server_data";
public static void createUserFolders(String username) throws IOException {
Path userPath = Paths.get(BASE_DIR, username);
Files.createDirectories(userPath.resolve("received"));
Files.createDirectories(userPath.resolve("sent"));
}
public static Path getReceivedPath(String username, String filename) {
return Paths.get(BASE_DIR, username, "received", filename);
}
public static Path getSentPath(String username, String filename) {
return Paths.get(BASE_DIR, username, "sent", filename);
}
}