- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 14 for GetResource (0.19 sec)
-
src/test/java/org/codelibs/core/io/ResourceTraversalTest.java
*/ @Test public void testForEachJarFile() throws Exception { final String classFilePath = TestCase.class.getName().replace('.', '/') + ".class"; final URL classURL = ResourceUtil.getResource(classFilePath); final JarURLConnection con = (JarURLConnection) classURL.openConnection(); ResourceTraversalUtil.forEach(con.getJarFile(), (ResourceHandler) (path, is) -> { try {
Java - Registered: Fri May 03 20:58:11 GMT 2024 - Last Modified: Thu Mar 07 01:59:08 GMT 2024 - 6K bytes - Viewed (0) -
src/test/java/org/codelibs/core/io/ResourceUtilTest.java
} /** * @throws Exception */ public void testGetResource() throws Exception { assertNotNull(ResourceUtil.getResource("java/lang/String.class", "class")); assertNotNull(ResourceUtil.getResource("org/codelibs")); try { ResourceUtil.getResource("hoge", "xml"); fail("2"); } catch (final ResourceNotFoundRuntimeException e) { System.out.println(e);
Java - Registered: Fri May 03 20:58:11 GMT 2024 - Last Modified: Thu Mar 07 01:59:08 GMT 2024 - 4.3K bytes - Viewed (0) -
src/test/java/org/codelibs/core/io/ClassTraversalTest.java
*/ @Test public void testForEachJarFile() throws Exception { final String classFilePath = TestCase.class.getName().replace('.', '/') + ".class"; final URL classURL = ResourceUtil.getResource(classFilePath); final JarURLConnection con = (JarURLConnection) classURL.openConnection(); ClassTraversalUtil.forEach(con.getJarFile(), (ClassHandler) (packageName, shortClassName) -> { if (count < 10) {
Java - Registered: Fri May 03 20:58:11 GMT 2024 - Last Modified: Thu Mar 07 01:59:08 GMT 2024 - 5.1K bytes - Viewed (0) -
src/main/java/org/codelibs/core/io/ResourceUtil.java
* * @param path * リソースのパス。{@literal null}や空文字列であってはいけません * @return リソースの{@link URL} * @see #getResource(String, String) */ public static URL getResource(final String path) { assertArgumentNotEmpty("path", path); return getResource(path, null); } /** * コンテキストクラスローダからリソースを返します。 * * @param path
Java - Registered: Fri May 03 20:58:11 GMT 2024 - Last Modified: Thu Mar 07 01:59:08 GMT 2024 - 15.8K bytes - Viewed (0) -
maven-api-impl/src/main/java/org/apache/maven/internal/impl/DefaultSuperPomProvider.java
} private Model readModel(String version, String v) { String resource = "/org/apache/maven/model/pom-" + v + ".xml"; URL url = getClass().getResource(resource); if (url == null) { throw new IllegalStateException("The super POM " + resource + " was not found" + ", please verify the integrity of your Maven installation"); }
Java - Registered: Sun May 05 03:35:11 GMT 2024 - Last Modified: Fri Apr 12 10:50:18 GMT 2024 - 3K bytes - Viewed (0) -
maven-compat/src/test/java/org/apache/maven/project/AbstractMavenProjectTestCase.java
throws FileNotFoundException, URISyntaxException { ClassLoader cloader = Thread.currentThread().getContextClassLoader(); URL resourceUrl = cloader.getResource(resource); if (resourceUrl == null) { throw new FileNotFoundException("Unable to find: " + resource); } return new File(resourceUrl.toURI()); }
Java - Registered: Sun May 05 03:35:11 GMT 2024 - Last Modified: Thu Apr 25 05:46:50 GMT 2024 - 6.4K bytes - Viewed (0) -
src/main/java/org/codelibs/core/io/TraversalUtil.java
*/ public static Traverser getTraverser(final Class<?> referenceClass) { assertArgumentNotNull("referenceClass", referenceClass); final URL url = ResourceUtil.getResource(toClassFile(referenceClass.getName())); final String[] path = referenceClass.getName().split("\\."); String baseUrl = url.toExternalForm(); for (final String element : path) {
Java - Registered: Fri May 03 20:58:11 GMT 2024 - Last Modified: Thu Mar 07 01:59:08 GMT 2024 - 19.5K bytes - Viewed (0) -
src/test/java/org/codelibs/core/io/FileUtilTest.java
import java.io.File; import java.net.URL; import org.codelibs.core.net.URLUtil; import org.junit.Test; /** * @author koichik * */ public class FileUtilTest { URL url = ResourceUtil.getResource(getClass().getName().replace('.', '/') + ".txt"); File inputFile = URLUtil.toFile(url); /** * @throws Exception */ @Test public void testFileToFile() throws Exception {
Java - Registered: Fri May 03 20:58:11 GMT 2024 - Last Modified: Thu Mar 07 01:59:08 GMT 2024 - 1.6K bytes - Viewed (0) -
src/main/java/org/codelibs/core/io/FileUtil.java
public static String readText(final String path, final String encoding) { assertArgumentNotEmpty("path", path); assertArgumentNotEmpty("encoding", encoding); final URL url = ResourceUtil.getResource(path); if (url.getProtocol().equals("file")) { return readText(URLUtil.toFile(url), encoding); } final InputStream is = URLUtil.openStream(url); try {
Java - Registered: Fri May 03 20:58:11 GMT 2024 - Last Modified: Thu Mar 07 01:59:08 GMT 2024 - 9K bytes - Viewed (0) -
src/test/java/org/codelibs/core/io/PropertiesUtilTest.java
import org.junit.Test; import org.junit.rules.ExpectedException; import org.junit.rules.TemporaryFolder; /** * @author wyukawa * */ public class PropertiesUtilTest { URL url = ResourceUtil.getResource(getClass().getName().replace('.', '/') + ".txt"); File inputFile = URLUtil.toFile(url); /** * */ @Rule public TemporaryFolder tempFolder = new TemporaryFolder(); /**
Java - Registered: Fri May 03 20:58:11 GMT 2024 - Last Modified: Thu Mar 07 01:59:08 GMT 2024 - 9.6K bytes - Viewed (0)