1 package hu.user.mediacube.integration.safedelete;
3 import lombok.extern.log4j.Log4j2;
5 import java.nio.file.Files;
6 import java.nio.file.Path;
7 import java.nio.file.Paths;
10 public class FileOperations {
12 static public void silentDelete(Path path) {
15 log.info("File deleted: {}", path);
16 } catch (Exception e) {
22 static public void silentRename(Path source, String prefix) {
24 String fileName = String.format("%s%s", prefix, source.getFileName().toString());
25 Path target = Paths.get(source.getParent().toAbsolutePath().toString(), fileName);
26 Files.move(source, target);
27 log.info("File renamed to: {}", target);
28 } catch (Exception e) {