Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-8313

JcrResourceProvider#move fails when moving to root resource

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: JCR Resource 3.0.18
    • Fix Version/s: None
    • Component/s: JCR
    • Labels:
      None

      Description

      The JcrResourceProvider#move method uses string concatenation to determine the destination path.

      final String dstNodePath = destAbsPath + '/' + ResourceUtil.getName(srcAbsPath);
      

      If dstAbsPath is the root path / and ResourceUtil.getName(srcAbsPath) is e.g. "foo", then the concatenated path becomes //foo (with a leading double slash), which causes the move to fail.

      The construction of dstAbsPath should handle this scenario properly.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              jsedding Julian Sedding
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: