Here are the examples of the java api sys.Configuration.setProperty() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
5 Examples
18
Source : UI.java
with Apache License 2.0
from occidere
with Apache License 2.0
from occidere
/**
* 메뉴 8-5 멀티스레딩 모드
*
* @param in
* @throws Exception
*/
private void mulreplacedhreadMode(final BufferedReader in) throws Exception {
int multi = Configuration.getInt("MULTI", 2);
print.info("다운로드에 할당할 스레드 값 설정합니다(현재: {})\n", multi);
print.info("* 기본 값은 2이며, 대체로 값이 커질수록 성능은 좋아지나 메모리 사용량이 증가합니다.\n" + " 0: 멀티스레딩을 하지 않습니다 (초저성능)\n" + " 1: 코어 개수의 절반 만큼을 할당합니다 (저성능)\n" + " 2: 코어 개수 만큼을 할당합니다 (기본값, 권장)\n" + " 3: 코어 개수의 2배 만큼을 할당합니다 (고성능)\n" + " 4: 사용할 수 있는 최대한 할당합니다 (초고성능)\n");
print.info("값 입력(0 ~ 4): ");
String input = StringUtils.trimToEmpty(in.readLine());
if (input.matches("[0-4]")) {
Configuration.setProperty("MULTI", input);
Configuration.refresh();
print.info("변경 완료\n");
} else {
ErrorHandling.printError("잘못된 값입니다.", false);
}
}
18
Source : UI.java
with Apache License 2.0
from occidere
with Apache License 2.0
from 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");
}
17
Source : UI.java
with Apache License 2.0
from occidere
with Apache License 2.0
from occidere
/**
* 메뉴 8-3 이미지 합치기
*
* @param in
* @throws Exception
*/
private void mergeImage(final BufferedReader in) throws Exception {
boolean merge = Configuration.getBoolean("MERGE", false);
print.info("true면 다운받은 만화를 하나의 긴 파일로 합친 파일을 추가로 생성합니다(현재: {})\n", merge);
print.info("값 입력(true or false): ");
String input = StringUtils.lowerCase(in.readLine());
if (StringUtils.containsAny(input, "true", "false")) {
Configuration.setProperty("MERGE", input);
Configuration.refresh();
System.out.println("변경 완료");
} else {
ErrorHandling.printError("잘못된 값입니다.", false);
}
}
17
Source : UI.java
with Apache License 2.0
from occidere
with Apache License 2.0
from occidere
/**
* 메뉴 8-4 디버깅 모드
*
* @param in
* @throws Exception
*/
private void debugMode(final BufferedReader in) throws Exception {
boolean debug = Configuration.getBoolean("DEBUG", false);
print.info("true면 다운로드 과정에 파일의 용량과 메모리 사용량이 같이 출력됩니다(현재: {})\n", debug);
print.info("값 입력(true or false): ");
String input = StringUtils.lowerCase(in.readLine());
if (StringUtils.containsAny(input, "true", "false")) {
Configuration.setProperty("DEBUG", input);
Configuration.refresh();
print.info("변경 완료\n");
} else {
ErrorHandling.printError("잘못된 값입니다.", false);
}
}
17
Source : UI.java
with Apache License 2.0
from occidere
with Apache License 2.0
from occidere
/**
* 8-6 이미지 압축하기 모드
*
* @param in
* @throws Exception
*/
private void compressImage(final BufferedReader in) throws Exception {
boolean compress = Configuration.getBoolean("ZIP", false);
print.info("다운받은 만화들을 압축할 것인지 설정합니다(현재: {})\n", compress);
print.info("값 입력(true or false): ");
String input = StringUtils.lowerCase(in.readLine());
if (StringUtils.containsAny(input, "true", "false")) {
Configuration.setProperty("ZIP", input);
Configuration.refresh();
print.info("변경 완료\n");
} else {
ErrorHandling.printError("잘못된 값입니다.", false);
}
}