Last active
September 4, 2016 14:50
-
-
Save planetsizebrain/871e41b17fe8f0fdd56af2a9e0736f1a to your computer and use it in GitHub Desktop.
Small Liferay Groovy script that lists the contents of a directory
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
import java.io.*; | |
try { | |
File directory = new File("/opt/liferay"); | |
for (File f : directory.listFiles()) { | |
out.println(f.name + " " + f.size()); | |
} | |
} 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