|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.as400.util.html.FileListElement
The FileListElement class represents the contents of an Integrated File System directory.
This example creates an FileListElement object:
// Create a HTMLTree object. HTMLTree tree = new HTMLTree(req);Once the contents are listed and a user traverses the HTML tree down to /QIBM/ProdData/Http/Public/ and clicks on the jt400 directory link, the FileListElement will look something like the following:// Create a URLParser object. URLParser urlParser = new URLParser(httpServletRequest.getRequestURI());
// Create an AS400 object. AS400 system = new AS400(mySystem, myUserId, myPassword);
// Create an IFS object. IFSJavaFile root = new IFSJavaFile(system, "/QIBM");
// Create a DirFilter object and get the directories. DirFilter filter = new DirFilter(); File[] dirList = root.listFiles(filter);
for (int i=0; i < dirList.length; i++) {
// Create a FileTreeElement. FileTreeElement element = new FileTreeElement(dirList[i]);
// Set the Icon URL. ServletHyperlink sl = new ServletHyperlink(urlParser.getURI()); sl.setHttpServletResponse(resp); element.setIconUrl(sl);
// Set the text url so it calls another // servlet to display the contents of the FileTreeElement. ServletHyperlink tl = new ServletHyperlink("/servlet/myListServlet"); tl.setTarget("listFrame");
// Set the TextUrl for the FileTreeElement. element.setTextUrl(tl);
// Add the FileTreeElement to the tree. tree.addElement(element); }
// When the user clicks on text url in the HTMLTree it should call another // servlet to display the contents. It is here that the FileListElement // will be created. AS400 sys = new AS400(mySystem, myUserId, myPassword);
// The FileTreeElment will properly create the text url and pass the // file and path information through the httpservletrequest. FileListElement fileList = new FileListElement(sys, httpservletrequest);
// Output the content of the FileListElement. out.println(fileList.list());
Name | Size | Type | Modified |
---|---|---|---|
../ (Parent Directory) | |||
com | Directory | 06/09/2000 11:00:46 | |
lib | Directory | 09/11/2000 10:32:24 | |
MRI2924 | Directory | 06/09/2000 11:03:12 | |
SSL128 | Directory | 09/22/2000 10:46:29 | |
SSL56 | Directory | 09/22/2000 10:43:52 | |
utilities | Directory | 06/09/2000 11:01:58 | |
ACCESS.LST | 15950 | File | 06/29/2000 06:26:25 |
ACCESS.LVL | 23 | File | 06/29/2000 06:26:09 |
CKSETUP.INI | 88 | File | 06/29/2000 06:26:21 |
GTXSETUP.ini | 102 | File | 05/16/2000 05:51:46 |
JT400.PKG | 19 | File | 09/08/1999 04:25:51 |
OPNAV.LST | 16827 | File | 09/08/1999 04:26:08 |
OPNAV.LVL | 19 | File | 05/16/2000 05:51:31 |
OPV4R5M0.LST | 24121 | File | 09/08/1999 04:26:14 |
OPV4R5M01.LST | 104 | File | 05/16/2000 05:51:46 |
PROXY.LST | 4636 | File | 09/08/1999 04:26:00 |
PROXY.LVL | 29 | File | 06/29/2000 06:26:26 |
PXV4R5M0.LST | 7101 | File | 09/08/1999 04:25:58 |
PXV4R5M01.LST | 38 | File | 06/29/2000 06:27:46 |
QSF631215769JC10004R05M00505000000005 | 4518 | File | 05/10/2000 10:35:10 |
QSF631215769JC10004R05M00505000000006 | 20 | File | 05/10/2000 10:35:00 |
QSF631215769JC10004R05M00505000000007 | 15 | File | 05/10/2000 10:35:19 |
QSF631215769JC10004R05M00505000000008 | 15950 | File | 05/10/2000 10:34:57 |
QSF631215769JC10004R05M00505000000009 | 38 | File | 05/10/2000 10:35:13 |
QSF631215769JC10004R05M00505000000010 | 38586 | File | 05/10/2000 10:35:06 |
QSF631215769JC10004R05M00505000000011 | 33 | File | 05/10/2000 10:35:09 |
QSF631215769JC10004R05M00505000000013 | 88 | File | 05/10/2000 10:35:03 |
READMEGT.TXT | 3480 | File | 05/16/2000 05:52:27 |
READMESP.TXT | 5161 | File | 06/29/2000 06:26:14 |
V4R5M0.LST | 38586 | File | 06/29/2000 06:26:19 |
V4R5M01.LST | 33 | File | 06/29/2000 06:26:33 |
V4R5M02.LST | 33 | File | 06/29/2000 06:26:26 |
FileTreeElement objects generate the following events:
DirFilter
, Serialized FormConstructor Summary | |
FileListElement()
Constructs a default FileTreeElement object. |
|
FileListElement(AS400 system,
javax.servlet.http.HttpServletRequest request)
Constructs an FileTreeElement with the specified system, and request. |
|
FileListElement(AS400 system,
javax.servlet.http.HttpServletRequest request,
HTMLTable table)
Constructs an FileTreeElement with the specified system, request, and table. |
Method Summary | |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds a PropertyChangeListener. |
javax.servlet.http.HttpServletRequest |
getHttpServletRequest()
Returns the Http servlet request. |
FileListRenderer |
getRenderer()
Return the file list renderer. |
AS400 |
getSystem()
Returns the AS/400 system. |
HTMLTable |
getTable()
Returns the HTMLTable. |
java.lang.String |
list()
Returns a string containing the list of files and directories in the path defined in the HttpServletRequest. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes the PropertyChangeListener from the internal list. |
void |
setHttpServletRequest(javax.servlet.http.HttpServletRequest request)
Sets the Http servlet request for the element. |
void |
setRenderer(FileListRenderer renderer)
Set the renderer for the FileListElement. |
void |
setSystem(AS400 system)
Set the AS/400 system. |
void |
setTable(HTMLTable table)
Set the HTMLTable to use when displaying the file list. |
void |
sort(boolean sort)
Sorts the list elements. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public FileListElement()
public FileListElement(AS400 system, javax.servlet.http.HttpServletRequest request)
system
- The AS/400 system.request
- The Http servlet request.public FileListElement(AS400 system, javax.servlet.http.HttpServletRequest request, HTMLTable table)
system
- The AS/400 system.request
- The Http servlet request.table
- The HTML table.Method Detail |
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- The PropertyChangeListener.removePropertyChangeListener(java.beans.PropertyChangeListener)
public javax.servlet.http.HttpServletRequest getHttpServletRequest()
public FileListRenderer getRenderer()
public AS400 getSystem()
public HTMLTable getTable()
public java.lang.String list()
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- The PropertyChangeListener.addPropertyChangeListener(java.beans.PropertyChangeListener)
public void setHttpServletRequest(javax.servlet.http.HttpServletRequest request)
request
- The Http servlet request.public void setRenderer(FileListRenderer renderer)
renderer
- The file list renderer.public void setSystem(AS400 system)
The
- system.public void setTable(HTMLTable table)
table
- The HTML table.public void sort(boolean sort)
sort
- true if the elements are sorted; false otherwise.
The default is true.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |