URLConnection getDoInput Example

Started by VelMurugan, Dec 20, 2008, 09:33 PM

Previous topic - Next topic

VelMurugan

URLConnection getDoInput Example

URLConnection class getDoInput example. This example shows you how to use getDoInput method.

URLConnection class getDoInput example. public boolean getDoInput() Returns the value of this URLConnection's doInput flag.

Here is the code


/*
* @ # GetDefaultUseCaches.java
* A class repersenting use to GetDefaultUseCaches
* method of URLConnection class in java.net package
* version 23 June 2008
* author Rose India
*/

import java.net.*;

public class GetDoInput {

    public static void main(String args[]) throws Exception {

        SocketAddress socketAddress =
                new InetSocketAddress("192.168.10.80", 9090);
        Proxy proxy = new Proxy(Proxy.Type.HTTP, socketAddress);

        URL url = new URL("http://google.com");
        URLConnection connection = url.openConnection(proxy);

        System.out.println("DoInput " +
                connection.getDoInput());
    }
}


Output

DoInput true

Source : codingdiary