The FileListRenderer class renders any field for File objects (directories and files) in a FileListElement.
The FileListRenderer class offers methods that allow you to perform the following actions:
This example creates an FileListElement object with a renderer:
// Create a FileListElement. FileListElement fileList = new FileListElement(sys, httpservletrequest); // Set the renderer specific to this servlet, which extends // FileListRenderer and overrides applicable methods. fileList.setRenderer(new myFileListRenderer(request));
If you don't want to use the default renderer, you can extend FileListRenderer and override methods or create new ones. For example, you might want to ensure that you prevent passing the names of specific directories or files with certain extensions to the FileListElement. By extending the class and overriding the appropriate method, you can return null for these files and directories, ensuring that they are not displayed.
To fully customize the rows within a FileListElement, use the getRowData() method. An example of customizing row data using getRowData() might be adding a column to the row data or rearranging the columns. When the default behavior of FileListRenderer is satisfactory, you need no additional programming because the FileListElement class creates a default FileListRenderer.