Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 20 for hasCapability (0.07 sec)

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

        }
    
        // Happy path: hasCapability returns based on provided capability codes
        @ParameterizedTest
        @DisplayName("hasCapability returns expected values for various caps")
        @ValueSource(ints = { -1, 0, 1, 1024 })
        void hasCapability_variousCaps(int cap) throws SmbException {
            when(transport.hasCapability(anyInt())).thenAnswer(inv -> ((int) inv.getArgument(0)) >= 0);
    
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 07:14:38 UTC 2025
    - 12.1K bytes
    - Viewed (0)
  2. src/test/java/jcifs/smb/SmbTreeHandleImplTest.java

        }
    
        @Test
        @DisplayName("hasCapability delegates and propagates exceptions")
        void hasCapabilityDelegates() throws Exception {
            // Happy path delegates; invalid case propagates SmbException
            when(treeConnection.hasCapability(123)).thenReturn(true);
            assertTrue(handle.hasCapability(123));
            verify(treeConnection).hasCapability(123);
    
            // Exception path
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 14.4K bytes
    - Viewed (0)
  3. src/test/java/jcifs/smb/SmbWatchHandleImplTest.java

            when(handle.getTree()).thenReturn(tree);
            when(tree.isSMB2()).thenReturn(false);
            when(tree.getConfig()).thenReturn(mock(Configuration.class));
            when(tree.hasCapability(SmbConstants.CAP_NT_SMBS)).thenReturn(true);
            when(handle.getFid()).thenReturn(fid);
            when(tree.send(any(CommonServerMessageBlockRequest.class), any(), any(), any())).thenReturn(resp);
        }
    
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 11.5K bytes
    - Viewed (0)
  4. src/main/java/jcifs/smb/SmbTreeHandleImpl.java

        public void ensureDFSResolved() throws CIFSException {
            this.treeConnection.ensureDFSResolved(this.resourceLoc);
        }
    
        @Override
        public boolean hasCapability(final int cap) throws SmbException {
            return this.treeConnection.hasCapability(cap);
        }
    
        /**
         * {@inheritDoc}
         *
         * @see jcifs.SmbTreeHandle#isConnected()
         */
        @Override
        public boolean isConnected() {
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sun Aug 31 08:00:57 UTC 2025
    - 11.1K bytes
    - Viewed (0)
  5. src/main/java/jcifs/smb/SmbRandomAccessFile.java

                }
    
                try (SmbFileHandle h = ensureOpen()) {}
                this.readSize = th.getReceiveBufferSize() - 70;
                this.writeSize = th.getSendBufferSize() - 70;
    
                if (th.hasCapability(SmbConstants.CAP_LARGE_READX)) {
                    this.largeReadX = true;
                    this.readSize =
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 16 01:32:48 UTC 2025
    - 18.8K bytes
    - Viewed (0)
  6. src/main/java/jcifs/smb/SmbTreeConnection.java

         * @throws SmbException
         */
        public boolean hasCapability(final int cap) throws SmbException {
            try (SmbSessionImpl s = getSession()) {
                if (s != null) {
                    try (SmbTransportImpl transport = s.getTransport()) {
                        return transport.hasCapability(cap);
                    }
                }
                throw new SmbException("Not connected");
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 30 05:58:03 UTC 2025
    - 30.4K bytes
    - Viewed (0)
  7. src/main/java/jcifs/smb/SmbCopyUtil.java

                        req.setFileInformation(new FileBasicInfo(ctime, atime, mtime, 0L, attrs));
                        dh.send(req);
                    } else if (dh.hasCapability(SmbConstants.CAP_NT_SMBS)) {
                        // use the open file descriptor
                        dh.send(new Trans2SetFileInformation(dh.getConfig(), dfd.getFid(), attrs, ctime, mtime, atime),
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 16 01:32:48 UTC 2025
    - 16.6K bytes
    - Viewed (0)
  8. src/main/java/jcifs/smb/SmbFileOutputStream.java

            this.writeSize = sendBufferSize - 70;
    
            this.useNTSmbs = th.hasCapability(SmbConstants.CAP_NT_SMBS);
            if (!this.useNTSmbs) {
                log.debug("No support for NT SMBs");
            }
    
            // there seems to be a bug with some servers that causes corruption if using signatures +
            // CAP_LARGE_WRITE
            if (th.hasCapability(SmbConstants.CAP_LARGE_WRITEX) && !th.areSignaturesActive()) {
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 16 01:32:48 UTC 2025
    - 12.8K bytes
    - Viewed (0)
  9. src/test/java/jcifs/smb/SmbPipeHandleInternalTest.java

            when(pipe.ensureTreeConnected()).thenReturn(tree);
            when(tree.acquire()).thenReturn(tree);
    
            // Setup for ensureOpen
            when(tree.isSMB2()).thenReturn(false);
            when(tree.hasCapability(SmbConstants.CAP_NT_SMBS)).thenReturn(true);
            when(pipe.openUnshared(anyInt(), anyInt(), anyInt(), anyInt(), anyInt())).thenReturn(fh);
            when(fh.acquire()).thenReturn(fh);
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 07:14:38 UTC 2025
    - 16.7K bytes
    - Viewed (0)
  10. src/test/java/jcifs/smb/SmbTreeConnectionTest.java

            setTree(c2, other);
            assertFalse(c1.isSame(c2));
        }
    
        @Test
        @DisplayName("hasCapability throws when not connected")
        void hasCapability_notConnected_throws() {
            SmbTreeConnection c = newConn();
            SmbException ex = assertThrows(SmbException.class, () -> c.hasCapability(1));
            assertTrue(ex.getMessage().contains("Not connected"));
        }
    
        @Test
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 07:14:38 UTC 2025
    - 13K bytes
    - Viewed (0)
Back to top