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

HTTP Download fails on Windows when url contains reserved character #1

Open
tlahn opened this issue Aug 26, 2014 · 1 comment
Open

Comments

@tlahn
Copy link
Member

tlahn commented Aug 26, 2014

When downloading a file via http on windows, an IOException is thrown if the url of the file contains a character that is not valid for file names on windows.

Example:
sbuild http://downloads.sourceforge.net/project/trmi/trmi/trmi-0.1.4/trmi-0.1.4.zip?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Ftrmi%2Ffiles%2Ftrmi%2Ftrmi-0.1.4%2Ftrmi-0.1.4.zip%2Fdownload

Fails with: IOException: The filename, directory name, or volume label syntax is incorrect

StackTrace:

Exception in thread "main" java.io.IOException: The filename, directory name, or volume label syntax is incorrect
        at java.io.WinNTFileSystem.createFileExclusively(Native Method)
        at java.io.File.createTempFile(File.java:2024)
        at org.sbuild.plugins.http.HttpSupport$.download(HttpSupport.scala:42)
        at org.sbuild.plugins.http.HttpSchemeHandlerBase.download(HttpSchemeHandler.scala:69)
        at org.sbuild.plugins.http.HttpSchemeHandler.resolve(HttpSchemeHandler.scala:34)
        at org.sbuild.internal.BuildFileProject$$anonfun$4.apply(BuildFileProject.scala:204)
        at org.sbuild.internal.BuildFileProject$$anonfun$4.apply(BuildFileProject.scala:204)
        at org.sbuild.execute.TargetExecutor.liftedTree2$1(TargetExecutor.scala:428)
        at org.sbuild.execute.TargetExecutor.inner$1(TargetExecutor.scala:404)
        at org.sbuild.execute.TargetExecutor.preorderedDependenciesTree(TargetExecutor.scala:556)
        at org.sbuild.runner.SBuildRunner$$anonfun$18.apply(SBuildRunner.scala:587)
        at org.sbuild.runner.SBuildRunner$$anonfun$18.apply(SBuildRunner.scala:586)
        at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:245)
        at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:245)
        at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59)
        at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:48)
        at scala.collection.TraversableLike$class.map(TraversableLike.scala:245)
        at scala.collection.AbstractTraversable.map(Traversable.scala:104)
        at org.sbuild.runner.SBuildRunner.run(SBuildRunner.scala:586)
        at org.sbuild.runner.SBuildRunner.run(SBuildRunner.scala:303)
        at org.sbuild.runner.SBuildRunner$.main(SBuildRunner.scala:57)
        at org.sbuild.runner.SBuildRunner.main(SBuildRunner.scala)

Specific issue in this example is the '?' (questionmark) character after "trmi-0.1.4.zip" on creation of the temp file.

For more info on invalid characters see: http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247%28v=vs.85%29.aspx#naming_conventions

@lefou
Copy link
Member

lefou commented Aug 27, 2014

Thanks for reporting this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants