Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 82 for Acquire (0.59 sec)

  1. src/test/java/jcifs/util/transport/TransportTest.java

        @Nested
        @DisplayName("Resource management tests")
        class ResourceManagementTests {
    
            @Test
            @DisplayName("acquire should increment usage count")
            void shouldIncrementUsageCount() {
                long initial = transport.getUsageCount();
                transport.acquire();
                assertEquals(initial + 1, transport.getUsageCount());
            }
    
            @Test
    Registered: Sat Dec 20 13:44:44 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 9.5K bytes
    - Viewed (0)
  2. src/test/java/jcifs/smb/SmbTransportImplTest.java

        void contextAccessor() {
            assertSame(ctx, transport.getContext());
        }
    
        @Test
        @DisplayName("acquire returns same instance")
        void acquireReturnsSameInstance() {
            SmbTransportImpl acquired = transport.acquire();
            assertSame(transport, acquired);
            transport.close(); // release once
        }
    
        @Test
    Registered: Sat Dec 20 13:44:44 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 17.6K bytes
    - Viewed (0)
  3. src/main/java/jcifs/smb/SmbFileOutputStream.java

         */
        protected synchronized SmbFileHandleImpl ensureOpen() throws CIFSException {
            if (!isOpen()) {
                // one extra acquire to keep this open till the stream is released
                this.handle = this.file.openUnshared(this.openFlags, this.access, this.sharing, SmbConstants.ATTR_NORMAL, 0).acquire();
                if (this.append) {
                    this.fp = this.handle.getInitialSize();
                    if (log.isDebugEnabled()) {
    Registered: Sat Dec 20 13:44:44 UTC 2025
    - Last Modified: Sat Aug 16 01:32:48 UTC 2025
    - 12.8K bytes
    - Viewed (0)
  4. src/main/java/jcifs/smb/SmbRandomAccessFile.java

            if (this.handle == null || !this.handle.isValid()) {
                // one extra acquire to keep this open till the stream is released
                this.handle =
                        this.file.openUnshared(this.openFlags, this.access, this.sharing, SmbConstants.ATTR_NORMAL, this.options).acquire();
                return this.handle;
            }
            return this.handle.acquire();
        }
    
        /**
         * Ensures that the file descriptor is openend
    Registered: Sat Dec 20 13:44:44 UTC 2025
    - Last Modified: Sat Aug 16 01:32:48 UTC 2025
    - 18.8K bytes
    - Viewed (0)
  5. src/test/java/jcifs/smb/SmbFileInputStreamTest.java

            @Test
            @DisplayName("open() acquires handle and closes it")
            void openDelegatesEnsureOpenAndCloses() throws Exception {
                SmbFileInputStream in = newStream();
                in.open();
                // ensureOpen returns acquired handle; try-with-resources must close it
                verify(mockHandle, times(1)).close();
                verify(mockHandle, atLeastOnce()).acquire();
            }
    
            @Test
    Registered: Sat Dec 20 13:44:44 UTC 2025
    - Last Modified: Thu Aug 14 07:14:38 UTC 2025
    - 12.8K bytes
    - Viewed (0)
  6. src/main/java/jcifs/smb/SmbFileInputStream.java

                } else {
                    this.handle = this.file.openUnshared(this.openFlags, this.access, this.sharing, SmbConstants.ATTR_NORMAL, 0).acquire();
                }
                return this.handle;
            }
            return this.handle.acquire();
        }
    
        /**
         * Converts an SmbException to an IOException
         *
         * @param se the SmbException to convert
    Registered: Sat Dec 20 13:44:44 UTC 2025
    - Last Modified: Sat Aug 30 05:58:03 UTC 2025
    - 15.6K bytes
    - Viewed (0)
  7. src/main/java/jcifs/smb/SmbSessionImpl.java

            throw new ClassCastException();
        }
    
        /**
         * @return session increased usage count
         */
        public SmbSessionImpl acquire() {
            long usage = this.usageCount.incrementAndGet();
            if (log.isTraceEnabled()) {
                log.trace("Acquire session " + usage + " " + this);
            }
    
            if (usage == 1) {
                synchronized (this) {
    Registered: Sat Dec 20 13:44:44 UTC 2025
    - Last Modified: Sun Aug 31 08:00:57 UTC 2025
    - 68.9K bytes
    - Viewed (0)
  8. src/main/java/jcifs/smb/SmbTransportPoolImpl.java

                        continue;
                    }
    
                    if (log.isTraceEnabled()) {
                        log.trace("Reusing transport connection " + conn);
                    }
                    return conn.acquire();
                }
            }
    
            return null;
        }
    
        @Override
        public SmbTransportImpl getSmbTransport(final CIFSContext tf, final String name, final int port, final boolean exclusive,
    Registered: Sat Dec 20 13:44:44 UTC 2025
    - Last Modified: Sun Aug 31 08:00:57 UTC 2025
    - 33.4K bytes
    - Viewed (0)
  9. src/main/java/jcifs/smb/NetServerEnumIterator.java

            } else {
                throw new SmbException("The requested list operations is invalid: " + locator.getURL());
            }
            this.response = new NetServerEnum2Response(th.getConfig());
    
            this.treeHandle = th.acquire();
            try {
                this.next = open();
            } catch (final Exception e) {
                this.treeHandle.release();
                throw e;
            }
    
        }
    
    Registered: Sat Dec 20 13:44:44 UTC 2025
    - Last Modified: Sat Aug 16 01:32:48 UTC 2025
    - 6.5K bytes
    - Viewed (0)
  10. src/main/java/jcifs/smb/SmbTransportImpl.java

            return this.transportContext;
        }
    
        /**
         * {@inheritDoc}
         *
         * @see jcifs.util.transport.Transport#acquire()
         */
        @Override
        public SmbTransportImpl acquire() {
            return (SmbTransportImpl) super.acquire();
        }
    
        /**
         * @return the server's encryption key
         */
        @Override
        public byte[] getServerEncryptionKey() {
    Registered: Sat Dec 20 13:44:44 UTC 2025
    - Last Modified: Sat Aug 30 05:58:03 UTC 2025
    - 69.8K bytes
    - Viewed (0)
Back to top