Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 11 for openConnections (0.07 sec)

  1. src/test/java/jcifs/smb1/smb1/HandlerTest.java

        }
    
        @Test
        @DisplayName("openConnection creates SmbFile for valid URL")
        void testOpenConnectionWithValidUrl() throws IOException {
            // Arrange - Create URL with handler
            URL url = new URL(null, "smb://host/share", handler);
    
            // Act
            URLConnection conn = handler.openConnection(url);
    
            // Assert
            assertNotNull(conn);
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 07:14:38 UTC 2025
    - 5.4K bytes
    - Viewed (0)
  2. src/test/java/jcifs/http/HandlerTest.java

                @Override
                protected URLConnection openConnection(URL u) throws IOException {
                    return mock(HttpURLConnection.class);
                }
            };
    
            // Create mock HTTPS handler
            URLStreamHandler httpsHandler = new URLStreamHandler() {
                @Override
                protected URLConnection openConnection(URL u) throws IOException {
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 11.1K bytes
    - Viewed (0)
  3. src/test/java/jcifs/smb/HandlerTest.java

        }
    
        @Test
        @DisplayName("openConnection with null URL throws NullPointerException")
        void testOpenConnection_NullInput() {
            // Arrange
            Handler handler = newHandlerWith(mockCtx);
    
            // Act & Assert
            assertThrows(NullPointerException.class, () -> handler.openConnection(null), "Null URL should throw NPE");
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 7.8K bytes
    - Viewed (0)
  4. src/main/java/jcifs/smb1/http/Handler.java

            return DEFAULT_HTTP_PORT;
        }
    
        @Override
        protected URLConnection openConnection(URL url) throws IOException {
            url = new URL(url, url.toExternalForm(), getDefaultStreamHandler(url.getProtocol()));
            return new NtlmHttpURLConnection((HttpURLConnection) url.openConnection());
        }
    
        private static URLStreamHandler getDefaultStreamHandler(final String protocol) throws IOException {
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 16 01:32:48 UTC 2025
    - 6.1K bytes
    - Viewed (0)
  5. src/main/java/jcifs/http/Handler.java

            return DEFAULT_HTTP_PORT;
        }
    
        @Override
        protected URLConnection openConnection(URL url) throws IOException {
            url = new URL(url, url.toExternalForm(), getDefaultStreamHandler(url.getProtocol()));
            return new NtlmHttpURLConnection((HttpURLConnection) url.openConnection(), this.transportContext);
        }
    
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 16 01:32:48 UTC 2025
    - 6.9K bytes
    - Viewed (0)
  6. src/main/java/jcifs/smb1/smb1/Handler.java

         */
        public Handler() {
        }
    
        @Override
        protected int getDefaultPort() {
            return SmbConstants.DEFAULT_PORT;
        }
    
        @Override
        public URLConnection openConnection(final URL u) throws IOException {
            return new SmbFile(u);
        }
    
        @Override
        protected void parseURL(final URL u, String spec, final int start, int limit) {
            final String host = u.getHost();
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 16 01:32:48 UTC 2025
    - 2.2K bytes
    - Viewed (0)
  7. src/main/java/jcifs/smb/Handler.java

            this.transportContext = tc;
        }
    
        @Override
        protected int getDefaultPort() {
            return SmbConstants.DEFAULT_PORT;
        }
    
        @Override
        public URLConnection openConnection(final URL u) throws IOException {
            if (log.isDebugEnabled()) {
                log.debug("Opening file " + u);
            }
            return new SmbFile(u, getTransportContext());
        }
    
        /**
         * @return
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 16 01:32:48 UTC 2025
    - 3K bytes
    - Viewed (0)
  8. src/test/java/jcifs/http/NtlmHttpURLConnectionTest.java

            } else if (stream != null) {
                when(conn.getInputStream()).thenReturn(stream);
            }
        }
    
        /**
         * Test helper class for mocking URL.openConnection() behavior
         */
        static class TestURLStreamHandler extends java.net.URLStreamHandler {
            private final List<HttpURLConnection> connections = new ArrayList<>();
            private int currentIndex = 0;
    
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 07:14:38 UTC 2025
    - 12.6K bytes
    - Viewed (0)
  9. src/main/java/jcifs/smb1/http/NtlmHttpURLConnection.java

            }
            return message;
        }
    
        private void reconnect() throws IOException {
            connection = (HttpURLConnection) connection.getURL().openConnection();
            connection.setRequestMethod(method);
            headerFields = null;
            final Iterator properties = requestProperties.entrySet().iterator();
            while (properties.hasNext()) {
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 16 01:32:48 UTC 2025
    - 22.1K bytes
    - Viewed (0)
  10. src/test/java/jcifs/smb/SmbResourceLocatorImplTest.java

        // Minimal URLStreamHandler to allow creating smb:// URLs in tests
        private static final URLStreamHandler SMB_HANDLER = new URLStreamHandler() {
            @Override
            protected URLConnection openConnection(URL u) {
                return null; // not used
            }
        };
    
        @BeforeEach
        void setup() {
            when(ctx.getConfig()).thenReturn(config);
            when(ctx.getCredentials()).thenReturn(creds);
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 17.6K bytes
    - Viewed (0)
Back to top