X-Git-Url: https://gerrit.onap.org/r/gitweb?p=aaf%2Fauthz.git;a=blobdiff_plain;f=auth%2Fauth-core%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Faaf%2Fauth%2Frserv%2FCachingFileAccess.java;fp=auth%2Fauth-core%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Faaf%2Fauth%2Frserv%2FCachingFileAccess.java;h=cdda50db48eba07714994cd2a0299a7721a01c09;hp=3c76e928c6d9bd4151e97d833e590f6c3fb5baf5;hb=82755753f41112e1cdd91b2994620ad074dfbf20;hpb=e78d297795f08d3ecdc176ff10c6c77570828e17 diff --git a/auth/auth-core/src/main/java/org/onap/aaf/auth/rserv/CachingFileAccess.java b/auth/auth-core/src/main/java/org/onap/aaf/auth/rserv/CachingFileAccess.java index 3c76e928..cdda50db 100644 --- a/auth/auth-core/src/main/java/org/onap/aaf/auth/rserv/CachingFileAccess.java +++ b/auth/auth-core/src/main/java/org/onap/aaf/auth/rserv/CachingFileAccess.java @@ -72,20 +72,20 @@ public class CachingFileAccess extends HttpCode typeMap; private final NavigableMap content; private final Set attachOnly; - public final static String CFA_WEB_PATH = "aaf_cfa_web_path"; + public static final String CFA_WEB_PATH = "aaf_cfa_web_path"; // when to re-validate from file // Re validating means comparing the Timestamp on the disk, and seeing it has changed. Cache is not marked // dirty unless file has changed, but it still makes File IO, which for some kinds of cached data, i.e. // deployed GUI elements is unnecessary, and wastes time. // This parameter exists to cover the cases where data can be more volatile, so the user can choose how often the // File IO will be accessed, based on probability of change. "0", of course, means, check every time. - private final static String CFA_CACHE_CHECK_INTERVAL = "aaf_cfa_cache_check_interval"; - private final static String CFA_MAX_SIZE = "aaf_cfa_max_size"; // Cache size limit - private final static String CFA_CLEAR_COMMAND = "aaf_cfa_clear_command"; + private static final String CFA_CACHE_CHECK_INTERVAL = "aaf_cfa_cache_check_interval"; + private static final String CFA_MAX_SIZE = "aaf_cfa_max_size"; // Cache size limit + private static final String CFA_CLEAR_COMMAND = "aaf_cfa_clear_command"; // Note: can be null without a problem, but included // to tie in with existing Logging. @@ -93,12 +93,14 @@ public class CachingFileAccess extends HttpCode extends HttpCode extends HttpCode extends HttpCode extends HttpCode extends HttpCode2 && slash>=0 && key.substring(0,slash).equals(clear_command)) { + if(key.length()>2 && slash>=0 && key.substring(0,slash).equals(clearCommand)) { resp.setHeader("Content-Type",typeMap.get("txt")); if ("clear".equals(key.substring(slash+1))) { content.clear(); @@ -177,7 +179,7 @@ public class CachingFileAccess extends HttpCode extends HttpCode extends HttpCode extends HttpCode extends HttpCode extends HttpCode entry = scont.get(i).entry; content.remove(entry.getKey()); - //System.out.println("removed Cache Item " + entry.getKey() + "/" + new Date(entry.getValue().access).toString()); } -// for (int i=end;i entry = scont.get(i).entry; -// //System.out.println("remaining Cache Item " + entry.getKey() + "/" + new Date(entry.getValue().access).toString()); -// } } } }