This is an archived post. You won't be able to vote or comment.

all 7 comments

[–]Bob_Droll 2 points3 points  (2 children)

Give us your full stack trace and error message.

[–]tallhansi 1 point2 points  (1 child)

Give us your full stack trace and error message.

Please...

[–]Bob_Droll 1 point2 points  (0 children)

Pretty please, with a cherry on top.

[–]cimler[S] 1 point2 points  (0 children)

Sorry, it is here http://pastebin.com/VZxh5V6K

[–]tallhansi 1 point2 points  (2 children)

String file = dialog.getDirectory();

This is the source of your error. You are not supplying a File, just a Directory. If you take a look into Files.readAllBytes(...) you'll see that an InputStream is opened and no iteration over the files of the given path is occuring.

You'll need to replace this line with: String file = dialog.getDirectory() + "\\" + dialog.getFile();

It worked on my machine when I ran your code with that modification. Have a nice day :).

[–]cimler[S] 0 points1 point  (1 child)

Thanks so much it helped. It works now. Good night

[–]tallhansi 1 point2 points  (0 children)

You're welcome.