일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 파일질라다운로드
- Math.ceil()
- is_check
- toFixed()
- Math.floor()
- slideUp
- 파일질라설치
- 1521
- selectedIndex
- Parent
- Git
- push오류
- SUB함수
- index %
- ctrl+/
- excel중복체크
- Math.round()
- 주석이 먹히지 않을 때
- hide
- 파일질라설치오류
- calc.plus
- addClass
- Excel
- FileZilla설치
- selectoptions
- calc.minus
- 소스트리인증실패
- 증가값
- FileZilla다운로드
- removeClass
- 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 |