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

build tests fail if project path has a space #25

Closed
THausherr opened this issue Jun 2, 2017 · 0 comments
Closed

build tests fail if project path has a space #25

THausherr opened this issue Jun 2, 2017 · 0 comments

Comments

@THausherr
Copy link

I wanted to do a local build to test the snapshot with my test sets from work and from home. It worked fine at work but not at home. At home the tests fail at BitmapsChecksumTest.test() at this line

final InputStream inputStream = new FileInputStream(new File(imageUrl.getPath()));

java.io.FileNotFoundException: .....%20....\LevigoJBig2ImageIO\target\test-classes\images\042_1.jb2 (Das System kann den angegebenen Pfad nicht finden)
at java.io.FileInputStream.open0(Native Method)
at java.io.FileInputStream.open(FileInputStream.java:195)
at java.io.FileInputStream.(FileInputStream.java:138)
at com.levigo.jbig2.image.BitmapsChecksumTest.test(BitmapsChecksumTest.java:127)

The reason is that my path has a space. This space is converted to "%20" which doesn't work.

Solutions:

final InputStream inputStream = new FileInputStream(new File(imageUrl.ToURI));

even better:

final InputStream inputStream = imageUrl.openStream();

ultimate:

final InputStream inputStream = JBIG2ImageReaderDemo.class.getResourceAsStream(resourcePath);

hennejg added a commit that referenced this issue Aug 18, 2017
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

1 participant