Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@marevol
Copy link
Contributor

@marevol marevol commented Dec 6, 2025

Summary

  • Add isPreserveShareCase() configuration option to preserve share name case instead of converting to uppercase
  • Fix share comparison in SmbTreeConnection to use case-insensitive matching
  • Required for DFS namespaces with case-sensitive link names

Changes

  • Configuration interface: Add isPreserveShareCase() method
  • BaseConfiguration: Add preserveShareCase field with default false
  • DelegatingConfiguration: Delegate isPreserveShareCase() to wrapped config
  • PropertyConfiguration: Parse jcifs.smb.client.preserveShareCase property
  • SmbTreeConnection: Use equalsIgnoreCase() for share comparison (2 locations)
  • SmbTreeImpl: Conditionally preserve case based on configuration

Usage

Properties props = new Properties();
props.setProperty("jcifs.smb.client.preserveShareCase", "true");
PropertyConfiguration config = new PropertyConfiguration(props);

Test plan

  • Unit tests for isPreserveShareCase() in all configuration classes
  • Unit tests for case-insensitive share comparison in SmbTreeConnection
  • Unit tests for case preservation in SmbTreeImpl

🤖 Generated with Claude Code

…espaces

Add configuration option to preserve share name case instead of
converting to uppercase. This is required for DFS namespaces with
case-sensitive link names.

Changes:
- Add isPreserveShareCase() to Configuration interface
- Implement in BaseConfiguration, DelegatingConfiguration, PropertyConfiguration
- Property: jcifs.smb.client.preserveShareCase (default: false)
- Fix share comparison in SmbTreeConnection to use case-insensitive matching
- Conditionally preserve case in SmbTreeImpl based on configuration

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@marevol marevol requested a review from Copilot December 6, 2025 09:04
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds configuration support for preserving share name case, which is necessary for DFS namespaces with case-sensitive link names. By default, share names are converted to uppercase, but this new option allows preserving the original case when needed.

  • Introduces isPreserveShareCase() configuration method with default value false
  • Updates share comparison logic to use case-insensitive matching
  • Conditionally preserves share name case in SmbTreeImpl based on configuration

Reviewed changes

Copilot reviewed 15 out of 16 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/main/java/org/codelibs/jcifs/smb/Configuration.java Adds interface method for preserveShareCase configuration
src/main/java/org/codelibs/jcifs/smb/config/BaseConfiguration.java Implements preserveShareCase field with default false
src/main/java/org/codelibs/jcifs/smb/config/DelegatingConfiguration.java Delegates preserveShareCase to wrapped configuration
src/main/java/org/codelibs/jcifs/smb/config/PropertyConfiguration.java Parses preserveShareCase from properties
src/main/java/org/codelibs/jcifs/smb/impl/SmbTreeImpl.java Conditionally preserves share case based on configuration
src/main/java/org/codelibs/jcifs/smb/impl/SmbTreeConnection.java Uses case-insensitive comparison for share matching
src/test/java/org/codelibs/jcifs/smb/config/BaseConfigurationTest.java Tests default preserveShareCase value
src/test/java/org/codelibs/jcifs/smb/config/DelegatingConfigurationTest.java Tests preserveShareCase delegation
src/test/java/org/codelibs/jcifs/smb/config/PropertyConfigurationTest.java Tests preserveShareCase property parsing
src/test/java/org/codelibs/jcifs/smb/impl/SmbTreeImplTest.java Tests share case preservation behavior
src/test/java/org/codelibs/jcifs/smb/impl/SmbTreeConnectionTest.java Tests case-insensitive share comparison
src/test/java/org/codelibs/jcifs/smb/impl/NtlmAuthenticatorTest.java Code formatting changes only
src/test/java/org/codelibs/jcifs/smb/impl/NtlmPasswordAuthenticatorTest.java Code formatting changes only
src/test/java/org/codelibs/jcifs/smb/impl/NtlmNtHashAuthenticatorTest.java Code formatting changes only
src/test/java/org/codelibs/jcifs/smb/internal/smb1/com/SmbComDeleteDirectoryTest.java Code formatting changes only

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@marevol marevol merged commit ca04edb into main Dec 6, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants