Networking Section Index
On a linux machine to get the local IP address.
I'm doing this:
try {
InetAddress address = InetAddress.getLocalHost();
String IP = new String (address.getHostAddress());
}
catch (Exception e) {
e.printStackTrace();
}
on a li...more
Where can I find the API documentation for Jini?
The documentation for the latest version of Jini (1.1) is bundled
with the software - you must download the entire package from
http://developer.java.sun.com/developer/products/jini/EAproduct.off...more
Where do I get source code for an Internet search engine?
See How do I add a search engine to my web site? (though this covers searching your site, not the whole Internet).
Running a Web Crawler is a pretty big job. Do you have a couple of terabytes of...more
Where can I learn (more) about Sun's peer to peer, "Project JXTA"?
Check out the Project JXTA site.
Where can I learn (more) about Java's support asynchronous and publish/subscribe messaging using JMS (Java Message Service)?
Check out the jGuru JMS FAQ.
Where can I learn (more) about Sun's Jini network technology?
Check out the jGuru Jini FAQ.
Where can I learn (more) about Java's I/O (input/output, IO) capabilities?
Check out the jGuru IO FAQ.
Where can I learn (more) about CORBA (Common Object Request Broker Architecture)?
Check out the jGuru CORBA FAQ.
Where can I learn (more) about Application Servers?
Check out the jGuru AppServer
FAQ.
How do I maintain cookies across separate network connections?
Java 5 introduced the abstract CookieHandler class to help with the process, though Java 5 lacks a usable implementation. You must implement yourself. Java 6 added the CookieManager for just such ...more
How do I use Java to ping a host?
Starting with Java 5, there is an isReachable() method in the InetAddress class. You can specify either a timeout or the NetworkInterface to use. For more information on the underlying Internet Co...more
How can I encode a URL String?
A URL String can be simply encoded using the static encode(String s, String enc) method within the URLEncoder class. encode(String s) has been deprecated with encode(String s, String enc) now bei...more
When using a URLConnection how can I get a specific header field returned by the server or all of them?
The URLConnection class contains various methods, which return specific header
fields or the whole lot. Specific header fields can be obtained either by their name or the position of where they ...more
How can I load a class from a remote server?
The URLClassLoader class was created specifically to facilitate the downloading of classes over a network. Three constructors are provided, the first of which simply takes a URL[] as an argument ...more
While I can certainly show the contents of a web page in a JEditorPane, how do I launch the desktop's browser with the new URL?
The JDesktop Integration Components (JDIC), available from https://jdic.dev.java.net, offers support for this:
import java.net.*;
import org.jdesktop.jdic.desktop.*;
public class LaunchURL {
...more