[#2073] Fix DependenciesManager FileNotFoundException with some filen…
…ames
see https://play.lighthouseapp.com/projects/57987/tickets/2073
@flybyray Can you add a test that would reproduce the problem?
I tried to reproduce, but could not. See https://github.com/playframework/play1/pull/1075
@asolntsev your test runs within the play testenviroment. the dependencies manager is invoked differently. your test should be in the style of python tests from 'samples-and-tests/i-am-a-developer'. i try to add a test there.
@asolntsev i added a test https://github.com/flybyray/play1/commit/1307f79d8d2af6177838de833998be4e744d0ad5
and the problem is related to system environment "LANG". If it is not set it will crash. i checked it with the print out of "declare -x". if not set it will result in:
Exception in thread "main" play.exceptions.UnexpectedException: Unexpected Error at play.libs.IO.copyDirectory(IO.java:246) at play.libs.IO.copyDirectory(IO.java:240) at play.libs.IO.copyDirectory(IO.java:240) at play.libs.IO.copyDirectory(IO.java:240) at play.deps.DependenciesManager.install(DependenciesManager.java:275) at play.deps.DependenciesManager.retrieve(DependenciesManager.java:233) at play.deps.DependenciesManager.main(DependenciesManager.java:42) Caused by: java.io.FileNotFoundException: /home/flybyray/git/play1/samples-and-tests/i-am-a-developer/i-am-testing-2073/mod2073/public/Unterlagen BBank-Reporting/Anhang Performance-Bericht_ ??bersicht ??18 Bundesbank gesetz Meldepflichten.PDF (No such file or directory) at java.io.FileInputStream.open0(Native Method) at java.io.FileInputStream.open(FileInputStream.java:195) at java.io.FileInputStream.<init>(FileInputStream.java:138) at play.libs.IO.copyDirectory(IO.java:244) ... 6 more
flybyray-pc:~/git$ export LANG="de_DE.UTF-8"
+ export LANG=de_DE.UTF-8
+ LANG=de_DE.UTF-8
flybyray-pc:~/git$ play1/play deps play1/samples-and-tests/i-am-a-developer/i-am-testing-2073/app2073 --forProd
+ play1/play deps play1/samples-and-tests/i-am-a-developer/i-am-testing-2073/app2073 --forProd
~ _ _
~ _ __ | | __ _ _ _| |
~ | '_ \| |/ _' | || |_|
~ | __/|_|\____|\__ (_)
~ |_| |__/
~
~ play! master-9db5269, https://www.playframework.com
~
~ Resolving dependencies using /home/flybyray/git/play1/samples-and-tests/i-am-a-developer/i-am-testing-2073/app2073/conf/dependencies.yml,
~
~ play.test.modules->mod2073 0.1 (from playLocalTestModulesRep)
~
~ Some dynamic revisions have been resolved as following,
~
~ play.test.modules->mod2073 latest.integration will use version 0.1
~
~ Installing resolved dependencies,
~
~ modules/mod2073 -> /home/flybyray/git/play1/samples-and-tests/i-am-a-developer/i-am-testing-2073/mod2073
~
~ Done!
~
flybyray-pc:~/git$ unset LANG
+ unset LANG
flybyray-pc:~/git$ play1/play deps play1/samples-and-tests/i-am-a-developer/i-am-testing-2073/app2073 --forProd
+ play1/play deps play1/samples-and-tests/i-am-a-developer/i-am-testing-2073/app2073 --forProd
~ _ _
~ _ __ | | __ _ _ _| |
~ | '_ \| |/ _' | || |_|
~ | __/|_|\____|\__ (_)
~ |_| |__/
~
~ play! master-9db5269, https://www.playframework.com
~
~ Resolving dependencies using /home/flybyray/git/play1/samples-and-tests/i-am-a-developer/i-am-testing-2073/app2073/conf/dependencies.yml,
~
~ play.test.modules->mod2073 0.1 (from playLocalTestModulesRep)
~
~ Some dynamic revisions have been resolved as following,
~
~ play.test.modules->mod2073 latest.integration will use version 0.1
~
~ Installing resolved dependencies,
~
~ Error installing /home/flybyray/git/play1/samples-and-tests/i-am-a-developer/i-am-testing-2073/mod2073
Exception in thread "main" play.exceptions.UnexpectedException: Unexpected Error
at play.libs.IO.copyDirectory(IO.java:246)
at play.libs.IO.copyDirectory(IO.java:240)
at play.libs.IO.copyDirectory(IO.java:240)
at play.libs.IO.copyDirectory(IO.java:240)
at play.deps.DependenciesManager.install(DependenciesManager.java:275)
at play.deps.DependenciesManager.retrieve(DependenciesManager.java:233)
at play.deps.DependenciesManager.main(DependenciesManager.java:42)
Caused by: java.io.FileNotFoundException: /home/flybyray/git/play1/samples-and-tests/i-am-a-developer/i-am-testing-2073/mod2073/public/Unterlagen BBank-Reporting/Anhang Performance-Bericht_ ??bersicht ??18 Bundesbank gesetz Meldepflichten.PDF (No such file or directory)
at java.io.FileInputStream.open0(Native Method)
at java.io.FileInputStream.open(FileInputStream.java:195)
at java.io.FileInputStream.<init>(FileInputStream.java:138)
at play.libs.IO.copyDirectory(IO.java:244)
... 6 more
@asolntsev the interesting part is with the FIles.walkFileTree this error does not occur
https://gist.github.com/flybyray/659a1b8ad14e69a72415f869b1b91619#file-io-java-L244