package test;
import java.io.BufferedInputStream;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
public class Test {
public static void main(String[] args) {
HttpURLConnection urlConn = null;
URL url = null;
BufferedInputStream bis = null;
try {
url = new URL("http://www.ucpaas.com/fileserver/record/aee9011d2ee0f21f67310422ce62e71c_1464078387210374_20160524?sig=648DA4EC9E16704C44E5424D7A29CCD2");
urlConn = (HttpURLConnection) url.openConnection();
urlConn.connect();
bis = new BufferedInputStream(urlConn.getInputStream());
System.out.println("file type: " + HttpURLConnection.guessContentTypeFromStream(bis));
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} finally {
if(bis != null) {
try {
bis.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
}