Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 10 for getTreeType (0.26 sec)

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

        }
    
        // Test case for getTreeType method
        @Test
        void testGetTreeType() {
            SmbTreeImpl tree1 = new SmbTreeImpl(session, "SHARE", "A:");
            assertEquals(SmbConstants.TYPE_SHARE, tree1.getTreeType());
    
            SmbTreeImpl tree2 = new SmbTreeImpl(session, "LPT1", "LPT1:");
            assertEquals(SmbConstants.TYPE_PRINTER, tree2.getTreeType());
    
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 7.8K bytes
    - Viewed (0)
  2. src/test/java/jcifs/SmbTreeHandleTest.java

        }
    
        /**
         * Test for getTreeType() method.
         * Verifies that the method returns the correct tree type.
         */
        @Test
        void testGetTreeType() {
            when(smbTreeHandle.getTreeType()).thenReturn(SmbConstants.TYPE_SHARE);
            assertEquals(SmbConstants.TYPE_SHARE, smbTreeHandle.getTreeType(), "Tree type should be TYPE_SHARE");
            when(smbTreeHandle.getTreeType()).thenReturn(SmbConstants.TYPE_PRINTER);
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 7.1K bytes
    - Viewed (0)
  3. src/main/java/jcifs/smb/SmbTreeHandleImpl.java

                }
                return null;
            }
        }
    
        /**
         * {@inheritDoc}
         *
         * @see jcifs.SmbTreeHandle#getTreeType()
         */
        @Override
        public int getTreeType() {
            return this.treeConnection.getTreeType();
        }
    
        /**
         * {@inheritDoc}
         *
         * @see jcifs.SmbTreeHandle#getConnectedShare()
         */
        @Override
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sun Aug 31 08:00:57 UTC 2025
    - 11.1K bytes
    - Viewed (0)
  4. src/test/java/jcifs/smb/SmbTreeHandleImplTest.java

        }
    
        @Test
        @DisplayName("Tree properties delegate: getTreeType/getConnectedShare")
        void treePropertiesDelegate() {
            // Validates simple property delegation to the connection
            when(treeConnection.getTreeType()).thenReturn(7);
            when(treeConnection.getConnectedShare()).thenReturn("SHARE");
            assertEquals(7, handle.getTreeType());
            assertEquals("SHARE", handle.getConnectedShare());
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 14.4K bytes
    - Viewed (0)
  5. src/main/java/jcifs/SmbTreeHandle.java

         * @return the remote host name
         */
        String getRemoteHostName();
    
        /**
         * Gets the tree type (share type such as disk, printer, pipe, etc.)
         * @return the tree type
         */
        int getTreeType();
    
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 16 01:32:48 UTC 2025
    - 2.6K bytes
    - Viewed (0)
  6. src/test/java/jcifs/smb/SmbTreeConnectionTest.java

            assertEquals(-1, c.getTreeId());
        }
    
        @Test
        @DisplayName("getTreeType and getConnectedShare delegate to tree")
        void getters_delegateToTree() {
            SmbTreeConnection c = newConn();
            SmbTreeImpl tree = mock(SmbTreeImpl.class);
            when(tree.acquire(false)).thenReturn(tree);
            when(tree.getTreeType()).thenReturn(7);
            when(tree.getShare()).thenReturn("SHARE");
            setTree(c, tree);
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 07:14:38 UTC 2025
    - 13K bytes
    - Viewed (0)
  7. src/test/java/jcifs/smb/SmbTreeConnectionTraceTest.java

        }
    
        static java.util.stream.Stream<Arguments> npePublicGetters() {
            return java.util.stream.Stream.of(Arguments.of("getTreeType()", (org.junit.jupiter.api.function.Executable) () -> {
                CIFSContext ctx = mock(CIFSContext.class);
                new SmbTreeConnectionTrace(ctx).getTreeType();
            }), Arguments.of("getConnectedShare()", (org.junit.jupiter.api.function.Executable) () -> {
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 8.7K bytes
    - Viewed (0)
  8. src/main/java/jcifs/smb/SmbTreeConnection.java

            }
        }
    
        /**
         * Only call this method while holding a tree handle
         *
         * @return the connected tree type
         */
        public int getTreeType() {
            try (SmbTreeImpl t = getTree()) {
                return t.getTreeType();
            }
        }
    
        /**
         *
         * Only call this method while holding a tree handle
         *
         * @return the share we are connected to
         */
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 30 05:58:03 UTC 2025
    - 30.4K bytes
    - Viewed (0)
  9. src/main/java/jcifs/smb/SmbTreeImpl.java

        public boolean isConnected() {
            return this.tid != -1 && this.session.isConnected() && this.connectionState.get() == 2;
        }
    
        /**
         * @return the type of this tree
         */
        public int getTreeType() {
            final String connectedService = getService();
            if ("LPT1:".equals(connectedService)) {
                return SmbConstants.TYPE_PRINTER;
            }
            if ("COMM".equals(connectedService)) {
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sun Aug 31 08:00:57 UTC 2025
    - 30K bytes
    - Viewed (0)
  10. src/main/java/jcifs/smb/SmbFile.java

            try {
                final int t = this.fileLocator.getType();
                if (t == TYPE_SHARE) {
                    try (SmbTreeHandle th = ensureTreeConnected()) {
                        this.fileLocator.updateType(th.getTreeType());
                    }
                }
                return t;
            } catch (final CIFSException e) {
                throw SmbException.wrap(e);
            }
        }
    
        @Override
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 30 05:58:03 UTC 2025
    - 103.2K bytes
    - Viewed (0)
Back to top