Chapter 9. Working with Directories and Files


9. Working with Directories and Files

A common task in most Java applications is working with the file system, which includes directories and files. In this chapter, we present phrases to help you work with files and directories in Java.

The main class we will use in this chapter is the java.io.File class. This class allows you to list, create, rename, and delete files, as well as work with directories.

Many of the phrases in this chapter have the possibility of throwing a SecurityException. In Java, the file system is protected by the Security Manager. For some applications, you might need to use a custom implementation of the Security Manager. Applets are the most restricted types of Java applications in terms of being able to access files and directories on the user's local machine. By taking advantage of the Security Manager and the related Security Policy Framework you can achieve fine-grained control over file and directory access. For more information about the security options available through Java, refer to the security documentation available on the official Java site:

http://java.sun.com/javase/technologies/security.jsp

For more information about the Security Manager, see the following tutorial available from Sun:

http://java.sun.com/docs/books/tutorial/essential/system/securityIntro.html




JavaT Phrasebook. Essential Code and Commands
Java Phrasebook
ISBN: 0672329077
EAN: 2147483647
Year: 2004
Pages: 166

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net