Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 18 of 18 for ensureOpen (0.09 sec)

  1. src/main/java/jcifs/smb/SmbFileOutputStream.java

            this.access = access | SmbConstants.FILE_WRITE_DATA;
    
            try (SmbTreeHandleImpl th = file.ensureTreeConnected()) {
                this.smb2 = th.isSMB2();
                try (SmbFileHandleImpl fh = ensureOpen()) {
                    if (append) {
                        this.fp = fh.getInitialSize();
                    }
                    init(th);
                    if (!append && this.smb2) {
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 16 01:32:48 UTC 2025
    - 12.8K bytes
    - Viewed (0)
  2. src/main/java/jcifs/smb/SmbFileInputStream.java

         */
        public void open() throws CIFSException {
            try (SmbFileHandleImpl fh = ensureOpen()) {}
        }
    
        /**
         * @param file
         * @param openFlags
         * @return
         * @throws SmbException
         */
        synchronized SmbFileHandleImpl ensureOpen() throws CIFSException {
            if (this.handle == null || !this.handle.isValid()) {
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 30 05:58:03 UTC 2025
    - 15.6K bytes
    - Viewed (0)
  3. src/test/java/jcifs/smb/SmbFileOutputStreamTest.java

            when(mockFileHandle.isValid()).thenReturn(false, true); // First false to trigger ensureOpen, then true
            when(mockFileHandle.getFileId()).thenReturn(new byte[16]);
            when(mockFileHandle.acquire()).thenReturn(mockFileHandle);
    
            // Mock for ensureOpen to reopen file
            when(mockFile.openUnshared(anyInt(), anyInt(), anyInt(), anyInt(), anyInt())).thenReturn(mockFileHandle);
    
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 15.8K bytes
    - Viewed (0)
  4. src/main/java/jcifs/smb/SmbPipeHandleInternal.java

        /**
         * Ensures that the file handle is open and returns it.
         *
         * @return file handle
         * @throws CIFSException if an error occurs opening the file
         */
        SmbFileHandle ensureOpen() throws CIFSException;
    
        /**
         * Receive data from the pipe
         *
         * @param buf buffer to receive data into
         * @param off offset in the buffer
         * @param length maximum length to receive
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 16 01:32:48 UTC 2025
    - 3.7K bytes
    - Viewed (0)
  5. src/main/java/jcifs/netbios/NameServiceClientImpl.java

            }
        }
    
        int getNextNameTrnId() {
            if ((++this.nextNameTrnId & 0xFFFF) == 0) {
                this.nextNameTrnId = 1;
            }
            return this.nextNameTrnId;
        }
    
        void ensureOpen(final int timeout) throws IOException {
            this.closeTimeout = 0;
            if (this.transportContext.getConfig().getNetbiosSoTimeout() != 0) {
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 30 05:58:03 UTC 2025
    - 38.5K bytes
    - Viewed (0)
  6. src/main/java/jcifs/smb1/smb1/SmbFileOutputStream.java

         *
         * @return true if the stream is open, false otherwise
         */
        public boolean isOpen() {
            return file.isOpen();
        }
    
        void ensureOpen() throws IOException {
            // ensure file is open
            if (!file.isOpen()) {
                file.open(openFlags, access | SmbConstants.FILE_WRITE_DATA, SmbFile.ATTR_NORMAL, 0);
                if (append) {
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 16 01:32:48 UTC 2025
    - 11K bytes
    - Viewed (0)
  7. src/main/java/jcifs/smb1/netbios/NameServiceClient.java

            }
        }
    
        int getNextNameTrnId() {
            if ((++nextNameTrnId & 0xFFFF) == 0) {
                nextNameTrnId = 1;
            }
            return nextNameTrnId;
        }
    
        void ensureOpen(final int timeout) throws IOException {
            closeTimeout = 0;
            if (SO_TIMEOUT != 0) {
                closeTimeout = Math.max(SO_TIMEOUT, timeout);
            }
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 07:14:38 UTC 2025
    - 17.6K bytes
    - Viewed (0)
  8. src/test/java/jcifs/smb/SmbFileInputStreamTest.java

            @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: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 07:14:38 UTC 2025
    - 12.8K bytes
    - Viewed (0)
Back to top