Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 91 - 100 of 148 for SmbException (0.12 seconds)

  1. src/test/java/jcifs/smb/SmbTreeHandleImplTest.java

            // Happy path delegates; invalid case propagates SmbException
            when(treeConnection.hasCapability(123)).thenReturn(true);
            assertTrue(handle.hasCapability(123));
            verify(treeConnection).hasCapability(123);
    
            // Exception path
            when(treeConnection.hasCapability(999)).thenThrow(new SmbException("Not connected"));
            SmbException ex = assertThrows(SmbException.class, () -> handle.hasCapability(999));
    Created: Sun Apr 05 00:10:12 GMT 2026
    - Last Modified: Thu Aug 14 05:31:44 GMT 2025
    - 14.4K bytes
    - Click Count (0)
  2. src/test/java/jcifs/smb/SmbPipeInputStreamTest.java

            when(config.getTransactionBufferSize()).thenReturn(65535);
            when(tree.send(any(Smb2IoctlRequest.class), eq(RequestParam.NO_RETRY))).thenThrow(new SmbException("boom"));
    
            IOException ex = assertThrows(IOException.class, stream::available, "Should convert SmbException to IOException");
            assertTrue(ex.getMessage().contains("boom"));
        }
    
        @Test
        @DisplayName("ensureTreeConnected delegates to handle")
    Created: Sun Apr 05 00:10:12 GMT 2026
    - Last Modified: Thu Aug 14 05:31:44 GMT 2025
    - 9.9K bytes
    - Click Count (0)
  3. src/main/java/jcifs/smb/SmbFileOutputStream.java

         * the smb URL syntax.
         *
         * @param file
         *            An <code>SmbFile</code> specifying the file to write to
         * @throws SmbException if an SMB error occurs
         */
        public SmbFileOutputStream(final SmbFile file) throws SmbException {
            this(file, false);
        }
    
        /**
         * Creates an {@link java.io.OutputStream} for writing bytes to a file
    Created: Sun Apr 05 00:10:12 GMT 2026
    - Last Modified: Sat Aug 16 01:32:48 GMT 2025
    - 12.8K bytes
    - Click Count (0)
  4. src/test/java/jcifs/dcerpc/msrpc/LsaPolicyHandleTest.java

                rpc.retval = errorCode; // Simulate RPC error
                return null;
            }).when(mockDcerpcHandle).sendrecv(any(MsrpcLsarOpenPolicy2.class));
    
            // Act & Assert
            SmbException thrown = assertThrows(SmbException.class, () -> {
                new LsaPolicyHandle(mockDcerpcHandle, server, access);
            });
    
            // The error code gets mapped to NT_STATUS_UNSUCCESSFUL because it's not a valid NT status code
    Created: Sun Apr 05 00:10:12 GMT 2026
    - Last Modified: Thu Aug 14 05:31:44 GMT 2025
    - 8.9K bytes
    - Click Count (0)
  5. src/test/java/jcifs/smb/SmbUnsupportedOperationExceptionTest.java

                    "Default message should match the class contract");
            assertNull(ex.getCause(), "No cause expected from default constructor");
            assertTrue(ex instanceof SmbException, "Should be an SmbException");
    
            // toString should include the class name and the message
            String ts = ex.toString();
            assertTrue(ts.contains("SmbUnsupportedOperationException"), "toString should contain class name");
    Created: Sun Apr 05 00:10:12 GMT 2026
    - Last Modified: Thu Aug 14 05:31:44 GMT 2025
    - 5.2K bytes
    - Click Count (0)
  6. src/test/java/jcifs/smb/Kerb5ContextTest.java

            }
    
            @Test
            @DisplayName("dispose wraps GSSException into SmbException")
            void dispose_failure_wraps() throws Exception {
                doThrow(new GSSException(GSSException.FAILURE)).when(gssContext).dispose();
                SmbException ex = assertThrows(SmbException.class, () -> ctx.dispose());
                assertTrue(ex.getMessage().contains("Context disposal failed"));
            }
    
    Created: Sun Apr 05 00:10:12 GMT 2026
    - Last Modified: Thu Aug 14 07:14:38 GMT 2025
    - 14.2K bytes
    - Click Count (0)
  7. src/main/java/jcifs/smb/SmbPipeHandleImpl.java

        }
    
        @Override
        public synchronized SmbFileHandleImpl ensureOpen() throws CIFSException {
            if (!this.open) {
                throw new SmbException("Pipe handle already closed");
            }
    
            if (!isOpen()) {
                try (SmbTreeHandleImpl th = ensureTreeConnected()) {
    
                    if (th.isSMB2()) {
    Created: Sun Apr 05 00:10:12 GMT 2026
    - Last Modified: Sun Aug 31 08:00:57 GMT 2025
    - 10.2K bytes
    - Click Count (0)
  8. src/test/java/jcifs/smb/SmbWatchHandleImplTest.java

            when(handle.isValid()).thenReturn(false);
            SmbWatchHandleImpl sut = new SmbWatchHandleImpl(handle, 0, false);
    
            SmbException ex = assertThrows(SmbException.class, sut::watch, "Expected SmbException when handle invalid");
            assertTrue(ex.getMessage().contains("Watch was broken by tree disconnect"));
        }
    
    Created: Sun Apr 05 00:10:12 GMT 2026
    - Last Modified: Thu Aug 14 05:31:44 GMT 2025
    - 11.5K bytes
    - Click Count (0)
  9. src/main/java/jcifs/smb/SmbPipeInputStream.java

     *
     * @author mbechler
     */
    public class SmbPipeInputStream extends SmbFileInputStream {
    
        private final SmbPipeHandleImpl handle;
    
        /**
         * @param handle
         * @param th
         * @throws SmbException
         */
        SmbPipeInputStream(final SmbPipeHandleImpl handle, final SmbTreeHandleImpl th) throws CIFSException {
            super(handle.getPipe(), th, null);
            this.handle = handle;
        }
    
        /**
    Created: Sun Apr 05 00:10:12 GMT 2026
    - Last Modified: Sat Aug 16 01:32:48 GMT 2025
    - 3.8K bytes
    - Click Count (0)
  10. src/test/java/jcifs/smb/SmbFileHandleImplTest.java

        @Test
        @DisplayName("getFid/getFileId throw SmbException when invalid")
        void getters_throw_whenInvalid() {
            when(cfg.isTraceResourceUsage()).thenReturn(false);
            stubValidTree(1L, true, true);
            SmbFileHandleImpl h = new SmbFileHandleImpl(cfg, new byte[] { 0x01, 0x02 }, tree, "//x", 0, 0, 0, 0, 0L);
            // invalidate
            h.markClosed();
    
            SmbException ex1 = assertThrows(SmbException.class, h::getFid);
    Created: Sun Apr 05 00:10:12 GMT 2026
    - Last Modified: Thu Aug 14 05:31:44 GMT 2025
    - 12.3K bytes
    - Click Count (0)
Back to Top