O'Reilly logo

Just Java™ 2 by Peter van der Linden

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The Class java.io.File

The class java.io.File should really be called “Filename” since most of its methods are concerned with querying and adjusting filename, and pathname information, not the contents of a file. File can't actually do any I/O. Directory, filename and pathname information is often called “metadata,” meaning “data about data.” Methods of java.io.File allow you to access metadata to:

  • Return a File object from a String containing a pathname

  • Test whether a file exists, is readable/writable, or is a directory

  • Say how many bytes are in the file and when it was last modified

  • Delete the file, or create directory paths

  • Get various forms of the file pathname.

Here are all the important public members of java.io.File. Method ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required