Skip to Main Content
Hack Proofing Your Web Applications
book

Hack Proofing Your Web Applications

by Syngress
June 2001
Intermediate to advanced content levelIntermediate to advanced
512 pages
18h 49m
English
Syngress
Content preview from Hack Proofing Your Web Applications
278 Chapter 7 • Securing Your Java Code
}
return out.toString();
}
public static void writeFile(String fileName, String contents) {
try {
FileOutputStream fo = new FileOutputStream(fileName);
DataOutputStream dOut = new DataOutputStream(fo);
dOut.writeChars(contents);
dOut.close();
} catch (IOException e) {
System.out.println("Error: " + e);
}
}
}
If we run this class normally, it will attempt to read the data from a
file called test.policy and output the contents to the screen. It will also
create a file called Test.txt and write a small phrase to the file.Try run-
ning this now, just to make sure that it has no problems reading and
writing to the disk. After you ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Developer's Guide to Web Application Security

Developer's Guide to Web Application Security

Michael Cross
The CERT® Oracle® Secure Coding Standard for Java™

The CERT® Oracle® Secure Coding Standard for Java™

Fred Long, Dhruv Mohindra, Robert C. Seacord, Dean F. Sutherland, David Svoboda
Troubleshooting CentOS

Troubleshooting CentOS

Jonathan Hobson

Publisher Resources

ISBN: 9781928994312