Norm's Java Tools

Check class references | Check classpath | Find Class | Compare Folders | HTTP Server

 


Class file references checker


This program will search either the classpath as set in the invoking command or a jar file for all the classes referenced by a selected class. Its documentation is included in the jar file.

On Win95 I've set Windows Explorer's View|Options...|File Types for .class and .jar to call this program via the right-click menu for Action: Check References. The Application used to perform action:'s are:
For .class
java.exe -cp <path>CheckClassRefs.jar;. CheckClassRefs "%1"
For .jar:
java.exe -cp <path>CheckClassRefs.jar;. CheckClassRefs -jar "%1"

 


Check classpath


This program will read a class file and display its package.class and then use the current CLASSPATH settings to check if it is reachable. It is executed from a batch file that captures the CLASSPATH environment variable setting and passes it to the program via its -CP option. Open the jar file with WinZip and extract the CkCP.bat file and tailor it to your environment.

On Win95 I've set Windows Explorer's View|Options...|File Types for .class to call this batch file via the right-click menu for Action: Check Classpath. The Application used to perform action:'s is:
CkCP.bat "%1"

 


Find class


This program will search your classpath for a user entered class or package. It can be executed from a batch file that captures the CLASSPATH environment variable setting and passes it to the program via its -CP option. Open the jar file with WinZip and extract the FindClass.bat file and tailor it to your environment.

 


Get URL text


This program will send a HTTP request to a server and display the results. It will do either a GET or POST and will also send Cookies. It uses either the URLConnection class or a Socket.

 


Display HTML help files from jar


This jar file contains the programs used by my other Tools to display their help files. Its documentation is included in the jar file.

On Win95 I've set Windows Explorer's View|Options...|File Types for .html files to call this program via the right-click menu for Action: Show Document. The Application used to perform action:'s are:
For java 2:
java.exe -jar <path>DocumentViewerWParser.jar "%1"
For java1.1:
java.exe -cp <path>DocumentViewerWParser.jar NormsTools.DocumentViewer.ShowDocument "%1"

 


Save STDOUT and STDERR in a disk file


This class is useful when you need to save output written to the DOS Console. It sets an intercept for the STDOUT (System.out) and STDERR (System.err) output streams and writes them to a disk file.
Usage:

              NormsTools.SaveStdOutput.start("fileToSaveIn"); // start saving
              NormsTools.SaveStdOutput.start(<anOutputStream>); // another way
              NormsTools.SaveStdOutput.start(<anOutputStream>, false); // don't echo
                ...
              NormsTools.SaveStdOutput.stop();  // stop saving
		

Used with the ByteArrayOutput class, this can be used to capture output and display it in a program.
The source and class files are in this jar file.

 


Compare folders and copy files


This program will compare the contents of two folders and subfolders and display the results. It has filtering capability to select files based on their extensions and date. Yes, that's already done by other programs. However, after doing the compare, you can select files from the display and copy them to a target folder preserving the folder hierarchy. I use it to make a daily back up of the files that I change every day. I only have to copy the files that were changed. It uses XCOPY.exe to do the copy.

 


Self Installer

The InstallInstaller.exe program will install the Installer program on your system. This program extracts a jar file from its .exe file and executes the JVIEW command to invoke the Install program which installs the program components in the current directory.
It allows you to package a Java program and install it on a client's disk.
There are three steps in building an Installxxxx.exe file:

  • Modify the MakeInstallxxx.bat file to have it include all your program's components. Be sure to have it include the Installer's components. Sample is included in download.
  • Modify the Installer.properties. This contains instructions on where files are to be extracted to.
  • Run the MakeInstallxxx.bat file to create the Installxxx.exe file.

You can read the documentation that comes with it.

How it works:

There is a small c program that is appended with a jar file as the last step of the MakeInstallxxx.bat file. This program reads itself, copy/extracts the jar file that was appended to it into a jar file: Installyyyymmddhh.jar and then invokes the command: 

JVIEW -cp Installyyyymmddhh.jar NormsTools.Installer.Install

to do the install. If there's a problem with JVIEW, you can enter the commandline using the Java command instead.

 


HTTP Server


This program is a HTTP Server for playing with. I found it to be a very useful tool for learning about servers and browsers.

 


Source for miscellaneous utility


Here's the source for most of the miscellaneous utility classes I've written such as MessageBox or BigTextArea. Most of them are in a state of development. I add features to them when I find a need, or as I find new ways to do something.
Feedback with improvements will be very welcome.


 



     If you have any comments or good advice, email me at: radder@hotmail.com.    


Date last modified: 21 June 2008