From 88d7042efb34bf2eb2685e11b5d5b69600c4cd8a Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Thu, 25 Jul 2002 05:50:26 +0000 Subject: [PATCH] Added makefile, manifest and jar files. --- MANIFEST.MF | 3 +++ Whois.jar | Bin 0 -> 1884 bytes Whois.java | 57 ++++++++++++++++++++++++++-------------------------- makefile | 3 +++ 4 files changed, 34 insertions(+), 29 deletions(-) create mode 100644 MANIFEST.MF create mode 100644 Whois.jar create mode 100644 makefile diff --git a/MANIFEST.MF b/MANIFEST.MF new file mode 100644 index 0000000..c97ca0d --- /dev/null +++ b/MANIFEST.MF @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Main-Class: Whois + diff --git a/Whois.jar b/Whois.jar new file mode 100644 index 0000000000000000000000000000000000000000..02b29f55a4b1a35eacd18e6df1729c02bc01aa57 GIT binary patch literal 1884 zcmZ{lc{Cf?7so?oB!pU$Dy`C)*c*yenf|P`H1=pL5koZEN+(6C_N8Rn3`$y}l%UO| zRW0KeMQCZODwY`{NmVPBmZkxcwPwzl?>+Cl`_8-H_wHZ!xJXd62Y1_OCMEe>Fq5D?XXM9KBJlE+;Xj zUaqiirb5PH6#(DvjeW=fn~AqLXK@Hz+MhI$Ifg&_-6gZ95?KYEJ6uHJ4f-;Fy|dI@ zeUE7L!|#H%!SfiE2WzUJ{jtJ8#Zd*ia~MwjIyX<_!3w(~`<2$WcGBhq4+~^*+h2!l zuYYe&ar-tfGMX4`N+5;D#^wc##;W^6x6ZfpL~#@mnb1K$tZ@8mPW69Qj%1y9QK zJ68i5p0x5}EK>WZl&VyalmCYE=}vip=0dJd(f7`?5HX!6nYh%Z^NzmzKUb%tMEdxP zB!lU(6yBrh4W7;FNXxU$xM|Z2ll+joS0~KxaE2rJ`{t=|up1mgKIx_hF^TLrpxGs{ZtwZItixu=ObpXxDTH## z-l5{j%a`d2!Fcz*VgiMLa>uK6u6=!1Hx~?Kc$ z()PBTBV3GxqUEjvSKeMxaj-Eep(l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ycPf`N?pVpl)kn-rWY`4=-)*W>E g=L - Comments: Part of the GeekTools Whois Java Client package. - See the README.TXT file for more information. - - 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$ - -*/ + * Package: GeekTools Whois Java Client 1.0.2 + * 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-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$ + */ +import java.io.*; import java.net.Socket; -import java.io.*; import java.util.Properties; - /** * Class Whois * - * * @author Erik C. Thauvin (erik@skytouch.com) - * @version 1.0.1 + * @version 1.0.2 */ public class Whois { @@ -49,14 +45,15 @@ public class Whois // Default server is whois.geektools.com String server = "whois.geektools.com"; + // Default server port is 43 int port = 43; // Load the properties file. try { - FileInputStream in = new FileInputStream("Whois.properties"); - Properties app = new Properties(); + final FileInputStream in = new FileInputStream("Whois.properties"); + final Properties app = new Properties(); app.load(in); @@ -85,7 +82,7 @@ public class Whois } // Build the whois query using command line arguments - StringBuffer buff = new StringBuffer(args[0]); + final StringBuffer buff = new StringBuffer(args[0]); for (int i = 1; i < args.length; i++) { @@ -94,11 +91,11 @@ public class Whois // 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("@"); - int len = query.length(); + final int at = query.lastIndexOf("@"); + final int len = query.length(); if ((at != -1)) { @@ -120,9 +117,11 @@ public class Whois try { // 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())); + final Socket connection = new Socket(server, port); + final PrintStream out = + new PrintStream(connection.getOutputStream()); + final BufferedReader in = new BufferedReader( + new InputStreamReader(connection.getInputStream())); String line = ""; // Send the whois query diff --git a/makefile b/makefile new file mode 100644 index 0000000..84324cc --- /dev/null +++ b/makefile @@ -0,0 +1,3 @@ +all: + javac -O Whois.java + jar cvfm Whois.jar MANIFEST.MF Whois.class