com.github.mathiewz.slick.util.ClasspathLocation Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of modernized-slick Show documentation
Show all versions of modernized-slick Show documentation
The main purpose of this libraryis to modernize and maintain the slick2D library.
The newest version!
package com.github.mathiewz.slick.util;
import java.io.InputStream;
import java.net.URL;
/**
* A resource location that searches the classpath
*
* @author kevin
*/
public class ClasspathLocation implements ResourceLocation {
/**
* @see com.github.mathiewz.slick.util.ResourceLocation#getResource(java.lang.String)
*/
@Override
public URL getResource(String ref) {
String cpRef = ref.replace('\\', '/');
return ResourceLoader.class.getClassLoader().getResource(cpRef);
}
/**
* @see com.github.mathiewz.slick.util.ResourceLocation#getResourceAsStream(java.lang.String)
*/
@Override
public InputStream getResourceAsStream(String ref) {
String cpRef = ref.replace('\\', '/');
return ResourceLoader.class.getClassLoader().getResourceAsStream(cpRef);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy