Here are the examples of the java api sys.SystemInfo.PATH taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
2 Examples
14
View Source File : UI.java
License : Apache License 2.0
Project Creator : occidere
License : Apache License 2.0
Project Creator : occidere
/**
* 메뉴 8-2 저장경로 변경
*
* @param in
* @throws Exception
*/
private void changeSavePath(final BufferedReader in) throws Exception {
print.info("현재 저장경로: {}\n변경할 경로를 입력하세요: ", SystemInfo.PATH);
String path = in.readLine().trim();
File newPath = new File(path);
/* 입력한 경로가 만든 적이 없는 경로 & 그런데 새로 생성 실패 */
if (newPath.exists() == false && newPath.mkdirs() == false) {
ErrorHandling.printError("저장경로 변경 실패", false);
return;
}
/* 생성 가능한 정상적인 경로라면 */
Configuration.setProperty("PATH", path);
// store -> load - > apply
Configuration.refresh();
print.info("저장경로 변경 완료!\n");
}
10
View Source File : UI.java
License : Apache License 2.0
Project Creator : occidere
License : Apache License 2.0
Project Creator : occidere
public void showMenu() throws Exception {
final BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
Preprocess preprocess = Preprocess.getInstance();
String comicAddress, input;
int menuNum = Integer.MAX_VALUE;
while (menuNum != EXIT) {
// 메뉴 출력
printMenu();
input = in.readLine();
if (InputCheck.isValid(input, InputCheck.ONLY_NUMBER) == false) {
ErrorHandling.printError("잘못된 입력값입니다.", false);
continue;
}
menuNum = Integer.parseInt(input);
switch(menuNum) {
case // 일반 다운로드
1:
print.info("주소를 입력하세요: ");
comicAddress = in.readLine().trim();
if (InputCheck.isValid(comicAddress, InputCheck.IS_HTTP_URL) == false) {
ErrorHandling.printError("잘못된 입력값입니다.", false);
continue;
}
preprocess.connector(comicAddress, ALL_DOWNLOAD, in);
preprocess.close();
break;
case // 선택적 다운로드
2:
print.info("전체보기 주소를 입력하세요: ");
comicAddress = in.readLine().trim();
if (InputCheck.isValid(comicAddress, InputCheck.IS_HTTP_URL) == false) {
ErrorHandling.printError("잘못된 입력값입니다.", false);
continue;
}
preprocess.connector(comicAddress, SELECTIVE_DOWNLOAD, in);
preprocess.close();
break;
case // 저장 폴더 열기
3:
SystemInfo.makeDir(SystemInfo.PATH);
SystemInfo.openDir(SystemInfo.PATH);
break;
case // 마루마루 사이트 열기
4:
SystemInfo.openBrowser();
break;
case // 환경설정
8:
printSettingMenu();
input = in.readLine().trim();
if (InputCheck.isValid(input, InputCheck.ONLY_NUMBER) == false) {
ErrorHandling.printError("잘못된 입력값입니다.", false);
continue;
}
menuNum = Integer.parseInt(input);
/* 환경설정 메뉴 */
switch(menuNum) {
case // 업데이트 확인
1:
SystemInfo.printLatestVersionInfo(in);
break;
case // 저장경로 변경
2:
changeSavePath(in);
break;
case // 다운받은 만화 하나로 합치기
3:
mergeImage(in);
break;
case // 디버깅 모드
4:
debugMode(in);
break;
case // 멀티스레딩 모드
5:
mulreplacedhreadMode(in);
break;
case // 다운받은 만화 압축하기
6:
compressImage(in);
break;
}
// 이걸 달아줘야지 종료되는거 막을 수 있음
menuNum = 8;
break;
case // 도움말
9:
SystemInfo.help();
break;
case // 종료
0:
print.info("프로그램을 종료합니다\n");
break;
}
}
// BufferedReader close
in.close();
}