Skip to content

Instantly share code, notes, and snippets.

@rmorenobello
Last active August 29, 2015 14:16
Show Gist options
  • Save rmorenobello/bd307d0334a54d9178f1 to your computer and use it in GitHub Desktop.
Save rmorenobello/bd307d0334a54d9178f1 to your computer and use it in GitHub Desktop.
// Tutorial on File: http://tutorials.jenkov.com/java-io/file.html
def getFileWithPath = { rutaCarpeta, nom ->
def homePath = System.getProperty('user.home').replace('\\','/')
println "home Path: " + homePath
def directory = new File(homePath.concat("/${rutaCarpeta}/"))
if(!directory.exists()){
boolean dirCreated = directory.mkdirs()
assert dirCreated
}
assert directory.exists()
def file = new File(directory,"${nom}")
assert file.exists()
return file
// new File(System.getProperty('user.home').replace('\\','/').concat("/CircuitCatalunyaF1_tests/${nom}"))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment