Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 20 for toUrl (0.12 sec)

  1. src/test/java/org/codelibs/core/jar/JarFileUtilTest.java

        /**
         * @throws Exception
         */
        public void testToJarFilePath() throws Exception {
            final File f = new File("/Program Files/foo.jar");
            final URL url = new URL("jar:" + f.toURI().toURL() + "!/");
            final String root = new File("/").getCanonicalPath();
            assertEquals(root + "Program Files" + File.separator + "foo.jar", JarFileUtil.toJarFilePath(url));
        }
    
        /**
         * @throws Exception
    Java
    - Registered: Fri May 03 20:58:11 GMT 2024
    - Last Modified: Thu Mar 07 01:59:08 GMT 2024
    - 1.5K bytes
    - Viewed (0)
  2. src/test/java/org/codelibs/core/io/ResourceTraversalTest.java

            final URL classURL = ResourceUtil.getResource(classFilePath);
            final URL jarURL = new File(JarFileUtil.toJarFilePath(classURL)).toURI().toURL();
            ResourceTraversalUtil.forEach(new ZipInputStream(jarURL.openStream()), (ResourceHandler) (path, is) -> {
                try {
                    if (count < 10) {
                        System.out.println(path);
    Java
    - Registered: Fri May 03 20:58:11 GMT 2024
    - Last Modified: Thu Mar 07 01:59:08 GMT 2024
    - 6K bytes
    - Viewed (0)
  3. src/test/java/org/codelibs/core/io/ResourceUtilTest.java

            final URL url = new File("/Program File").toURI().toURL();
            assertEquals("file:" + getRoot() + "Program File", ResourceUtil.toExternalForm(url));
        }
    
        /**
         * @throws Exception
         */
        public void testGetFileName() throws Exception {
            URL url = new File("/Program File").toURI().toURL();
            assertEquals(getRoot() + "Program File", ResourceUtil.getFileName(url));
    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)
  4. maven-core/src/test/java/org/apache/maven/internal/transformation/AbstractRepositoryTestCase.java

            return new RemoteRepository.Builder(
                            "repo",
                            "default",
                            getTestFile("target/test-classes/repo").toURI().toURL().toString())
                    .build();
        }
    Java
    - Registered: Sun Apr 28 03:35:10 GMT 2024
    - Last Modified: Tue Apr 23 12:55:57 GMT 2024
    - 3.4K bytes
    - Viewed (0)
  5. src/main/java/org/codelibs/core/io/FileUtil.java

         *
         * @param file
         *            ファイル。{@literal null}であってはいけません
         * @return ファイルURLを表すURLオブジェクト
         */
        public static URL toURL(final File file) {
            assertArgumentNotNull("file", file);
    
            try {
                return file.toURI().toURL();
            } catch (final IOException e) {
                throw new IORuntimeException(e);
            }
        }
    
        /**
         * ファイルの内容をバイト配列に読み込んで返します。
    Java
    - Registered: Fri May 03 20:58:11 GMT 2024
    - Last Modified: Thu Mar 07 01:59:08 GMT 2024
    - 9K bytes
    - Viewed (0)
  6. maven-builder-support/src/test/java/org/apache/maven/building/UrlSourceTest.java

            assertEquals("url cannot be null", e.getMessage());
        }
    
        @Test
        void testGetInputStream() throws Exception {
            URL txtFile = new File("target/test-classes/source.txt").toURI().toURL();
            UrlSource source = new UrlSource(txtFile);
            try (InputStream is = source.getInputStream();
                    Scanner scanner = new Scanner(is)) {
                assertEquals("Hello World!", scanner.nextLine());
    Java
    - Registered: Sun May 05 03:35:11 GMT 2024
    - Last Modified: Sat Apr 15 17:24:20 GMT 2023
    - 2K bytes
    - Viewed (0)
  7. src/test/java/org/codelibs/core/io/ClassTraversalTest.java

            final URL classURL = ResourceUtil.getResource(classFilePath);
            final URL jarURL = new File(JarFileUtil.toJarFilePath(classURL)).toURI().toURL();
            ClassTraversalUtil.forEach(new ZipInputStream(jarURL.openStream()), (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)
  8. maven-compat/src/main/java/org/apache/maven/usability/plugin/ExpressionDocumenter.java

                myClasspathEntry = myClasspathEntry.substring("file:".length());
            }
    
            URL docResource;
            try {
                docResource = new File(myClasspathEntry).toURL();
            } catch (MalformedURLException e) {
                throw new ExpressionDocumentationException(
                        "Cannot construct expression documentation classpath" + " resource base.", e);
            }
    
    Java
    - Registered: Sun May 05 03:35:11 GMT 2024
    - Last Modified: Wed Sep 06 11:28:54 GMT 2023
    - 5.2K bytes
    - Viewed (0)
  9. android/guava-tests/test/com/google/common/io/ResourcesTest.java

        assertThrows(IllegalArgumentException.class, () -> Resources.getResource(tempFile.getName()));
    
        // Now set the context loader to one that should find the resource.
        URL baseUrl = tempFile.getParentFile().toURI().toURL();
        URLClassLoader loader = new URLClassLoader(new URL[] {baseUrl});
        ClassLoader oldContextLoader = Thread.currentThread().getContextClassLoader();
        try {
          Thread.currentThread().setContextClassLoader(loader);
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 6.8K bytes
    - Viewed (0)
  10. android/guava-tests/test/com/google/common/io/SourceSinkFactories.java

        @Override
        public ByteSource createSource(byte[] bytes) throws IOException {
          super.createSource(bytes);
          return Resources.asByteSource(getFile().toURI().toURL());
        }
      }
    
      private static class UrlCharSourceFactory extends FileCharSourceFactory {
    
        @SuppressWarnings("CheckReturnValue") // only using super.createSource to create a file
        @Override
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Thu Apr 06 12:56:11 GMT 2023
    - 12.7K bytes
    - Viewed (0)
Back to top