MCPcopy Index your code
hub / github.com/OpenSourcePhysics/osp / getURL

Method getURL

src/org/opensourcephysics/tools/Resource.java:126–143  ·  view source on GitHub ↗

Gets the url associated with this resource. @return the URL

()

Source from the content-addressed store, hash-verified

124 * @return the URL
125 */
126 public URL getURL() {
127 if (url == null && file != null) {
128 String path = getAbsolutePath();
129 try {
130 if (path.startsWith("/")) { //$NON-NLS-1$
131 url = new URL("file:" + path); //$NON-NLS-1$
132 } else {
133 url = new URL("file:/" + path); //$NON-NLS-1$
134 }
135 } catch (MalformedURLException ex) {
136 ex.printStackTrace();
137 }
138 }
139 if (contentURL != null) {
140 return contentURL;
141 }
142 return url;
143 }
144
145 /**
146 * Gets the file associated with this resource.

Callers 15

getAbsolutePathMethod · 0.95
getImageIconMethod · 0.95
getAudioClipMethod · 0.95
handleHyperLinkMethod · 0.95
getHTMLURLMethod · 0.95
getTargetURLMethod · 0.95
getTextURLMethod · 0.95
setURLMethod · 0.95
MovieVideoMethod · 0.95
readAsyncMethod · 0.95
runMethod · 0.95

Calls 1

getAbsolutePathMethod · 0.95

Tested by 1

runMethod · 0.76