Does the user had the right access to get the file? Maybe you should check your security settings (app & module security) and the accesrules?
Where is the file location? If you've deployed the application to somewhere like the Mendix Cloud, the file will need to be in the resources folder of your application if you want to access it from Java.
Good luck!