Batch, Remove unneeded Classes, refine, etc
[aaf/authz.git] / auth / auth-core / src / main / java / org / onap / aaf / auth / org / FileMailer.java
index 1db1198..6a648a8 100644 (file)
@@ -47,7 +47,10 @@ public class FileMailer implements Mailer {
                        throw new APIException("MAIL_FROM property is required for Email Notifications");
                }
                String env = access.getProperty("CASS_ENV", "UNKNOWN");
-               String logdir = access.getProperty(env+".LOG_DIR", "logs/"+env);
+               String logdir = access.getProperty("LOG_DIR",null);
+               if(logdir==null) {
+                       logdir=access.getProperty(env+".LOG_DIR", "logs/"+env);
+               }
                dir = Paths.get(logdir+"/email/"+Chrono.dateOnlyStamp());
                if(!Files.exists(dir)) {
                        try {
@@ -58,7 +61,8 @@ public class FileMailer implements Mailer {
                }
                
                boolean dryrun = Boolean.parseBoolean(access.getProperty("DRY_RUN","false"));
-               int maxEmail = Integer.parseInt(access.getProperty("MAX_EMAIL", "-1"));
+               String str = access.getProperty("MAX_EMAIL", null);
+               int maxEmail = str==null || str.isEmpty()?Integer.MAX_VALUE:Integer.parseInt(str);
                if(dryrun && maxEmail==1) {
                        testName = "email_test";
                } else {