[
https://issues.apache.org/jira/browse/SOLR-10387?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15948180#comment-15948180
]
Erick Erickson commented on SOLR-10387:
---------------------------------------
I did change the comment as you're right it's confused. I dressed it up and put
it above the method.
That's not the code in the patch though. The first patch reads:
// If the dest ends in a file separator, it's a directory so append the
last element of the src to it.
if (dstName.endsWith(File.separator)) { // Dest is a directory.
int pos = srcName.lastIndexOf(File.separator);
Actually, looking at it some more the patch is wrong anyway, I'll upload
another version. The old one worked for me since the local fs separator is '/'.
The above now reads as below:
String dstSeparator = (dstIsZk) ? "/" : File.separator;
String srcSeparator = (srcIsZk) ? "/" : File.separator;
if (dstName.endsWith(dstSeparator)) { // Dest is a directory or non-leaf
znode.
int pos = srcName.lastIndexOf(srcSeparator);
If this doesn't work for you, can you tell me a little more about _how_ it
fails?
Sorry for the run-around...
> zkTransfer normalizes destination path incorrectly if source is a windows
> directory
> ------------------------------------------------------------------------------------
>
> Key: SOLR-10387
> URL: https://issues.apache.org/jira/browse/SOLR-10387
> Project: Solr
> Issue Type: Bug
> Security Level: Public(Default Security Level. Issues are Public)
> Reporter: gopikannan venugopalsamy
> Assignee: Erick Erickson
> Attachments: SOLR-10387.patch, SOLR-10387.patch
>
>
> While normalizing dest it is looking only for '/' in source path but this
> will not work for windows style delimiter.
> /lucene-solr/solr/solrj/src/java/org/apache/solr/common/cloud/ZkMaintenanceUtils.java
> private static String normalizeDest(String srcName, String dstName) {
> if (dstName.endsWith("/")) { // Dest is a directory.
> int pos = srcName.lastIndexOf("/");
> if (pos < 0) {
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]