public class FileSystem extends Object
Constructor and Description |
---|
FileSystem() |
Modifier and Type | Method and Description |
---|---|
static void |
destroy(File file,
boolean proceed)
Remove this completely.
|
private static void |
destroyDir(File dir,
Collection errors)
Perform the recursion for
destroy . |
static void |
ensureDir(String path)
Ensure that the given path is a directory, creating it if
necessary.
|
private static void |
handleError(Collection errors,
File path)
Handle an error, either by adding to the list, or if there is no
list, throwing an
IOException . |
public static void destroy(File file, boolean proceed) throws IOException
destroy
simply returns.proceed
- Proceed in the face of errors; otherwise the first error stops
the execution of the method.IOException
- The list of files that couldn't be removed (in the detail string).private static void destroyDir(File dir, Collection errors) throws IOException
destroy
.IOException
private static void handleError(Collection errors, File path) throws IOException
IOException
.IOException
public static void ensureDir(String path) throws IllegalArgumentException
File.mkdirs
to create the directory along with any
intermediate paths.IllegalArgumentException
- if the path already exists but is not a
directory, or it does not exist and cannot be created.Copyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.