Java Directory Tree Walker Sample

(with NetImpact Dynamo)


 

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.


 

Installation Instructions

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

 

Server Side Instructions

To configure NetImpact Dynamo via SQL Central

  1. Start SQL Central.
  2. From the Tools menu of the main SQL Central menu bar, click Connect and then choose NetImpact Dynamo to connect to NetImpact Dynamo.
  3. Click in the Connection name box and type
        Dynamo Demo 
  4. From the ODBC data source list, select NetImpact Dynamo Demo
  5. Click in the User ID box and type
        dba 
  6.  Click in the Password box and type
        sql 
  7. Click OK.
  8. If you want this Dynamo Demo to start up every time you load SQL Central, from the Tools menu of the main SQL Central menu bar, click Connection Profiles. Then choose Dynamo Demo from the Connection Profile list. Then click Set Startup. Now, the Use on Startup field should be set to Yes. Click Close to finish. Please note that this won't take effect until you restart SQL Central.
  9. Double click on the Dynamo Demo icon.
  10. Double click on the Site folder, then click on the system folder to go to \Site\system.
  11. Double click on the file autoexec.ssc to open it.
  12. Insert the following statement after the last line of text, but before the line with -->:
        site.AddExtension( 'JAVA_DYNAMO', '%Starbuck%/system/javadynamo.dll' );
            where %Starbuck% is the directory where you installed Starbuck.
            Please note the use of forward slashes in the path.
    
        For example: 
            site.AddExtension( 'JAVA_DYNAMO', 'd:/starbuck20/system/javadynamo.dll' ); 
  13. From the File menu of the editor window for autoexec.ssc, click Save to Database to save
  14. Close autoexec.ssc
  15. In the main SQL Central window, use the right button to click on the autoexec.ssc icon. Then choose Execute to run this script. If there were no errors, the output screen will be blank.
  16. Click on the Site folder to move to \Site.
  17. Double click on the Add Template icon to create a new template
  18. Click in the box for the new template's name and type
        DDir_Walker 
  19. Click Next. Enter a description for this template if you wish, then click Next.
  20. Click Next to not add a SQL statement and then click Finish to accept the default HTML format.
  21. Double click on the template DDir_Walker.stm icon to open it
  22. Insert the following statement after the <H1></H1> line:
        <!--JAVA_DYNAMO
            DDir_Walker
            classpath=$%Starbuck%/samples/DDir_Walker/Debug
            directory_name
        -->
    
        The first line in the script is the name of the Java class with main(),
        in this case DDir_Walker. 
        The second line is the classpath to the Java class files. %Starbuck% refers
        to the directory where Starbuck is installed.
            Please note the use of forward slashes in the path.
        The third line is the name of the directory whose files you would like listed.
    
        For example:
            <!--JAVA_DYNAMO
                DDir_Walker
                classpath=$d:/starbuck20/samples/DDir_Walker/Debug
                d:\testing
            --> 
  23. From the File menu of the editor window for DDir_Walker.stm, click Save to Database to save this template into the database
  24. Close DDir_Walker.stm

 

 

Client Side Instructions

To run this sample from SQL Central

  1. In the main SQL Central window, click on the Site folder to move to \Site.
  2. Use the right button to click on the DDir_Walker.stm icon and choose View Output or Browse Output

 

To run this sample from a browser with Dynamo Personal Web Server

  1. Start the Dynamo Personal Web Server
  2. Start your Web browser and type in the following URL:
        http://localhost/Site/DDir_Walker.stm