Java Directory Tree Walker Sample

(with NSAPI on Netscape Enterprise Server)


 

This sample, given a directory, will print out a list of the files with their attributes. It will also do the same for the subdirectories.

This file contains instructions for running this sample with the Netscape Enterprise Server. For instructions on running the sample with either the Microsoft Internet Information Server or the Microsoft Personal Web Server, please refer to the file IDir_Walker.html. This file will only provide the instructions to run this sample. For a more detailed explanation of the components, please refer to the file NetscapeInstall.html.

Click here for installation instructions.


 

Directory Submission Form using the POST method

(Before submitting this form, you must modify the classpath field. Click here for instructions. )

Please enter the name of the directory whose files and their attributes you want to be listed.

Directory:

For example: d:\test


 

Directory Submission Form using the GET method

(Before submitting this form, you must modify the classpath field. Click here for instructions. )

Please enter the name of the directory whose files and their attributes you want to be listed.

Directory:

For example: d:\test



 

Installation Instructions

To run this sample on your machine, you will need to install the following components:

 

Server Side Instructions
 

To configure the Netscape Enterprise Server

  1. Go to your \Netscape\Server\docs directory
  2. Create a file named service.wjava and add these statements to it:
        <HTML>
        <HEAD>
        <TITLE>Optima++ Java Netscape Service Placeholder</TITLE>
        </HEAD>
        <BODY>
        <BLOCKQUOTE>
        <FONT SIZE=+3>P</FONT><FONT SIZE=+1>laceholder for Optima++ Java
        support. If you see this file on your browser, you have not installed
        or setup the JAVANSAPI.DLL properly.
        </BODY>
        </HTML> 
  3. Save service.wjava and close the file
  4. Go to your \Netscape\Server\https-serverName\config directory, where serverName is the name of your Netscape Enterprise Server.
        For example: d:\Netscape\Server\https-mnguyen\config 
  5. Open the file obj.conf.
  6. Add this line after the last Init fn= statement (all on 1 line, without newlines):
        Init fn="load-modules" shlib="%Starbuck%/system/javansapi.dll"
        funcs="wjava-fn,wjava-ntrans"
            where %Starbuck% is the directory where Starbuck is installed
    
        For example:
            Init fn="load-modules" shlib="d:/starbuck20/system/javansapi.dll"
            funcs="wjava-fn,wjava-ntrans" 
  7.  Add this line after the <Object name="default"> statement:
        NameTrans fn=wjava-ntrans 
  8. Add these lines after </Object> statement that closes the <Object name="default">
    section:
        <Object name=wjava>
        Service fn=wjava-fn
        </Object> 
  9. Save obj.conf and restart your Netscape Enterprise Server

 

To modify the classpath form field

The classpath field is the path to the Java class files for this sample. If you run this sample from Starbuck, Starbuck will copy the class files and this html file to your \Netscape\Server\docs\NDir_Walker directory. From your HTML editor, modify the classpath field to point to your \Netscape\Server\docs\NDir_Walker directory

 

 

Client Side Instructions

To run this sample from Starbuck

  1. Start the Netscape Enterprise Server
  2. Start Starbuck
  3. Open this sample project: IDir_Walker.wxp
  4. From the View menu of the main Starbuck menu bar, click Targets
  5. In the Targets window, use the right button to click on NDir_WalkerWebApp. Then choose Run Options
  6. On the General page, click Publish, then run a web browser
  7. Click Configure and choose your Web browser
  8. Click on the Initial URL for the browser box and type the following URL:
        http://localhost/NDir_Walker/NDir_Walker.html 
  9. Click OK
  10. Click the Publish tab. On the Publish page, click Copy the files to a folder
  11. Click in the Folder box and type the path to your \Netscape\Server\docs\NDir_Walker directory
        For example: D:\Netscape\Server\docs\NDir_Walker\
  12. Click OK to finish
  13. To run this sample, from the Run menu of the main Starbuck menu bar, click Run
  14. In the Default Program window, click on NDir_WalkerWebApp and click OK
  15. Wait for your Web browser to load this file
  16. In the Directory Submission Form, click on the Directory box and then type the directory name whose files you want to view
  17. Click on View Files to view the file attribute listing for this directory.

 

To run this sample from outside Starbuck

  1. Make sure that this html file and the class files for this project are copied to your \Netscape\Server\docs\NDir_Walker directory. The class files for this project are located in \%Starbuck%\samples\IDir_Walker\Debug directory, where %Starbuck% is the directory where you installed Starbuck
  2. Start the Netscape Enterprise Server
  3. Start your Web browser and type in the following URL:
        http://localhost/NDir_Walker/NDir_Walker.html 
  4. In the Directory Submission Form, click on the Directory box and then type the directory name whose files you want to view
  5. Click on View Files.