To use the file-quarantine library, you need to include it as a dependency in your project.
<dependency> <groupId>io.github.pwssorg</groupId> <artifactId>file-quarantine</artifactId> <version>1.0.9</version> </dependency>
Here's a basic example to get you started with using the file-quarantine library for quarantining and unquarantining files:
package org.pwss; import org.pwss.quarantineManager_aes.FileQuarantineManager; import org.pwss.quarantineManager_aes.dto.MetaDataResult; import java.nio.file.Path; public class Main { public static void main(String[] args) throws Exception { final Path path = Path.of("C:\\your\\path\\your_file.txt"); FileQuarantineManager fileQuarantineManager = new FileQuarantineManager(); MetaDataResult metaDataResult = fileQuarantineManager.quarantine(path); System.out.println(metaDataResult.keyName()); fileQuarantineManager.unquarantine(metaDataResult.keyName().split(".enc")[0]); } }
For detailed information about our classes, methods, and their usage, please visit the Javadoc:
The Javadocs provide comprehensive documentation for all public APIs in this project, including:
- Class descriptions
- Method details with parameters and return types
- Example usages when available
Please visit our discussion forum for project-related documentation and discussions: Project Discussion Forum
