Added makefile, manifest and jar files.

This commit is contained in:
Erik C. Thauvin 2002-07-25 05:50:26 +00:00
parent fa7c5ec73d
commit 88d7042efb
4 changed files with 34 additions and 29 deletions

3
MANIFEST.MF Normal file
View file

@ -0,0 +1,3 @@
Manifest-Version: 1.0
Main-Class: Whois

BIN
Whois.jar Normal file

Binary file not shown.

View file

@ -1,32 +1,28 @@
/* /*
* Package: GeekTools Whois Java Client 1.0.2
Package: GeekTools Whois Java Client 1.0.1 * File: Whois.java (Java source file)
File: Whois.java (Java source file) * Author: Erik C. Thauvin <erik@skytouch.com>
Author: Erik C. Thauvin <erik@skytouch.com> * Comments: Part of the GeekTools Whois Java Client package.
Comments: Part of the GeekTools Whois Java Client package. *
See the README.TXT file for more information. * See the README.TXT file for more information.
*
Copyright (C) 2000-2001 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
This program is distributed under the terms of the GNU General * Public License as published by the Free Software Foundation.
Public License as published by the Free Software Foundation. * See the COPYING.TXT file for more information.
See the COPYING.TXT file for more information. *
* $Id$
$Id$ */
import java.io.*;
*/
import java.net.Socket; import java.net.Socket;
import java.io.*;
import java.util.Properties; import java.util.Properties;
/** /**
* Class Whois * Class Whois
* *
*
* @author Erik C. Thauvin (erik@skytouch.com) * @author Erik C. Thauvin (erik@skytouch.com)
* @version 1.0.1 * @version 1.0.2
*/ */
public class Whois public class Whois
{ {
@ -49,14 +45,15 @@ public class Whois
// Default server is whois.geektools.com // Default server is whois.geektools.com
String server = "whois.geektools.com"; String server = "whois.geektools.com";
// Default server port is 43 // Default server port is 43
int port = 43; int port = 43;
// Load the properties file. // Load the properties file.
try try
{ {
FileInputStream in = new FileInputStream("Whois.properties"); final FileInputStream in = new FileInputStream("Whois.properties");
Properties app = new Properties(); final Properties app = new Properties();
app.load(in); app.load(in);
@ -85,7 +82,7 @@ public class Whois
} }
// Build the whois query using command line arguments // 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++) for (int i = 1; i < args.length; i++)
{ {
@ -94,11 +91,11 @@ public class Whois
// Convert string buffer to string // Convert string buffer to string
String query = buff.toString(); String query = buff.toString();
// The whois server can be specified after "@" // The whois server can be specified after "@"
// e.g.: query@whois.networksolutions.com // e.g.: query@whois.networksolutions.com
int at = query.lastIndexOf("@"); final int at = query.lastIndexOf("@");
int len = query.length(); final int len = query.length();
if ((at != -1)) if ((at != -1))
{ {
@ -120,9 +117,11 @@ public class Whois
try try
{ {
// Establish connection to whois server & port // Establish connection to whois server & port
Socket connection = new Socket(server, port); final Socket connection = new Socket(server, port);
PrintStream out = new PrintStream(connection.getOutputStream()); final PrintStream out =
BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream())); new PrintStream(connection.getOutputStream());
final BufferedReader in = new BufferedReader(
new InputStreamReader(connection.getInputStream()));
String line = ""; String line = "";
// Send the whois query // Send the whois query

3
makefile Normal file
View file

@ -0,0 +1,3 @@
all:
javac -O Whois.java
jar cvfm Whois.jar MANIFEST.MF Whois.class