Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 11 - 20 of 92 for SmbFile (0.04 seconds)

  1. src/test/java/jcifs/smb1/smb1/SmbFileTest.java

                String url = "smb1://user:pass@server/share/file.txt";
                SmbFile smbFile = new SmbFile(url, mockAuth);
                assertNotNull(smbFile);
                assertEquals(mockAuth, smbFile.getPrincipal());
                assertEquals("server", smbFile.getServer());
                assertEquals("share", smbFile.getShare());
            }
    
            @Test
            public void testConstructorWithMalformedUrl() {
    Created: Sun Apr 05 00:10:12 GMT 2026
    - Last Modified: Thu Aug 14 05:31:44 GMT 2025
    - 8.5K bytes
    - Click Count (0)
  2. src/test/java/jcifs/smb/ShareEnumIteratorTest.java

    class ShareEnumIteratorTest {
    
        @Mock
        ResourceFilter filter;
    
        // Helper to create a parent SmbFile that does not hit the network for simple operations
        private SmbFile newParent() throws MalformedURLException {
            // Valid share URL with trailing slash; constructing does not perform I/O
            return new SmbFile("smb://test-server/share/");
        }
    
        // Helper to create a minimal FileEntry mock
    Created: Sun Apr 05 00:10:12 GMT 2026
    - Last Modified: Thu Aug 14 05:31:44 GMT 2025
    - 8.1K bytes
    - Click Count (0)
  3. src/main/java/jcifs/smb/SmbFileDirectoryLeasingExtension.java

         *
         * @param smbFile the SmbFile directory to list
         * @return array of SmbFile objects representing the directory contents
         * @throws SmbException if an error occurs
         */
        public static SmbFile[] listFilesWithLeasing(SmbFile smbFile) throws SmbException {
            if (!smbFile.isDirectory()) {
                throw new SmbException("Not a directory: " + smbFile.getPath());
            }
    
    Created: Sun Apr 05 00:10:12 GMT 2026
    - Last Modified: Sat Aug 23 02:21:31 GMT 2025
    - 7.1K bytes
    - Click Count (0)
  4. src/test/java/jcifs/smb/DosFileFilterTest.java

            new DosFileFilter("*.*", SmbFile.ATTR_ARCHIVE);
            new DosFileFilter("?", SmbFile.ATTR_DIRECTORY);
            new DosFileFilter("file.txt", SmbFile.ATTR_READONLY | SmbFile.ATTR_HIDDEN);
        }
    
        /**
         * Parameterized test for the {@link DosFileFilter#accept(SmbFile)} method.
         * This test covers various combinations of file attributes and filter attributes
    Created: Sun Apr 05 00:10:12 GMT 2026
    - Last Modified: Thu Aug 14 05:31:44 GMT 2025
    - 6.2K bytes
    - Click Count (0)
  5. src/main/java/jcifs/smb1/smb1/SmbFileOutputStream.java

            this(file, append,
                    append ? SmbFile.O_CREAT | SmbFile.O_WRONLY | SmbFile.O_APPEND : SmbFile.O_CREAT | SmbFile.O_WRONLY | SmbFile.O_TRUNC);
        }
    
        /**
         * Creates an {@link java.io.OutputStream} for writing bytes to a file
         * on an SMB server addressed by the <code>SmbFile</code> parameter. See
         * {@link jcifs.smb1.smb1.SmbFile} for a detailed description and examples of
         * the smb URL syntax.
    Created: Sun Apr 05 00:10:12 GMT 2026
    - Last Modified: Sat Aug 16 01:32:48 GMT 2025
    - 11K bytes
    - Click Count (0)
  6. src/main/java/jcifs/internal/smb2/lease/DirectoryLeaseManager.java

            }
    
            try {
                // Create SmbFile with cached attributes
                SmbFile file = new SmbFile(filePath, context);
                // Note: We would need to add a method to SmbFile to set cached attributes
                // For now, just return the file object
                return file;
            } catch (Exception e) {
                log.warn("Failed to create SmbFile for {}: {}", filePath, e.getMessage());
    Created: Sun Apr 05 00:10:12 GMT 2026
    - Last Modified: Sat Aug 23 01:47:47 GMT 2025
    - 12.3K bytes
    - Click Count (0)
  7. README.md

    ### Basic Usage
    
    ```java
    import jcifs.CIFSContext;
    import jcifs.context.SingletonContext;
    import jcifs.smb.SmbFile;
    
    // Using default context
    CIFSContext context = SingletonContext.getInstance();
    
    // Access a file (encryption is transparent - automatically used if server requires it)
    try (SmbFile file = new SmbFile("smb://server/share/file.txt", context)) {
        if (file.exists()) {
    Created: Sun Apr 05 00:10:12 GMT 2026
    - Last Modified: Sat Aug 30 09:24:52 GMT 2025
    - 6.2K bytes
    - Click Count (0)
  8. src/main/java/jcifs/smb/SmbEnumerationUtil.java

                final List<SmbFile> list = new ArrayList<>();
                while (it.hasNext()) {
                    try (SmbResource n = it.next()) {
                        if (n instanceof SmbFile) {
                            list.add((SmbFile) n);
                        }
                    }
                }
                return list.toArray(new SmbFile[list.size()]);
            } catch (final CIFSException e) {
    Created: Sun Apr 05 00:10:12 GMT 2026
    - Last Modified: Thu Aug 14 07:14:38 GMT 2025
    - 12.3K bytes
    - Click Count (0)
  9. src/test/java/jcifs/smb1/smb1/SmbFilenameFilterTest.java

        void acceptReturnsTrueWhenNameMatches() throws Exception {
            SmbFile dir = Mockito.mock(SmbFile.class);
            SmbFilenameFilter filter = (d, n) -> n.equalsIgnoreCase("hello.txt");
            assertTrue(filter.accept(dir, "Hello.TXT"));
        }
    
        @Test
        void acceptReturnsFalseWhenNameDoesNotMatch() throws Exception {
            SmbFile dir = Mockito.mock(SmbFile.class);
    Created: Sun Apr 05 00:10:12 GMT 2026
    - Last Modified: Thu Aug 14 05:31:44 GMT 2025
    - 1.6K bytes
    - Click Count (0)
  10. src/test/java/jcifs/context/CIFSContextWrapperTest.java

            // Test get(String url) method
            String url = "smb://server/share/file.txt";
            SmbResource mockSmbResource = mock(SmbFile.class);
            // Mocking SmbFile constructor is tricky, so we'll just verify the call to the delegate
            // and ensure no exception is thrown for a valid URL.
            // The actual SmbFile creation is outside the scope of this wrapper's direct responsibility.
    
    Created: Sun Apr 05 00:10:12 GMT 2026
    - Last Modified: Thu Aug 14 05:31:44 GMT 2025
    - 10.7K bytes
    - Click Count (0)
Back to Top