Last active
November 4, 2022 14:18
-
-
Save ysb33r/5804364 to your computer and use it in GitHub Desktop.
The Groovy way to obtain a relative path given two paths.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def root= new File('/usr/share') | |
def full= new File('/usr/share/docs/rpm-4.4') | |
// Print the relative path of 'full' in relation to 'root' | |
// Notice that the full path is passed as a parameter to the root. | |
def relPath= new File( root.toURI().relativize( full.toURI() ).toString() ) |
hudson.remoting.ProxyException: groovy.lang.MissingMethodException: No signature of method: java.lang.String.toPath() is applicable
It is File::toPath, not String::toPath.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
hudson.remoting.ProxyException: groovy.lang.MissingMethodException: No signature of method: java.lang.String.toPath() is applicable