Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 13 for getResourceAsStream (0.31 sec)

  1. src/test/java/org/codelibs/core/xml/SAXParserFactoryUtilTest.java

            spf.setNamespaceAware(true);
            final SAXParser parser = SAXParserFactoryUtil.newSAXParser(spf);
    
            final InputSource is = new InputSource(ResourceUtil.getResourceAsStream("org/codelibs/core/xml/include.xml"));
            is.setSystemId("include.xml");
            parser.parse(is, new DefaultHandler() {
    
                @Override
    Java
    - Registered: Fri May 03 20:58:11 GMT 2024
    - Last Modified: Thu Mar 07 01:59:08 GMT 2024
    - 2.4K bytes
    - Viewed (0)
  2. src/main/java/org/codelibs/core/io/ResourceUtil.java

         *
         * @param path
         *            リソースのパス。{@literal null}や空文字列であってはいけません
         * @return ストリーム
         * @see #getResourceAsStream(String, String)
         */
        public static InputStream getResourceAsStream(final String path) {
            assertArgumentNotEmpty("path", path);
    
            return getResourceAsStream(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/test/java/org/codelibs/fess/util/GsaConfigParserTest.java

        }
    
        public void test_parse() throws IOException {
            GsaConfigParser parser = new GsaConfigParser();
            try (InputStream is = ResourceUtil.getResourceAsStream("data/gsaconfig.xml")) {
                parser.parse(new InputSource(is));
            }
            parser.getWebConfig().ifPresent(c -> {
                System.out.println(c.toString());
            }).orElse(() -> fail());
    Java
    - Registered: Mon May 06 08:04:11 GMT 2024
    - Last Modified: Thu Feb 22 01:37:57 GMT 2024
    - 3K bytes
    - Viewed (0)
  4. src/test/java/org/codelibs/fess/thumbnail/impl/HtmlTagBasedGeneratorTest.java

            try (ImageInputStream input = ImageIO.createImageInputStream(classLoader.getResourceAsStream(imagePath))) {
                generator.saveImage(input, outputFile);
            }
            assertImageSize(outputFile, 100, 66);
    
            imagePath = "thumbnail/600x400.gif";
            try (ImageInputStream input = ImageIO.createImageInputStream(classLoader.getResourceAsStream(imagePath))) {
                generator.saveImage(input, outputFile);
            }
    Java
    - Registered: Mon May 06 08:04:11 GMT 2024
    - Last Modified: Thu Feb 22 01:37:57 GMT 2024
    - 4.1K bytes
    - Viewed (0)
  5. src/test/java/org/codelibs/core/io/PropertiesUtilTest.java

         * .
         */
        @Test
        public void testLoadPropertiesInputStream() {
            final InputStream inputStream = ResourceUtil.getResourceAsStream("org/codelibs/core/io/test.properties");
            final Properties properties = new Properties();
            PropertiesUtil.load(properties, inputStream);
            assertThat(properties.getProperty("hoge"), is("ほげ"));
        }
    
    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)
  6. src/test/java/org/codelibs/core/io/InputStreamUtilTest.java

     *
     */
    public class InputStreamUtilTest extends TestCase {
    
        /**
         * @throws Exception
         */
        public void testGetBytes() throws Exception {
            final InputStream is = ResourceUtil.getResourceAsStream(StringUtil.replace(getClass().getName(), ".", "/") + ".class");
            try {
                assertNotNull("1", InputStreamUtil.getBytes(is));
            } finally {
                is.close();
            }
        }
    Java
    - Registered: Fri May 03 20:58:11 GMT 2024
    - Last Modified: Thu Mar 07 01:59:08 GMT 2024
    - 1.2K bytes
    - Viewed (0)
  7. src/test/java/org/codelibs/core/net/MimeTypeUtilTest.java

            final String path = ClassUtil.getPackageName(this.getClass()).replaceAll("\\.", "/") + "/bbb.html";
            final String s = URLConnection.guessContentTypeFromStream(ResourceUtil.getResourceAsStream(path));
            assertNull(s);
            final String contentType = MimeTypeUtil.guessContentType(path);
            assertEquals("text/html", contentType);
        }
    
        /**
         * Test method for
    Java
    - Registered: Fri May 03 20:58:11 GMT 2024
    - Last Modified: Thu Mar 07 01:59:08 GMT 2024
    - 2.7K bytes
    - Viewed (0)
  8. src/test/java/org/codelibs/core/xml/DomUtilTest.java

         */
        public void testToString() throws Exception {
            final DocumentBuilder builder = DocumentBuilderFactoryUtil.newDocumentBuilder();
            final Document doc = DocumentBuilderUtil.parse(builder, ResourceUtil.getResourceAsStream("org/codelibs/core/xml/test1.xml"));
            final Element root = doc.getDocumentElement();
            final String contents = DomUtil.toString(root);
            System.out.println(contents);
        }
    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)
  9. src/test/java/org/codelibs/fess/helper/PluginHelperTest.java

                            return new String(InputStreamUtil.getBytes(is), Constants.UTF_8);
                        } catch (IOException e) {
                            throw new IORuntimeException(e);
                        }
                    } else if (url.contains("plugin/repo2")) {
                        try (InputStream is = ResourceUtil.getResourceAsStream(url)) {
    Java
    - Registered: Mon May 06 08:04:11 GMT 2024
    - Last Modified: Thu Feb 22 01:37:57 GMT 2024
    - 4.9K bytes
    - Viewed (0)
  10. src/main/java/org/codelibs/core/net/MimeTypeUtil.java

         * @return コンテントタイプ
         */
        public static String guessContentType(final String path) {
            assertArgumentNotEmpty("path", path);
    
            final InputStream is = ResourceUtil.getResourceAsStream(path);
            try {
                final String mimetype = URLConnection.guessContentTypeFromStream(is);
                if (mimetype != null) {
                    return mimetype;
                }
    Java
    - Registered: Fri May 03 20:58:11 GMT 2024
    - Last Modified: Thu Mar 07 01:59:08 GMT 2024
    - 1.8K bytes
    - Viewed (0)
Back to top