| Modifier and Type | Field and Description |
|---|---|
| private static final Pattern | |
| private static final Logger |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public static String | Returns: Suggested name for the file without extensionSuffix and duplicate marks such as " (1)"Suggested name for the file without extensionSuffix, if it has duplicate file name with other file, it will end with something like " (1)" fileName)This is the opposite function of getNonOverWritingFileName It will recover the file name to origin if it has duplicate mark such as " (1)" change the String whose format is "xxxxxx (number)" into "xxxxxx", while return the same String when it does not match the format This is the opposite function of getNonOverWritingFileName |
| public static Path | |
| public static String | Returns: a file name such that it does not match any existing files in targetDirectoryThe directory in which file name should be unique targetDirectory, String Suggested name for the file fileName)Returns a file name such that it does not match any existing files in targetDirectory |
| public static boolean | Returns: true when the content of the newly downloaded file is same as the file with "similar" name, false when there is no "similar" file name or the content is different from that of files with "similar" nameThe directory which saves the files (.pdf, for example) directory, Path Suggest name for the newly downloaded file fileName, DialogService To display the error and success message dialogService)This function decide whether the newly downloaded file has the same content with other files It returns ture when the content is duplicate, while returns false if it is not |
| DUPLICATE_MARK_PATTERN | back to summary |
|---|---|
| private static final Pattern DUPLICATE_MARK_PATTERN | |
| LOGGER | back to summary |
|---|---|
| private static final Logger LOGGER | |
| FileNameUniqueness | back to summary |
|---|---|
| public FileNameUniqueness() | |
| eraseDuplicateMarks | back to summary |
|---|---|
| public static String eraseDuplicateMarks(String fileName) This is the opposite function of getNonOverWritingFileName It will recover the file name to origin if it has duplicate mark such as " (1)" change the String whose format is "xxxxxx (number)" into "xxxxxx", while return the same String when it does not match the format This is the opposite function of getNonOverWritingFileName | |
| eraseDuplicateMarks | back to summary |
|---|---|
| public static Path eraseDuplicateMarks(Path filePath) | |
| getNonOverWritingFileName | back to summary |
|---|---|
| public static String getNonOverWritingFileName(Path targetDirectory, String fileName) Returns a file name such that it does not match any existing files in targetDirectory | |
| isDuplicatedFile | back to summary |
|---|---|
| public static boolean isDuplicatedFile(Path directory, Path fileName, DialogService dialogService) throws IOException This function decide whether the newly downloaded file has the same content with other files It returns ture when the content is duplicate, while returns false if it is not
| |