Skip to content

Commit

Permalink
update resource helper javadoc
Browse files Browse the repository at this point in the history
  • Loading branch information
bischoffz committed May 17, 2024
1 parent be7b4a3 commit 4c06831
Showing 1 changed file with 21 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,13 @@ public static void createNewFile(Path directory, String fileName) {
* <p>
* calls {@link ResourceHelper#validateFilePath(Path)}
*
* @throws ContractException {@link ResourceError#FILE_PATH_IS_DIRECTORY} if the
* file path refers to a directory
* @throws ContractException
* <ul>
* <li>{@link ResourceError#FILE_PATH_IS_DIRECTORY}
* if the file path refers to a directory</li>
* <li>{@link ResourceError#UNKNOWN_FILE} if the
* file does not exist</li>
* </ul>
*/
public static Path validateFile(String file) {
Path filePath = Path.of(file);
Expand All @@ -155,8 +160,13 @@ public static Path validateFile(String file) {
/**
* Given a file path, validates that the file exists.
*
* @throws ContractException {@link ResourceError#FILE_PATH_IS_DIRECTORY} if the
* file path refers to a directory
* @throws ContractException
* <ul>
* <li>{@link ResourceError#FILE_PATH_IS_DIRECTORY}
* if the file path refers to a directory</li>
* <li>{@link ResourceError#UNKNOWN_FILE} if the
* file does not exist</li>
* </ul>
*/
public static Path validateFile(Path filePath) {
File file = filePath.toFile();
Expand All @@ -173,7 +183,7 @@ public static Path validateFile(Path filePath) {
}

/**
* Given a file path, validates that the file exists.
* Given a file path, validates that the file path exists.
* <p>
* calls {@link ResourceHelper#validateFilePath(Path)}
*
Expand All @@ -189,7 +199,7 @@ public static Path validateFilePath(String file) {
}

/**
* Given a file path, validates that the file exists.
* Given a file path, validates that the file path exists.
*
* @throws ContractException {@link ResourceError#FILE_PATH_IS_DIRECTORY} if the
* file path refers to a directory
Expand All @@ -209,7 +219,7 @@ public static Path validateFilePath(Path filePath) {
}

/**
* Given a directory path, validates that the directory exists.
* Given a directory path, validates that the directory path exists.
* <p>
* calls {@link ResourceHelper#validateDirectoryPath(Path)}
*
Expand All @@ -225,7 +235,9 @@ public static Path validateDirectoryPath(String directory) {
}

/**
* Given a directory path, validates that the directory exists.
* Given a directory path, validates that the directory path exists.
* <p>
* If it does not exists, attempts to create it
*
* @throws ContractException {@link ResourceError#DIRECTORY_PATH_IS_FILE} if the
* directory path refers to a file
Expand Down Expand Up @@ -256,9 +268,7 @@ protected static URI getURI(URL url) {
}

/**
* Given a file, attempts to create the file
*
* package access for testing
* Given a file, attempts to create the file package access for testing
*/
static void _createFile(File file) {
try {
Expand Down

0 comments on commit 4c06831

Please sign in to comment.