X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=POLICY-SDK-APP%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fpolicy%2Fcontroller%2FPolicyController.java;fp=POLICY-SDK-APP%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fpolicy%2Fcontroller%2FPolicyController.java;h=bd8c8287c4564c8ba4e54f949d10e73d6879faca;hb=7f94862a50f552f840cbb2a84ee1c3e20fc3c708;hp=d244cf528cd1ca7fb4ac367085e8545a7eeca72a;hpb=c7ebb39ee23233b0104d3a0f9b1f8fdd66911d18;p=policy%2Fengine.git diff --git a/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/PolicyController.java b/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/PolicyController.java index d244cf528..bd8c8287c 100644 --- a/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/PolicyController.java +++ b/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/PolicyController.java @@ -144,6 +144,9 @@ public class PolicyController extends RestrictedBaseController { private static String configHome; private static String actionHome; + //File upload size + private static long fileSizeLimit; + private static boolean jUnit = false; @@ -176,6 +179,8 @@ public class PolicyController extends RestrictedBaseController { } // load a properties file prop.load(input); + //file upload size limit property + setFileSizeLimit(prop.getProperty("file.size.limit")); //pap url setPapUrl(prop.getProperty("xacml.rest.pap.url")); // get the property values @@ -716,6 +721,19 @@ public class PolicyController extends RestrictedBaseController { return file; } + public static void setFileSizeLimit(String uploadSize) { + //Default size limit is 30MB + if (uploadSize == null || uploadSize.isEmpty()) { + fileSizeLimit = 30000000; + } + else { + fileSizeLimit = Long.parseLong(uploadSize); + } + } + + public static long getFileSizeLimit() { + return fileSizeLimit; + } public String convertDate(String dateTTL) { String formateDate = null; if(dateTTL.contains("-")){