Skip to content

Instantly share code, notes, and snippets.

@wumpz
Created August 2, 2018 06:25
Show Gist options
  • Save wumpz/29d4724271934647bd4738352d2d30a4 to your computer and use it in GitHub Desktop.
Save wumpz/29d4724271934647bd4738352d2d30a4 to your computer and use it in GitHub Desktop.
relative path of two File instances in java
new File(baseDirectory).toURI().relativize(new File(subpathItem).toURI()).getPath()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment