• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Signed Applet writing to file

 
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I know that the signed applet is working properly as I can do an exec and copy a local file to lpt1. However, when I go to create the file, nothing happens - no security exception, no ioexception. No value in tmp. Probably a dumb mistake, but I'm not too proud to admit it...

String tmp=new String();
// Create temp file for writing print command to file
File temp = new File("c:/temp", "print.tmp");
boolean success = temp.createNewFile();
if (success) {
// File did not exist and was created
tmp="new file created";
} else {
// File already exists
tmp="file already exists";
}

// Write to file
BufferedWriter out = new BufferedWriter(new FileWriter(temp));
out.write("aString");
out.flush();
out.close();
 
Paul Smiley
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ignore this topic. I had a shadow jar file that my html page was looking at. All is good now.

 
Water! People swim in water! Even tiny ads swim in water:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic