Merge "Omaha #2975 optimize lookup of edit areas and gfe configs" into omaha_14.4.1

Former-commit-id: 245804a21a [formerly 918dcb1b91fb45b84a82df42b7fe2d3fc2f86fa0]
Former-commit-id: a9827b0545
This commit is contained in:
Ron Anderson 2014-09-29 16:10:37 -05:00 committed by Gerrit Code Review
commit 8116a665a8
2 changed files with 13 additions and 8 deletions

View file

@ -29,6 +29,7 @@ import java.util.Set;
import jep.JepException;
import com.raytheon.uf.common.dataplugin.gfe.python.GfePyIncludeUtil;
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
import com.raytheon.uf.common.localization.LocalizationFile;
import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.common.python.PyUtil;
@ -48,6 +49,7 @@ import com.raytheon.uf.common.util.FileUtil;
* ------------ ---------- ----------- --------------------------
* Jan 21, 2010 randerso Initial creation
* Jul 08, 2014 3361 njensen Consolidated code
* Sep 29, 2014 2975 njensen Only look up files in CAVE_STATIC
*
* </pre>
*
@ -122,8 +124,8 @@ public class ConfigCatalog {
*/
public LocalizationFile[] getFiles() {
LocalizationFile[] procFiles = PathManagerFactory.getPathManager()
.listStaticFiles(GfePyIncludeUtil.CONFIG,
new String[] { EXTENSION },
.listStaticFiles(LocalizationType.CAVE_STATIC,
GfePyIncludeUtil.CONFIG, new String[] { EXTENSION },
false, true);
return procFiles;
}
@ -149,7 +151,7 @@ public class ConfigCatalog {
String fname = GfePyIncludeUtil.CONFIG + File.separator + scriptName
+ EXTENSION;
LocalizationFile file = PathManagerFactory.getPathManager()
.getStaticLocalizationFile(fname);
.getStaticLocalizationFile(LocalizationType.CAVE_STATIC, fname);
return file;
}

View file

@ -109,7 +109,8 @@ import com.vividsolutions.jts.geom.Envelope;
* 06/21/2013 14983 ryu Added method for synchronous evaluation of query.
* 08/06/2013 1561 njensen Use pm.listFiles() instead of pm.listStaticFiles()
* 09/30/2013 2361 njensen Use JAXBManager for XML
* 09/08/2104 #3592 randerso Changed to use new pm listStaticFiles()
* 09/08/2014 #3592 randerso Changed to use new pm listStaticFiles()
* 09/29/2014 2975 njensen Only lookup COMMON_STATIC for editAreas
*
* </pre>
*
@ -776,7 +777,8 @@ public class ReferenceSetManager implements IReferenceSetManager,
String filePath = FileUtil.join(EDIT_AREAS_DIR, refSetID.getName()
+ ".xml");
LocalizationFile lf = PathManagerFactory.getPathManager()
.getStaticLocalizationFile(filePath);
.getStaticLocalizationFile(LocalizationType.COMMON_STATIC,
filePath);
if (lf != null) {
try {
@ -1666,7 +1668,8 @@ public class ReferenceSetManager implements IReferenceSetManager,
String filePath = FileUtil.join(EDIT_AREAS_DIR, refId.getName()
+ ".xml");
LocalizationFile lf = PathManagerFactory.getPathManager()
.getStaticLocalizationFile(filePath);
.getStaticLocalizationFile(LocalizationType.COMMON_STATIC,
filePath);
if ((lf != null) && lf.exists()) {
changes.add(refId);
@ -1716,8 +1719,8 @@ public class ReferenceSetManager implements IReferenceSetManager,
}
// find the file anywhere in the hierarchy
LocalizationFile lf = pm.getStaticLocalizationFile(message
.getFileName());
LocalizationFile lf = pm.getStaticLocalizationFile(
LocalizationType.COMMON_STATIC, message.getFileName());
// if it exists, load it
if ((lf != null) && lf.exists()) {