Last active
August 29, 2015 14:13
-
-
Save arnobroekhof/bf8980863276ecc16ee0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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