* limitations under the License.
* ============LICENSE_END=========================================================
*/
+
package org.onap.aai.aaf.filters;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Properties;
+
+import javax.annotation.PostConstruct;
+
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Component;
-import javax.annotation.PostConstruct;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Properties;
-
// This component will be created if and only if any of the following profiles are active
@Component
-@Profile({
- AafProfiles.AAF_CERT_AUTHENTICATION,
- AafProfiles.AAF_AUTHENTICATION,
- AafProfiles.TWO_WAY_SSL
-})
+@Profile({AafProfiles.AAF_CERT_AUTHENTICATION, AafProfiles.AAF_AUTHENTICATION, AafProfiles.TWO_WAY_SSL})
public class CadiProps {
private static final Logger LOGGER = LoggerFactory.getLogger(CadiProps.class);
private Properties cadiProperties;
@Autowired
- public CadiProps(@Value("${aaf.cadi.file:./resources/cadi.properties}") String filename){
- cadiFileName = filename;
+ public CadiProps(@Value("${aaf.cadi.file:./resources/cadi.properties}") String filename) {
+ cadiFileName = filename;
cadiProperties = new Properties();
}
@PostConstruct
public void init() throws IOException {
- File cadiFile = new File(cadiFileName);
+ File cadiFile = new File(cadiFileName);
- if(!cadiFile.exists()){
- LOGGER.warn("Unable to find the cadi file in the given path {} so loading cadi.properties from classloader", cadiFileName);
+ if (!cadiFile.exists()) {
+ LOGGER.warn("Unable to find the cadi file in the given path {} so loading cadi.properties from classloader",
+ cadiFileName);
InputStream is = this.getClass().getClassLoader().getResourceAsStream("cadi.properties");
cadiProperties.load(is);
} else {
}
}
+
public String getCadiFileName() {
return cadiFileName;
}
- public Properties getCadiProperties(){
+
+ public Properties getCadiProperties() {
return cadiProperties;
}
}