Mercurial Hosting > luan
comparison src/luan/modules/url/LuanUrl.java @ 1315:5763597ca5c0
add DomainHandler
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Wed, 30 Jan 2019 01:21:49 -0700 |
parents | 781ec0a92bb5 |
children | c286c1e36b81 |
comparison
equal
deleted
inserted
replaced
1314:51a1987b55a3 | 1315:5763597ca5c0 |
---|---|
3 import java.io.InputStream; | 3 import java.io.InputStream; |
4 import java.io.InputStreamReader; | 4 import java.io.InputStreamReader; |
5 import java.io.OutputStream; | 5 import java.io.OutputStream; |
6 import java.io.Reader; | 6 import java.io.Reader; |
7 import java.io.IOException; | 7 import java.io.IOException; |
8 import java.io.FileNotFoundException; | |
8 import java.io.UnsupportedEncodingException; | 9 import java.io.UnsupportedEncodingException; |
9 import java.net.URL; | 10 import java.net.URL; |
10 import java.net.URLConnection; | 11 import java.net.URLConnection; |
11 import java.net.HttpURLConnection; | 12 import java.net.HttpURLConnection; |
12 import java.net.URLEncoder; | 13 import java.net.URLEncoder; |
251 } | 252 } |
252 | 253 |
253 private static InputStream getInputStream(LuanState luan,HttpURLConnection httpCon) throws IOException, LuanException { | 254 private static InputStream getInputStream(LuanState luan,HttpURLConnection httpCon) throws IOException, LuanException { |
254 try { | 255 try { |
255 return httpCon.getInputStream(); | 256 return httpCon.getInputStream(); |
257 } catch(FileNotFoundException e) { | |
258 throw e; | |
256 } catch(IOException e) { | 259 } catch(IOException e) { |
257 int responseCode = httpCon.getResponseCode(); | 260 int responseCode = httpCon.getResponseCode(); |
258 String responseMessage = httpCon.getResponseMessage(); | 261 String responseMessage = httpCon.getResponseMessage(); |
259 InputStream is = httpCon.getErrorStream(); | 262 InputStream is = httpCon.getErrorStream(); |
260 if( is == null ) | 263 if( is == null ) |