Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.io.InputStream;
import java.net.URL;
import java.net.URLConnection;

public class Main {
    public static InputStream HandlerData(String url) {
        InputStream inStream = null;

        try {
            URL feedUrl = new URL(url);
            URLConnection conn = feedUrl.openConnection();
            conn.setConnectTimeout(10 * 1000);
            inStream = conn.getInputStream();
        } catch (Exception e) {
            e.printStackTrace();
        }

        return inStream;
    }
}