Package org.daisy.braille.tools
Class FileTools
- java.lang.Object
-
- org.daisy.braille.tools.FileTools
-
public class FileTools extends java.lang.Object
Provides common file tools useful for braille.- Author:
- Joel HÃ¥kansson
-
-
Constructor Summary
Constructors Constructor Description FileTools()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
copy(java.io.InputStream is, java.io.OutputStream os)
Copies an input stream to an output streamstatic java.io.File[]
listFiles(java.io.File dir, java.lang.String ext)
Lists files in a directory with a given extension.static java.net.URL[]
toURL(java.io.File[] files)
Converts an array of File objects into URL's
-
-
-
Method Detail
-
copy
public static void copy(java.io.InputStream is, java.io.OutputStream os) throws java.io.IOException
Copies an input stream to an output stream- Parameters:
is
- the input streamos
- the output stream- Throws:
java.io.IOException
- if IO fails
-
listFiles
public static java.io.File[] listFiles(java.io.File dir, java.lang.String ext)
Lists files in a directory with a given extension.- Parameters:
dir
- the directory to list files inext
- the extension to test- Returns:
- returns an array of files with the specified extension
-
toURL
public static java.net.URL[] toURL(java.io.File[] files)
Converts an array of File objects into URL's- Parameters:
files
- the files to convert- Returns:
- returns an array of URL's
-
-