This repository was archived by the owner on Aug 17, 2023. It is now read-only.
File tree 3 files changed +7
-8
lines changed
src/main/java/pers/scruel/util
3 files changed +7
-8
lines changed Original file line number Diff line number Diff line change 1
- CLIPLT_DEBUG = TRUE
1
+ CLIPLT_EMAIL_DEBUG = TRUE
2
+ CLIPLT_CONFIG_PATH = C:\Users\scruel\Desktop\TOOL\auto\clipIt\config.properties";
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ public class MailUtils {
27
27
* 初始化方法
28
28
*/
29
29
public MailUtils () throws GeneralSecurityException , IOException {
30
- boolean debug = Boolean .parseBoolean (System .getenv ("CLIPLT_DEBUG " ));
30
+ boolean debug = Boolean .parseBoolean (System .getenv ("CLIPLT_EMAIL_DEBUG " ));
31
31
System .setProperty ("mail.mime.splitlongparameters" , "false" );
32
32
Properties properties = PropertiesUtils .getProperties ();
33
33
this .mailHost = properties .getProperty ("stk.mail.smtp.host" );
Original file line number Diff line number Diff line change 12
12
*/
13
13
public class PropertiesUtils {
14
14
private static final Properties PROPERTIES = new Properties ();
15
- private static final String SCRUEL_TEST_PATH = "C:\\ Users\\ scruel\\ Desktop\\ TOOL\\ auto\\ clipIt\\ config.properties" ;
16
15
private static boolean loaded = false ;
17
16
18
17
public static Properties getProperties () throws IOException {
19
18
if (loaded ) {
20
19
return PROPERTIES ;
21
20
}
22
- if (Boolean .parseBoolean (System .getenv ("CLIPLT_DEBUG" ))) {
23
- PROPERTIES .load (Files .newInputStream (Paths .get (SCRUEL_TEST_PATH )));
24
- }
25
- else {
26
- PROPERTIES .load (Files .newInputStream (Paths .get ("config.properties" )));
21
+ String configPath = System .getenv ("CLIPLT_CONFIG_PATH" );
22
+ if (null == configPath ) {
23
+ configPath = "config.properties" ;
27
24
}
25
+ PROPERTIES .load (Files .newInputStream (Paths .get (configPath )));
28
26
loaded = true ;
29
27
return PROPERTIES ;
30
28
}
You can’t perform that action at this time.
0 commit comments