Uploaded image for project: 'Commons VFS'
  1. Commons VFS
  2. VFS-844

UriString of webdav-filename is twice URLEncoded in moveTo operation

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Blocker
    • Resolution: Fixed
    • 2.9.0
    • 2.10.0
    • None

    Description

      Twice URL encoding a filename which contains a blank results in invalid uriString.

       

      org.apache.commons.vfs2.FileSystemException: Could not rename "webdav4://admin:admin@localhost:53109/repository/default/write-tests/file%20space.txt" to "webdav4://admin:admin@localhost:53109/repository/default/write-tests/file1move.txt".
          at org.apache.commons.vfs2.provider.AbstractFileObject.moveTo(AbstractFileObject.java:1715)
          at org.apache.commons.vfs2.ProviderRenameTests.moveFile(ProviderRenameTests.java:70)
          at org.apache.commons.vfs2.ProviderRenameTests.testRenameFileWithSpaces(ProviderRenameTests.java:113)
          at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
          at java.base/java.lang.reflect.Method.invoke(Method.java:578)
          at org.apache.commons.vfs2.AbstractProviderTestCase.runTest(AbstractProviderTestCase.java:305)
          at junit.framework.TestCase.runBare(TestCase.java:142)
          at junit.framework.TestResult$1.protect(TestResult.java:122)
          at junit.framework.TestResult.runProtected(TestResult.java:142)
          at junit.framework.TestResult.run(TestResult.java:125)
          at junit.framework.TestCase.run(TestCase.java:130)
          at junit.framework.TestSuite.runTest(TestSuite.java:241)
          at junit.framework.TestSuite.run(TestSuite.java:236)
          at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
          at org.apache.commons.vfs2.AbstractTestSuite.lambda$run$0(AbstractTestSuite.java:235)
          at junit.framework.TestResult.runProtected(TestResult.java:142)
          at org.apache.commons.vfs2.AbstractTestSuite.run(AbstractTestSuite.java:239)
          at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:90)
          at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
          at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
          at org.junit.vintage.engine.execution.RunnerExecutor.execute(RunnerExecutor.java:42)
          at org.junit.vintage.engine.VintageTestEngine.executeAllChildren(VintageTestEngine.java:80)
          at org.junit.vintage.engine.VintageTestEngine.execute(VintageTestEngine.java:72)
          at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:147)
          at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:127)
          at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:90)
          at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:55)
          at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:102)
          at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:54)
          at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:114)
          at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:86)
          at org.junit.platform.launcher.core.DefaultLauncherSession$DelegatingLauncher.execute(DefaultLauncherSession.java:86)
          at org.apache.maven.surefire.junitplatform.LazyLauncher.execute(LazyLauncher.java:50)
          at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.execute(JUnitPlatformProvider.java:184)
          at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invokeAllTests(JUnitPlatformProvider.java:148)
          at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invoke(JUnitPlatformProvider.java:122)
          at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:385)
          at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:162)
          at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:507)
          at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:495)
      Caused by: org.apache.commons.vfs2.FileNotFoundException: Could not read from "http://admin:***@localhost:53109/repository/default/write-tests/file%2520space.txt" because it is not a file.
          at org.apache.commons.vfs2.provider.webdav4.Webdav4FileObject.executeRequest(Webdav4FileObject.java:498)
          at org.apache.commons.vfs2.provider.webdav4.Webdav4FileObject.doRename(Webdav4FileObject.java:453)
          at org.apache.commons.vfs2.provider.AbstractFileObject.moveTo(AbstractFileObject.java:1706)
          ... 39 more

       

       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              beisetho Thorsten Beise
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: