File Can be accessed fwhile running jnlp but cannot be accessed through browser in java web start
I'm trying to access a resource file which is in a jar file deployed in apache web server
.
The file can be accessed through the jnlp file in the deployed folder while but it is not available through the web start while trying to access from a browser.
The code 开发者_如何学JAVAused to access the file using the uri is something like below :
File helpFile = new File("/myFile.doc");
myFile
is in the application jar
deployed in the server.
A JNLP application is running locally on your machine so it will have 'file' access to the Apache web server. You have to access it with HttpURLConnection or any of the RESTful client API.
Furthermore, to access file locally on your server, you have to use the FileOpenService not File.
精彩评论