Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 10 for GetResource (0.27 sec)

  1. 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)
  2. 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)
  3. src/main/java/org/codelibs/core/io/PropertiesUtil.java

         */
        public static void load(final Properties props, final String path) {
            assertArgumentNotNull("props", props);
            assertArgumentNotEmpty("path", path);
    
            load(props, ResourceUtil.getResource(path));
        }
    
        /**
         * {@link Properties#store(OutputStream, String)}の例外処理をラップします。
         *
         * <p>
         * 出力ストリームはクローズされません。
         * </p>
         *
         * @param props
    Java
    - Registered: Fri May 03 20:58:11 GMT 2024
    - Last Modified: Thu Mar 07 01:59:08 GMT 2024
    - 8.9K bytes
    - Viewed (0)
  4. 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)
  5. 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)
  6. 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)
  7. 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)
  8. 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)
  9. src/test/java/org/codelibs/core/io/CopyUtilTest.java

        Reader reader = new StringReader(srcString);
    
        StringWriter writer = new StringWriter();
    
        StringBuilder builder = new StringBuilder();
    
        URL url = ResourceUtil.getResource(getClass().getName().replace('.', '/') + ".txt");
    
        File inputFile = URLUtil.toFile(url);
    
        File outputFile = new File(inputFile.getParentFile(), ".out");
    
        /**
         * @throws Exception
         */
    Java
    - Registered: Fri May 03 20:58:11 GMT 2024
    - Last Modified: Thu Mar 07 01:59:08 GMT 2024
    - 4.6K bytes
    - Viewed (0)
  10. 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)
Back to top