Class MoveFile
java.lang.Object
io.github.raghultech.openloom.fs.MoveFile
================================================================
📄 MoveFile - File Move Utility
================================================================
Overview: Provides a safe and efficient method to move a single file from a source path to a target path. Supports optional replacement of existing files and uses atomic moves where possible.
Important: This class is protected and intended for internal usage.
Users should access file move operations through FileManager:
OpenLoom loom = new OpenLoom();
loom.file().moveFile(Paths.get("C:/source.txt"), Paths.get("C:/target.txt"), true);
Key features:
- ✅ Moves files safely using atomic operations
- âš¡ Supports optional overwriting of existing files
- 🧠Resolves final target paths to avoid conflicts
- 🔄 Wraps I/O errors in detailed OpenLoomFileException
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidmoveInternal(Path source, Path target, boolean replaceExisting) Moves a file from source to target.
-
Constructor Details
-
MoveFile
public MoveFile()
-
-
Method Details
-
moveInternal
Moves a file from source to target.If
replaceExistingis true, an existing target file will be replaced. Uses atomic moves where supported by the file system.- Parameters:
source- the source file to movetarget- the target locationreplaceExisting- whether to overwrite the target file if it exists- Throws:
OpenLoomFileException- if validation fails or an I/O error occurs
-