Skip to content

Instantly share code, notes, and snippets.

@planetsizebrain
Created September 4, 2016 14:57
Show Gist options
  • Save planetsizebrain/3ae8d1512fbb96bce0d896c0a3559998 to your computer and use it in GitHub Desktop.
Save planetsizebrain/3ae8d1512fbb96bce0d896c0a3559998 to your computer and use it in GitHub Desktop.
A Liferay Groovy script that lists the contents of a file
try {
java.io.File file = new java.io.File("/opt/liferay/portal-ext.properties");
String s = com.liferay.portal.kernel.util.FileUtil.read(file);
out.println(s);
} catch (Exception e) {
out.println(e.getMessage());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment