Skip to content
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

Separator in Window #740

Closed
ccarlenzoli opened this issue Dec 13, 2024 · 3 comments
Closed

Separator in Window #740

ccarlenzoli opened this issue Dec 13, 2024 · 3 comments

Comments

@ccarlenzoli
Copy link

I'm using the tool in Openshift working perfectly but when I tried to test on my Notebook some features of my application I ended up with an error on managing Folders.
Since I'm working on Windows I understood that problem is related to a wrong management of file separator.
I did a workaround at line 1518 of S3ProxyHanlder changing this code

switch (metadata.getType()) {
case FOLDER:
// fallthrough
case RELATIVE_PATH:
if (delimiter != null) {
commonPrefixes.add(metadata.getName());
continue;
}
break;
default:
break;
}

in

switch (metadata.getType()) {
case FOLDER:
// fallthrough
case RELATIVE_PATH:
if (delimiter != null) {
commonPrefixes.add(metadata.getName().replace(File.separatorChar, '/'));
continue;
}
break;
default:
break;
}

following the same code LocalBlobStore (jclouds) is doing in its filterDirectory method.

Hope you will officially fix this behavior so I will use the new version from Maven Repo...otherwise I have to keep a local copy :)

Best

@gaul
Copy link
Owner

gaul commented Dec 13, 2024

This sounds like a problem in the underlying jclouds filesystem provider. I don't have access to a Windows system so this is hard for me to test. Instead could you try the new filesystem-nio2 storage backed to see if it already resolves your symptoms?

@ccarlenzoli
Copy link
Author

ccarlenzoli commented Dec 13, 2024

I can try. Btw the issue is due to the fact that jclouds return a path using Windows separator (aka \ ) and this when returned causes a problem when reentering as new prefix. I did the substitution using the separatorChar to be compliant with any OS not using / as separator. I will try filesystem-nio2

gaul added a commit that referenced this issue Dec 14, 2024
This improves compatibility on Windows.  References #740.
gaul added a commit that referenced this issue Dec 14, 2024
@gaul
Copy link
Owner

gaul commented Dec 14, 2024

Please test filesystem-nio2 with the latest master or 2.5.0-SNAPSHOT from Maven. If you would like to contribute a fix to jclouds filesystem this is fine but it is better to focus on the newer filesystem-nio2 storage backend which will replace the former.

@gaul gaul closed this as completed Dec 23, 2024
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

No branches or pull requests

2 participants