Notice
Recent Posts
Recent Comments
Link
passion and relax
[JAVA] 21. 웹, 운영체제, 클래스 정보 본문
운영체제 정보 추출
System.getProperty("os.name");
[windows와 그 외 os의 분기 예]
String dotPath = "";
if (System.getProperty("os.name").toLowerCase().indexOf("win") < 0) {
dotPath = "/usr/bin/dot";
} else {
dotPath = "C:\\Program Files\\Graphviz 2.21\\bin\\dot";
}
web crawling
String urlAddr = "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?id=9389682";
try {
URL url = new URL(urlAddr);
URLConnection urlC = url.openConnection();
urlC.setUseCaches(false);
urlC.connect();
BufferedReader br =
new BufferedReader(new InputStreamReader(urlC.getInputStream()));
String temp;
while( (temp = br.readLine()) != null ) {
System.out.println(temp);
}
br.close();
} catch (Exception ex) {
Logger.getLogger(NewClass.class.getName()).log(Level.SEVERE, null, ex);
}
class naming information
myClass.getClass().getCanonicalName(); //패키지명.클래스명
myClass.getClass().getSimpleName(); //클래스명
myClass.getClass().toString(); //class 패키지명.클래스명
'프로그래밍' 카테고리의 다른 글
[Mac] 확인되지 않은 개발자가 배포했기 때문에 열 수 없습니다. (1) | 2024.09.01 |
---|---|
[JAVA] 20. Library - JRI (1) | 2024.06.07 |
[JAVA] 19. 거의 본문에 들어갈 뻔 했던 내용 (0) | 2024.06.05 |
[JAVA] 18. 분산 컴퓨팅 (RMI와 서블릿, EJB와 지니) (1) | 2024.06.04 |
[JAVA] 17. 코드를 배포합시다 (패키지 제작과 배포) (1) | 2024.06.04 |