Interlok 4121 fs helper improvements #1194
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Interlok https://adaptris.atlassian.net/browse/INTERLOK-4121
Motivation
Making sure the util class that handles file io can handle all the required path formats we will throw at it.
Modification
Adding new logic to createUrlFromString method to also handle absolute paths including a Windows drive letter where no "file" scheme has been defined.
Removing deprecated code and old commented out code.
Updating javadoc comments.
PR Checklist
Result
Any classes that call the FsHelper class when creating a url from a string should now support different file path formats such as:
./dir
../dir
dir
/dir
file:///dir
file:///./dir
file:///c:/dir
c:/dir
c:\dir
and so on..
Testing
Load up a copy of v5 with the latest interlok-core.jar and setup a simple workflow with an FSProducer, or FsConsumer(or a variation of one of these i.e. LargeFsProducer) and test the different combiantion of file paths and have create directories set to true. Then make sure it creates the directories you test and they are created in the expected location.