Build a directory path - creating directories if neccesary : Path « File Input Output « Java
- Java
- File Input Output
- Path
Build a directory path - creating directories if neccesary
import java.io.File;
import java.io.IOException;
public class Utils {
/**
* Build a directory path - creating directories if neccesary
*
* @param file
* @return true if the directory exists, or making it was successful
*/
public static boolean buildDirectory(File file) {
return file.exists() || file.mkdirs();
}
}
Related examples in the same category