diff --git a/README.TXT b/README.TXT index 07de513..0f744e7 100644 --- a/README.TXT +++ b/README.TXT @@ -1,7 +1,7 @@ README GeekTools Whois Java Client - Version 1.0 + Version 1.0.1 GeekTools Whois Java Client is a finger-style whois which uses the GeekTools Whois Proxy server () provided by CenterGate Research @@ -126,4 +126,4 @@ Similarly, to change the default port from 43 to 46: -Copyright (C) 2000 by SkyTouch Communications. All Rights Reserved. +Copyright (C) 2000-2001 by SkyTouch Communications. All Rights Reserved. diff --git a/Whois.java b/Whois.java index f354033..0ce3104 100644 --- a/Whois.java +++ b/Whois.java @@ -1,17 +1,17 @@ /* - Package: GeekTools Whois Java Client 1.0 + Package: GeekTools Whois Java Client 1.0.1 File: Whois.java (Java source file) Author: Erik C. Thauvin Comments: Part of the GeekTools Whois Java Client package. See the README.TXT file for more information. - Copyright (C) 2000 SkyTouch Communications. All Rights Reserved. + Copyright (C) 2000-2001 SkyTouch Communications. All Rights Reserved. This program is distributed under the terms of the GNU General Public License as published by the Free Software Foundation. See the COPYING.TXT file for more information. - + $Id$ */ @@ -21,16 +21,28 @@ import java.io.*; import java.util.Properties; +/** + * Class Whois + * + * + * @author Erik C. Thauvin (erik@skytouch.com) + * @version 1.0.1 + */ public class Whois { - // The truth is out there! + /** + * Method main + * + * The Truth is Out There! + * + * @param args Command line arguments + */ public static void main(String[] args) { // Display usage if there are no command line arguments if (args.length < 1) { - System.out.println( - "Usage: java Whois query[@]"); + System.out.println("Usage: java Whois query[@]"); return; } @@ -43,8 +55,7 @@ public class Whois // Load the properties file. try { - FileInputStream in = - new FileInputStream("Whois.properties"); + FileInputStream in = new FileInputStream("Whois.properties"); Properties app = new Properties(); app.load(in); @@ -53,11 +64,9 @@ public class Whois server = (app.getProperty("server", server)); // Get the port property - String tmp = app.getProperty("port"); - try { - port = Integer.parseInt(tmp); + port = Integer.parseInt(app.getProperty("port")); } catch (NumberFormatException e) { @@ -72,19 +81,20 @@ public class Whois } catch (IOException e) { - System.err.println( - "Whois: an error occurred while loading the properties file: " - + e); + System.err.println("Whois: an error occurred while loading the properties file: " + e); } // Build the whois query using command line arguments - String query = args[0]; + StringBuffer buff = new StringBuffer(args[0]); for (int i = 1; i < args.length; i++) { - query += (" " + args[i]); + buff.append(" " + args[i]); } + // Convert string buffer to string + String query = buff.toString(); + // The whois server can be specified after "@" // e.g.: query@whois.networksolutions.com int at = query.lastIndexOf("@"); @@ -111,11 +121,8 @@ public class Whois { // Establish connection to whois server & port Socket connection = new Socket(server, port); - PrintStream out = - new PrintStream(connection.getOutputStream()); - BufferedReader in = new BufferedReader( - new InputStreamReader( - connection.getInputStream())); + PrintStream out = new PrintStream(connection.getOutputStream()); + BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream())); String line = ""; // Send the whois query diff --git a/release/1.0.1/Whois-1.0.1.tar.gz b/release/1.0.1/Whois-1.0.1.tar.gz new file mode 100644 index 0000000..9fa6bd8 Binary files /dev/null and b/release/1.0.1/Whois-1.0.1.tar.gz differ diff --git a/release/1.0.1/Whois-1.0.1.zip b/release/1.0.1/Whois-1.0.1.zip new file mode 100644 index 0000000..49e08ec Binary files /dev/null and b/release/1.0.1/Whois-1.0.1.zip differ diff --git a/whois b/whois index 22a02d9..e74b553 100644 --- a/whois +++ b/whois @@ -1,12 +1,12 @@ #!/bin/sh -# Package: GeekTools Whois Java Client 1.0 +# Package: GeekTools Whois Java Client 1.0.1 # File: whois (Bourne shell script) # Author: Erik C. Thauvin # Comments: Part of the GeekTools Whois Java Client package. See # the README.TXT file for more information. # -# Copyright (C) 2000 SkyTouch Communications - All Rights Reserved +# Copyright (C) 2000-2001 SkyTouch Communications - All Rights Reserved # # This program is distributed under the terms of the GNU General # Public License as published by the Free Software Foundation. @@ -26,31 +26,36 @@ then JAVA_EXE=/bin/java if [ "$JAVA_PATH" = "" ] then - # Linux JDK - JAVA_PATH=/usr/java/jdk1.3 + # Linux JDK 1.3.0_01 + JAVA_PATH=/usr/java/jdk1.3.0_01 if [ ! -x ${JAVA_PATH}${JAVA_EXE} ] then - # Linux JRE - JAVA_PATH=/usr/java/jre1.3 + # Linux JDK 1.3 + JAVA_PATH=/usr/java/jdk1.3 if [ ! -x ${JAVA_PATH}${JAVA_EXE} ] then - # Solaris JDK - JAVA_PATH=/usr/j2se + # Linux JRE + JAVA_PATH=/usr/java/jre1.3 if [ ! -x ${JAVA_PATH}${JAVA_EXE} ] then - # Solaris JRE - JAVA_PATH=/usr/j2se/jre + # Solaris JDK + JAVA_PATH=/usr/j2se if [ ! -x ${JAVA_PATH}${JAVA_EXE} ] then - # Mac OS X - JAVA_PATH= - JAVA_EXE=/System/Library/Frameworks/JavaVM.framework/Versions/1.2/Commands/java - if [ ! -x ${JAVA_EXE} ] + # Solaris JRE + JAVA_PATH=/usr/j2se/jre + if [ ! -x ${JAVA_PATH}${JAVA_EXE} ] then - JAVA_EXE=`which java` - if [ ! -x $JAVA_EXE ] + # Mac OS X + JAVA_PATH= + JAVA_EXE=/System/Library/Frameworks/JavaVM.framework/Versions/1.2/Commands/java + if [ ! -x ${JAVA_EXE} ] then - JAVA_EXE=java + JAVA_EXE=`which java` + if [ ! -x $JAVA_EXE ] + then + JAVA_EXE=java + fi fi fi fi diff --git a/whois.bat b/whois.bat index 9e7c514..9e396c5 100644 --- a/whois.bat +++ b/whois.bat @@ -1,12 +1,12 @@ @echo off -rem Package: GeekTools Whois Java Client 1.0 +rem Package: GeekTools Whois Java Client 1.0.1 rem File: whois.bat (Batch file) rem Author: Erik C. Thauvin rem Comments: Part of the GeekTools Whois Java Client package. rem See the README.TXT file for more information. rem -rem Copyright (C) 2000 SkyTouch Communications - All Rights Reserved +rem Copyright (C) 2000-2001 SkyTouch Communications - All Rights Reserved rem rem This program is distributed under the terms of the GNU General rem Public License as published by the Free Software Foundation.