Created
May 16, 2010 04:55
-
-
Save kanemu/402664 to your computer and use it in GitHub Desktop.
[groovy]groovyスクリプト自体のパスを取得。
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
class Test { | |
URL url = this.getClass().getProtectionDomain().getCodeSource().getLocation() | |
} | |
def ts = new Test() | |
println ts.url |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment