Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

Java webstart: jnlp file not quite calling JAR as desired

$
0
0
Hi dreamincode! I've been making a simple program in Java using JMonkey (which is pretty much like NetBeans), and plan to put it up on y site, http://www.gfcf14greendream.com/ . The thing is, I'm not too happy with giving away JARS, so I made the project into a webstart and uploaded both the JAR and JNLP files using FileZilla (of course the webstart was set up so that an instance of the jnlp file calls the jar from my site). I download the JNLP and run it, and it calls the JAR properly, but I've noticed that it only happens when the JAR's permissions are "Read". Meaning that anyone could download it, which I would not prefer. Is there any way to set up the JNLP to call the JAR, but ONLY from there, so that no one who knows/learns the address of it online can download it? If I just remove reading privileges on the jar, I get this, while running the JNLP:

java.io.IOException: Server returned HTTP response code: 403 for URL: http://www.gfcf14greendream.com/...


And I've noticed that I'm unable to save/overwrite a txt file with FileReader. As I try it reading the JAR from my site, I get this:

java.security.AccessControlException: access denied ("java.io.FilePermission" "applications.txt" "write")


I'm guessing both problems are similar, but in any case. Is there a way to save such txt file to the address from where the downloaded JNLP is called? Say if the JNLP is at C:/Users/anuser/Downloads , then the text file would be saved to that address, is that possible? I could always warn that the saved files would be saved to a folder in C:/ , but can this actually be done? And how would I be able to change the JNLP file's name, so that it doesn't just say launch? Any help for any of these questions is greatly appreciated. I hope everyone has a happy New Year!!

Viewing all articles
Browse latest Browse all 51036

Trending Articles