Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 18 for ensureOpen (0.05 sec)

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

            // Act
            SmbFileHandleImpl opened = handle.ensureOpen();
    
            // Assert
            assertSame(fh, opened);
            assertTrue(handle.isOpen(), "Handle should report open after ensureOpen");
            verify(pipe, times(1)).openUnshared(eq("\\\\pipe\\\\foo"), eq(0), anyInt(), anyInt(), eq(SmbConstants.ATTR_NORMAL), eq(0));
        }
    
        @Test
        @DisplayName("ensureOpen throws when handle already closed")
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 07:14:38 UTC 2025
    - 16.7K bytes
    - Viewed (0)
  2. src/main/java/jcifs/smb/SmbPipeOutputStream.java

            return this.handle.ensureTreeConnected();
        }
    
        @Override
        protected synchronized SmbFileHandleImpl ensureOpen() throws CIFSException {
            return this.handle.ensureOpen();
        }
    
        /**
         * Gets the pipe handle implementation for this output stream.
         *
         * @return the handle
         */
        protected SmbPipeHandleImpl getHandle() {
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 16 01:32:48 UTC 2025
    - 2.1K bytes
    - Viewed (0)
  3. src/test/java/jcifs/smb/SmbPipeOutputStreamTest.java

        }
    
        @Test
        @DisplayName("ensureOpen delegates and returns the file handle")
        void ensureOpen_delegatesAndReturns() throws Exception {
            // Arrange
            SmbPipeOutputStream out = newStream();
            when(handle.ensureOpen()).thenReturn(fileHandle);
    
            // Act
            SmbFileHandleImpl result = out.ensureOpen();
    
            // Assert
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 5.4K bytes
    - Viewed (0)
  4. src/test/java/jcifs/smb/SmbPipeInputStreamTest.java

        }
    
        @Test
        @DisplayName("ensureOpen delegates to handle")
        void ensureOpen_delegates() throws Exception {
            // Verify ensureOpen() delegates to SmbPipeHandleImpl
            SmbPipeInputStream stream = newStreamWithMinimalStubs(true);
            when(handle.ensureOpen()).thenReturn(fd);
    
            SmbFileHandleImpl result = stream.ensureOpen();
            assertSame(fd, result);
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 9.9K bytes
    - Viewed (0)
  5. src/test/java/jcifs/smb/SmbPipeHandleImplTest.java

            // Initially not open (isStale returns false when handle is null, not true)
            assertFalse(target.isOpen());
            assertFalse(target.isStale());
    
            // After ensureOpen, handle valid -> open
            SmbFileHandleImpl fh = target.ensureOpen();
            assertSame(fileHandle, fh);
            assertTrue(target.isOpen());
            assertFalse(target.isStale());
    
            // If handle becomes invalid, reflect stale
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 11.7K bytes
    - Viewed (0)
  6. src/test/java/jcifs/smb/SmbRandomAccessFileTest.java

        void write_lenZero_noIO() throws Exception {
            SmbRandomAccessFile raf = spy(newInstance("rw", false, true, false));
            // If ensureOpen is called, fail the test
            doThrow(new AssertionError("ensureOpen should not be called")).when(raf).ensureOpen();
            raf.write(new byte[1], 0, 0);
        }
    
        @Test
        @DisplayName("Null inputs: read(byte[]) and write* with nulls throw NPE")
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 18.1K bytes
    - Viewed (0)
  7. src/main/java/jcifs/smb/SmbPipeInputStream.java

            return this.handle.ensureTreeConnected();
        }
    
        @Override
        protected synchronized SmbFileHandleImpl ensureOpen() throws CIFSException {
            return this.handle.ensureOpen();
        }
    
        /**
         * This stream class is unbuffered. Therefore this method will always
         * return 0 for streams connected to regular files. However, a
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 16 01:32:48 UTC 2025
    - 3.8K bytes
    - Viewed (0)
  8. src/main/java/jcifs/smb/SmbPipeHandleImpl.java

         */
        @Override
        public boolean isStale() {
            return !this.open || this.handle != null && !this.handle.isValid();
        }
    
        @Override
        public synchronized SmbFileHandleImpl ensureOpen() throws CIFSException {
            if (!this.open) {
                throw new SmbException("Pipe handle already closed");
            }
    
            if (!isOpen()) {
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sun Aug 31 08:00:57 UTC 2025
    - 10.2K bytes
    - Viewed (0)
  9. src/main/java/jcifs/smb/SmbRandomAccessFile.java

                } else {
                    throw new IllegalArgumentException("Invalid mode");
                }
    
                try (SmbFileHandle h = ensureOpen()) {}
                this.readSize = th.getReceiveBufferSize() - 70;
                this.writeSize = th.getSendBufferSize() - 70;
    
                if (th.hasCapability(SmbConstants.CAP_LARGE_READX)) {
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 16 01:32:48 UTC 2025
    - 18.8K bytes
    - Viewed (0)
  10. src/main/java/jcifs/smb1/smb1/TransactNamedPipeOutputStream.java

                pipe.send(new TransCallNamedPipe(path, b, off, len), new TransCallNamedPipeResponse(pipe));
            } else if ((pipe.pipeType & SmbNamedPipe.PIPE_TYPE_TRANSACT) == SmbNamedPipe.PIPE_TYPE_TRANSACT) {
                ensureOpen();
                final TransTransactNamedPipe req = new TransTransactNamedPipe(pipe.fid, b, off, len);
                if (dcePipe) {
                    req.maxDataCount = 1024;
                }
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 07:14:38 UTC 2025
    - 2.5K bytes
    - Viewed (0)
Back to top