Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 8 of 8 for getInitialSize (0.45 sec)

  1. src/test/java/jcifs/SmbFileHandleTest.java

        }
    
        /**
         * Test getInitialSize() when the size is zero.
         */
        @Test
        void testGetInitialSize_zero() {
            long expectedSize = 0L;
            when(smbFileHandle.getInitialSize()).thenReturn(expectedSize);
            long actualSize = smbFileHandle.getInitialSize();
            assertEquals(expectedSize, actualSize, "getInitialSize should return 0 for an empty file.");
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 5.1K bytes
    - Viewed (0)
  2. src/main/java/jcifs/SmbFileHandle.java

         */
        void release() throws CIFSException;
    
        /**
         * Returns the initial size of the file when it was opened
         *
         * @return the file size when it was opened
         */
        long getInitialSize();
    
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 16 01:32:48 UTC 2025
    - 2K bytes
    - Viewed (0)
  3. src/test/java/jcifs/smb/SmbFileOutputStreamTest.java

            when(mockFileHandle.acquire()).thenReturn(mockFileHandle);
    
            when(mockFile.openUnshared(anyInt(), anyInt(), anyInt(), anyInt(), anyInt())).thenReturn(mockFileHandle);
            lenient().when(mockFileHandle.getInitialSize()).thenReturn(100L); // File already has 100 bytes
    
            when(mockTreeHandle.send(any(Smb2WriteRequest.class), any())).thenReturn(mockWriteResponse);
            when(mockWriteResponse.getCount()).thenReturn(8);
    
    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/test/java/jcifs/smb/SmbFileHandleImplTest.java

        }
    
        @Test
        @DisplayName("getInitialSize returns constructor value")
        void getInitialSize_returnsValue() {
            when(cfg.isTraceResourceUsage()).thenReturn(false);
            stubValidTree(1L, true, true);
            SmbFileHandleImpl h = new SmbFileHandleImpl(cfg, 1, tree, "//size", 0, 0, 0, 0, 987654321L);
            assertEquals(987654321L, h.getInitialSize());
        }
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 12.3K bytes
    - Viewed (0)
  5. src/main/java/jcifs/smb/SmbCopyUtil.java

                try (SmbFileHandleImpl sfd =
                        src.openUnshared(0, SmbConstants.O_RDONLY, SmbConstants.FILE_SHARE_READ, SmbConstants.ATTR_NORMAL, 0)) {
                    if (sfd.getInitialSize() == 0) {
                        try (SmbFileHandleImpl edfd = openCopyTargetFile(dest, src.getAttributes(), !write)) {
                            return;
                        }
                    }
    
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 16 01:32:48 UTC 2025
    - 16.6K bytes
    - Viewed (0)
  6. src/test/java/jcifs/smb/SmbCopyUtilTest.java

            when(sh.isSameTree(dh)).thenReturn(true);
    
            // Source open returns a handle that reports size 0
            SmbFileHandleImpl sfd = mock(SmbFileHandleImpl.class);
            when(sfd.getInitialSize()).thenReturn(0L);
            when(src.openUnshared(eq(0), eq(SmbConstants.O_RDONLY), eq(SmbConstants.FILE_SHARE_READ), eq(SmbConstants.ATTR_NORMAL), eq(0)))
                    .thenReturn(sfd);
    
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 12.1K bytes
    - Viewed (0)
  7. src/main/java/jcifs/smb/SmbFileOutputStream.java

            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) {
                        // no open option for truncating, need to truncate the file
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 16 01:32:48 UTC 2025
    - 12.8K bytes
    - Viewed (0)
  8. src/main/java/jcifs/smb/SmbFileHandleImpl.java

                throw new SmbException("Descriptor is no longer valid");
            }
            return this.fileId;
        }
    
        /**
         * @return the initialSize
         */
        @Override
        public long getInitialSize() {
            return this.initialSize;
        }
    
        /**
         * {@inheritDoc}
         *
         * @see jcifs.SmbFileHandle#getTree()
         */
        @Override
        public SmbTreeHandleImpl getTree() {
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sun Aug 31 08:00:57 UTC 2025
    - 9.4K bytes
    - Viewed (1)
Back to top