Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interlok 4121 fs helper improvements #1194

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

jameswickham
Copy link
Contributor

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

  • been self-reviewed.
  • Added javadocs for most classes and all non-trivial methods
  • [n/a] Added supporting annotations (like @XStreamAlias / @ComponentProfile)
  • [n/a] Added DefaultValue annotation when there is a default value (e.g. @DefaultValue('true'))
  • Added validation annotation (@NotNull...) when required and add @Valid when nested class has some validation
  • [n/a] Checked that @NotNull and @notblank annotations have a meaningful message when appropriate.
  • [n/a] Checked that new 3rd party dependencies are appropriately licensed
  • Added comments explaining the "why" and the intent of the code wherever it would not be obvious for an unfamiliar reader
  • Added unit tests or modified existing tests to cover new code paths
  • Tested new/updated components in the UI and at runtime in an Interlok instance
  • [n/a] Reviewed java class members so that missing annotations are added (InputFieldDefault/ComponentProfile etc)
  • Checked that javadoc generation doesn't report errors
  • Checked the display of the component in the UI
  • [n/a] Remove any config/license annotations
  • [n/a] Check the gradle build file to make sure the dependencies section is more explicit "implementation/api".

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.

… as the URI sceme and will append the file scheme to the start accordingly.
removing deprecated method as it's been that way since 3.0.3
removing old commented out code.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant