Skip to content
himanshuseth edited this page Feb 25, 2012 · 8 revisions

File Viewer Grails Plugin

File Viewer Grails plugin provides a user friendly way for viewing folders and files on the system. The most common use-case is to see the logs on the server.

Usage Information

  1. Install plugin :
   grails install-plugin file-viewer
  1. Configure: The plugin reads the following properties :
        grails {
                 fileViewer {
                                 locations = ['/var/lib/tomcat6/logs', '/var/lib/tomcat6/log']
                                 linesCount = 200
                                 areDoubleDotsAllowedInFilePath = false
                 }
       }
  * **locations** specifies a list of all file-system locations that the plugin should read. Note that the application must have the permission to read from that file system location or you may get a 'Permission Denied Exception'
  * **linesCount** specifies the number of lines that are to be displayed from the end of the file. The default value is 300
  * **areDoubleDotsAllowedInFilePath** allows/disallows the use of '..' in filePaths when accessing locations. That is, should http://localhost:8080/sampleApp/file/index?filePath=/var/lib/tomcat6/logs/../../ be allowed or not. The default value is false since allowing this can give a full(read-only) access of the entire file system
  1. Now run the application and visit ${application-url}/file/index to see the list of all the paths that were specified in Config.groovy

The sample-application can be found at : http://github.com/IntelliGrape/File-Viewer-Grails-Plugin-Sample-App

Features

  • view folders and files(logs) on server without logging into the server
  • Mainly for admin purposes
  • The plugin shows the contents of the files(treating it as ASCII file) and by default shows the last 300 lines of the file (configurable).
  • Allows Users to mention a list of folders/files
  • Also shows sub-folders/sub-files for all paths provided in config

Question

  • For any questions please use the Mailing List

ChangeLog

We can add a manually maintained file that is updated each time we release a new version

Clone this wiki locally