Skip to content

Instantly share code, notes, and snippets.

@arnobroekhof
Last active August 29, 2015 14:13
Show Gist options
  • Select an option

  • Save arnobroekhof/bf8980863276ecc16ee0 to your computer and use it in GitHub Desktop.

Select an option

Save arnobroekhof/bf8980863276ecc16ee0 to your computer and use it in GitHub Desktop.
package nl.techop.AccountControl.utils
/**
* @author arnobroekhof
*
*/
class FileContentUtils {
/**
* Return the content of the given file
* @param location of the file
* @return the content of the given file as String
* @see String
*/
def static String getText(String file) {
File fileLocation = new File(file)
if (fileLocation.exists() || fileLocation.canRead()) {
return fileLocation.getText()
} else {
throw new Exception()
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment