|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.as400.util.html.FileListRenderer
The FileListRenderer class renders the name field for directories and files in a FileListElement. If the behavior of the default FileListRenderer is not desired, subclass FileListRenderer and override the appropriate methods until the FileListElement achieves the desired behavior. Subclassing FileListRenderer will allow your servlet to include/exclude or change the action of any directory or file in the FileListElement. For example, if a servlet did not want users to see any *.exe files, A subclass of FileListRenderer would be created and the new class would override the getFileName() method to figure out if the File object passed to it was a *.exe file, if it is, null could be returned, which would indicate that the file should not be displayed.
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));
Constructor Summary | |
FileListRenderer(javax.servlet.http.HttpServletRequest request)
Constructs a FileListRenderer with the specified request. |
Method Summary | |
java.lang.String |
getDirectoryName(java.io.File file)
Return the directory name string. |
java.lang.String |
getFileName(java.io.File file)
Return the file name string. |
java.lang.String |
getParentName(java.io.File file)
Return the parent directory name string. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public FileListRenderer(javax.servlet.http.HttpServletRequest request)
request
- The Http servlet request.Method Detail |
public java.lang.String getDirectoryName(java.io.File file)
public java.lang.String getFileName(java.io.File file)
public java.lang.String getParentName(java.io.File file)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |