Skip to content

Instantly share code, notes, and snippets.

@ldacosta
Last active August 29, 2015 14:00
Show Gist options
  • Save ldacosta/11183671 to your computer and use it in GitHub Desktop.
Save ldacosta/11183671 to your computer and use it in GitHub Desktop.
def prepareDiskFor(profileFileName: String): Boolean = {
// create directory if it doesn't exist
val theDir: File = Utils.getFolderFromFileName(profileFileName)
if (!theDir.exists() && !theDir.mkdirs()) {
error("Impossible to save profile because directory [%s] does not exist nor can I create it".format(theDir.getAbsolutePath))
false
} else {
true
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment