garydgregory commented on PR #825:
URL: https://github.com/apache/commons-io/pull/825#issuecomment-3841313303
Hello @MiriamCohenDev
It looks to me that there are still bugs.
The PR should include Javadoc updates with new or fixed examples.
The `getPrefixLength` Javadoc mentions "the length of the file name prefix"
but the code is really about the length of _path_ prefix where one usually
considers the _file_ name to be the _last_ element of a path. See
`java.nio.file.Path.getFileName()`. That doesn't help with the confusion ;)
A UNC name is:
`\\<server-name>\<share-name>\<path>`
For example: `\\Server\SharedFolder\file.txt`
Such that the prefix should be IMO `\\Server\SharedFolder\` and not
`\\Server\`
A shared folder can be a remote drive so it would make sense to skip the
share name just like we skip a drive letter.
This would mean that our current Javadoc for `\\server\a\b\c.txt` -> 9
doesn't match what I am describing because `a` is the share name and `b\c.txt`
is the file path.
I think we might have to leave the _Extended_ (`\\?\`) UNC format for
another day ;)
All of this needs careful consideration!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]