Created
June 29, 2022 15:50
-
-
Save daanta-real/2f4d3f8d0accd3b47bb166357be9b9b6 to your computer and use it in GitHub Desktop.
Open a file and read inner T/F value
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.File; | |
import java.util.Scanner; | |
public class Debug { | |
// 디버그용 로그인여부 지시 파일 내용이 true인지 아닌지, | |
// 즉 강제 로그인을 지시했는지 아닌지를 알아내어 회신 | |
// Open a file which indicates about the debug mode, | |
// get the debug mode is true or not, and return it | |
public static boolean getDebug() { | |
try(Scanner obj = new Scanner(new File("C:/isDebugMode.ini"))) { | |
String result = obj.nextLine(); | |
return result.equals("true") ? true : false; | |
} catch(Exception e) { e.printStackTrace(); } | |
return false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment