일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
- excel중복체크
- FileZilla설치
- 주석이 먹히지 않을 때
- calc.plus
- 증가값
- 파일질라설치오류
- hide
- index %
- slideUp
- removeClass
- 파일질라설치
- 소스트리인증실패
- push오류
- Math.floor()
- Math.round()
- selectedIndex
- 파일질라다운로드
- Excel
- ctrl+/
- Parent
- is_check
- SUB함수
- calc.minus
- addClass
- toFixed()
- FileZilla다운로드
- 1521
- Math.ceil()
- Git
- selectoptions
- Today
- Total
잡동사니에도 사랑을
[21.08.31] URLMain 본문
package network;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URL;
public class URLMain {
public static void main(String[] args) throws IOException {
URL url = new URL("https://www.naver.com/index.html");
System.out.println("프로토콜 = " + url.getProtocol()); // https
System.out.println("호스트 = " + url.getHost()); // www.naver.com
System.out.println("포트 = " + url.getPort()); // 포트 번호가 없는뎅? ...-1
System.out.println("기본포트 = " + url.getDefaultPort()); // 443
System.out.println("파일 = " + url.getFile()); // /index.html
BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
String line = null;
while ((line = br.readLine()) != null) {
System.out.println(line);
}
br.close();
}
}
'JAVA_SE > 12_network' 카테고리의 다른 글
[21.08.31] Protocol Server와 Client 연동 (0) | 2021.09.01 |
---|---|
[21.08.31] InetAddress (0) | 2021.09.01 |