Permalink
Browse files

Refactor getResourceURL

  • Loading branch information...
1 parent 5c52aec commit 4bbdab00d4a6aa2b1ff0e21bc355a74b5feaf803 @mikera committed Oct 23, 2012
View
2 src/main/java/mikera/image/ImageUtils.java
@@ -30,7 +30,7 @@
*/
public static BufferedImage getImage(String filename) {
- URL imageURL = Resource.getResource(filename);
+ URL imageURL = Resource.getResourceURL(filename);
if (imageURL != null) {
return getImage(imageURL);
}
View
2 src/main/java/mikera/sound/SoundEngine.java
@@ -51,7 +51,7 @@ public static Sample loadSample(String url) {
private static Clip loadClip(String url) {
try {
- URL soundURL = Resource.getResource(url);
+ URL soundURL = Resource.getResourceURL(url);
if (soundURL==null) throw new Error("File not found: "+url);
AudioInputStream stream = AudioSystem.getAudioInputStream(soundURL);
View
2 src/main/java/mikera/util/Resource.java
@@ -13,7 +13,7 @@
*
*/
public class Resource {
- public static URL getResource(String filename) {
+ public static URL getResourceURL(String filename) {
return Thread.currentThread().getContextClassLoader().getResource(filename);
}

0 comments on commit 4bbdab0

Please sign in to comment.