Class FileTools

java.lang.Object
org.daisy.braille.tools.FileTools

public class FileTools extends Object
Provides common file tools useful for braille.
Author:
Joel HÃ¥kansson
  • Constructor Details

    • FileTools

      public FileTools()
  • Method Details

    • copy

      public static void copy(InputStream is, OutputStream os) throws IOException
      Copies an input stream to an output stream
      Parameters:
      is - the input stream
      os - the output stream
      Throws:
      IOException - if IO fails
    • listFiles

      public static File[] listFiles(File dir, String ext)
      Lists files in a directory with a given extension.
      Parameters:
      dir - the directory to list files in
      ext - the extension to test
      Returns:
      returns an array of files with the specified extension
    • toURL

      public static URL[] toURL(File[] files)
      Converts an array of File objects into URL's
      Parameters:
      files - the files to convert
      Returns:
      returns an array of URL's