-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Spaces in URI lead to an Exception #4
Comments
The exception is thrown in the URI parser, not the SMBPath class. SMBPath expects a valid URI. |
Sorry. It took some time for me to react, as well... I just updated the repository and tried fetch the files and dirs from another machine and got the following result, by applying this JUnit "test":
This is a stupid test, I know. It's just to demonstrate this result:
When the SMBDirectoryStream is trying to iterate over all entries it may tries to construct URIs from SmbFile objects. The URLs inside it (#getUrl) may contains paths with spaces. When you try apply #toURI on these, an error will still occur. see: SMBPath p = new SMBPath(provider, file.getURL().toURI()); I don't know, if I'm totallty wrong or not, but to me this is still broken. |
Thanks for the test case. Now I know what you mean. I check this out. |
issue #4 accept file and directory names with spaces when traversing directories
I uploaded version 1.1.7 to the Sonatype Releases Repo, it should be available on Maven Centraal soon. This version fixes your issue |
Sorry for not reacting any earlier:
It looks like, that now the library tries to look for the path with literally the |
Thanks for reporting this error. |
I know, that nothing has happened on this project for quite some time, but I stumbled accros it while struggeling with JCIFS.
Looks much cleaner, but there is a minor bug:
no.uis.nio.smb.SMBDirectoryStream#iterator
When you try to create a URI for a path containing spaces, like "Documents and Settings", the Stream crashes. It's easy to prevent by replacing
SMBPath p = new SMBPath(provider, file.getURL().toURI());
with something like
URI fileUri = new URI(file.getURL().toString().replace(" ", "%20"));
SMBPath p = new SMBPath(provider, fileUri);
Just if your are still interessted in this at all.
The text was updated successfully, but these errors were encountered: