Class FileUtils

java.lang.Object
org.apache.tomcat.util.http.fileupload.FileUtils

public class FileUtils extends Object
General file manipulation utilities.

Facilities are provided in the following areas:

  • writing to a file
  • reading from a file
  • make a directory including parent directories
  • copying files and directories
  • deleting files and directories
  • converting to and from a URL
  • listing files and directories by filter and extension
  • comparing file content
  • file last changed date
  • calculating a checksum

Note that a specific charset should be specified whenever possible. Relying on the platform default means that the code is Locale-dependent. Only use the default if the files are known to always use the platform default.

Origin of code: Excalibur, Alexandria, Commons-Utils