We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 906e644 commit 5a3f011Copy full SHA for 5a3f011
1 file changed
src/main/java/org/scijava/Locatable.java
@@ -31,6 +31,10 @@
31
32
package org.scijava;
33
34
+import java.net.URL;
35
+
36
+import org.scijava.util.ClassUtils;
37
38
/**
39
* An object whose location is defined by a URL string.
40
*
@@ -39,6 +43,9 @@
43
public interface Locatable {
44
41
45
/** Gets the URL string defining the object's location. */
42
- String getLocation();
46
+ default String getLocation() {
47
+ final URL location = ClassUtils.getLocation(getClass());
48
+ return location == null ? null : location.toExternalForm();
49
+ }
50
51
}
0 commit comments