- if (file.toFile().exists()) {
-
- if (file.toString().endsWith(".properties")) {
- InputStream in;
- try {
- in = new FileInputStream(file.toFile());
- config.load(in);
-
- resourceName = config.getProperty("RESOURCE_NAME");
- system = config.getProperty("SERVER");
- type = config.getProperty("LOGTYPE");
- systemLogFile = config.getProperty("PARSERLOGPATH");
- final String logFiles = config.getProperty("LOGPATH");
- final String cleanupInterval = config.getProperty("CHECK_INTERVAL");
- final String timeFrame = config.getProperty("TIME_FRAME");
-
- setCleanUpProperties(cleanupInterval, timeFrame);
-
- if (logFiles == null || logFiles.isEmpty()) {
- isMissingLogFile = true;
- return null;
- }
+ //ensure file exists and it is properties file
+ if (!(file.toFile().exists() && file.toString().endsWith(".properties"))) {
+ logger.debug("File doesn't exist in the specified Path Or it is not a properties file" + file.toString());
+ return null;
+ }