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

Problem syncing files with trailing spaces to Windows #28

Open
nlmarco opened this issue May 6, 2014 · 0 comments
Open

Problem syncing files with trailing spaces to Windows #28

nlmarco opened this issue May 6, 2014 · 0 comments
Labels
bug

Comments

@nlmarco
Copy link
Contributor

@nlmarco nlmarco commented May 6, 2014

On GNU/Linux (at least when using the ext2 (or 3 or 4) file system), every character is allowed in a file or directory name. On Windows, there are many constraints and it seems that even a trailing space makes problems (see error below).

We should somehow try to handle this in a user-friendly way. Currently, it is blocking the synchronisation completely, affecting other files and directories. The cleanest way to handle this would probably be to remove or replace all characters that are illegal in the destination and map this new file name to the old one (so that the work-around stays limited to the system where the problem exists).

So for example, the file "abc?def" would be mapped to the renamed file "abc_def" on Windows. On GNU/Linux, it would still be named "abc?def". Changes to the file should not cause the file name to be changed on GNU/Linux!

Maybe we should encode the illegal character (e.g. "?" => "%3F" [its hex-code]) instead of replacing it to make collisions less probable.

Here's the error concerning a trailing space (but it surely affects other characters, too):

2014-05-05 10:09:30,357 [main] ERROR c.c.c.c.CloudStoreClient - java.nio.file.InvalidPathException: Trailing char < > at index 96: C:\SecuCloudDrive\2014-04-25_Projektbeschreibung\   file name with spaces at beginning and end
java.nio.file.InvalidPathException: Trailing char < > at index 96: C:\SecuCloudDrive\2014-04-25_Projektbeschreibung\ file name with spaces at beginning and end
at sun.nio.fs.WindowsPathParser.normalize(Unknown Source) ~[na:1.7.0_55]
at sun.nio.fs.WindowsPathParser.parse(Unknown Source) ~[na:1.7.0_55]
at sun.nio.fs.WindowsPathParser.parse(Unknown Source) ~[na:1.7.0_55]
at sun.nio.fs.WindowsPath.parse(Unknown Source) ~[na:1.7.0_55]
at sun.nio.fs.WindowsFileSystem.getPath(Unknown Source) ~[na:1.7.0_55]
at java.io.File.toPath(Unknown Source) ~[na:1.7.0_55]
at co.codewizards.cloudstore.local.LocalRepoSync.sync(LocalRepoSync.java:124) ~[co.codewizards.cloudstore.local-0.9.4-SNAPSHOT.jar:na]
at co.codewizards.cloudstore.local.LocalRepoSync.sync(LocalRepoSync.java:106) ~[co.codewizards.cloudstore.local-0.9.4-SNAPSHOT.jar:na]
at co.codewizards.cloudstore.local.transport.FileRepoTransport.delete(FileRepoTransport.java:466) ~[co.codewizards.cloudstore.local-0.9.4-SNAPSHOT.jar:na]
at co.codewizards.cloudstore.core.repo.sync.RepoToRepoSync.syncModifications(RepoToRepoSync.java:375) ~[co.codewizards.cloudstore.core-0.9.4-SNAPSHOT.jar:na]
at co.codewizards.cloudstore.core.repo.sync.RepoToRepoSync.sync(RepoToRepoSync.java:234) ~[co.codewizards.cloudstore.core-0.9.4-SNAPSHOT.jar:na]
at co.codewizards.cloudstore.core.repo.sync.RepoToRepoSync.sync(RepoToRepoSync.java:214) ~[co.codewizards.cloudstore.core-0.9.4-SNAPSHOT.jar:na]
at co.codewizards.cloudstore.core.repo.sync.RepoToRepoSync.sync(RepoToRepoSync.java:128) ~[co.codewizards.cloudstore.core-0.9.4-SNAPSHOT.jar:na]
at co.codewizards.cloudstore.client.SyncSubCommand.sync(SyncSubCommand.java:131) ~[co.codewizards.cloudstore.client-0.9.4-SNAPSHOT.jar:na]
at co.codewizards.cloudstore.client.SyncSubCommand.run(SyncSubCommand.java:75) ~[co.codewizards.cloudstore.client-0.9.4-SNAPSHOT.jar:na]
at co.codewizards.cloudstore.client.CloudStoreClient.execute(CloudStoreClient.java:208) [co.codewizards.cloudstore.client-0.9.4-SNAPSHOT.jar:na]
at co.codewizards.cloudstore.client.CloudStoreClient.main(CloudStoreClient.java:151) [co.codewizards.cloudstore.client-0.9.4-SNAPSHOT.jar:na]

@nlmarco nlmarco added bug and removed bug labels May 6, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.