public class OFS extends Object
| Modifier and Type | Method and Description |
|---|---|
static OFS |
create(Path baseDirectoryPath)
Creates and populates the file system.
|
static OFS |
create(Path baseDirectoryPath,
String subDirectorySeed)
Creates and populates the file system.
|
void |
createRootDirectories()
Creates the root directories of the OFS.
|
Path |
getHashedPath(String fileSeed)
Gets a deterministic hashed file path in the OFS directory.
|
Path |
getRootPath()
Gets the root path initialized with this OFS instance.
|
Path |
getUnusedHashedPath()
Finds a random, unused hashed file path in the OFS directory.
|
void |
wipeDirectory()
Deletes the OFS directory and all underlying data associated with the initialized settings.
|
public static OFS create(Path baseDirectoryPath) throws IOException, NoSuchAlgorithmException
baseDirectoryPath - the root directory pathIOException - thrown if an error occurs accessing the file systemNoSuchAlgorithmException - thrown if a hash was unable to be generatedpublic static OFS create(Path baseDirectoryPath, String subDirectorySeed) throws IOException, NoSuchAlgorithmException
baseDirectoryPath - the root directory pathsubDirectorySeed - seed for obfuscating the base directoryIOException - thrown if an error occurs accessing the file systemNoSuchAlgorithmException - thrown if a hash was unable to be generatedpublic void createRootDirectories()
throws IOException
IOException - thrown if an error occurs accessing the file systempublic Path getHashedPath(String fileSeed) throws NoSuchAlgorithmException
fileSeed - the static seed to locate the fileNoSuchAlgorithmException - thrown if a hash was unable to be generatedpublic Path getRootPath()
public Path getUnusedHashedPath() throws IOException, NoSuchAlgorithmException
IOException - thrown if an error occurs accessing the file systemNoSuchAlgorithmException - thrown if a hash was unable to be generatedpublic void wipeDirectory()
throws IOException
WARNING: This operation cannot be undone. Makes sure you really want to delete all files and directories associated with the OFS.
IOException - thrown if an error occurs while deleting the directoryCopyright © 2021. All rights reserved.