co.cask.common
Class DirUtils

java.lang.Object
  extended by co.cask.common.DirUtils

public final class DirUtils
extends Object

Copied from Google Guava as these methods are now deprecated.


Method Summary
static File createTempDir(File baseDir)
          Creates a temp directory inside the given base directory.
static void deleteDirectoryContents(File directory)
          Wipes out all the a directory starting from a given directory.
static boolean mkdirs(File dir)
          Creates a directory if the directory doesn't exists.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

deleteDirectoryContents

public static void deleteDirectoryContents(File directory)
                                    throws IOException
Wipes out all the a directory starting from a given directory.

Parameters:
directory - to be cleaned
Throws:
IOException

createTempDir

public static File createTempDir(File baseDir)
Creates a temp directory inside the given base directory.

Returns:
the newly-created directory
Throws:
IllegalStateException - if the directory could not be created

mkdirs

public static boolean mkdirs(File dir)
Creates a directory if the directory doesn't exists.

Parameters:
dir - The directory to create
Returns:
true if the directory exists or successfully created the directory.


Copyright © 2015 Cask Data, Inc. Licensed under the Apache License, Version 2.0.