001/* 002 * Copyright 2007 The Kuali Foundation 003 * 004 * Licensed under the Educational Community License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.opensource.org/licenses/ecl2.php 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016package org.kuali.ole.sys.context; 017 018import java.io.File; 019import java.io.IOException; 020 021import org.kuali.ole.sys.OLEConstants; 022import org.kuali.rice.core.api.config.property.ConfigContext; 023import org.slf4j.Logger; 024import org.slf4j.LoggerFactory; 025 026 027/** 028 * 029 */ 030public class ApplicationConfigurer { 031 private static final Logger logger = LoggerFactory.getLogger(ApplicationConfigurer.class); 032 033 public static void configureApplication() { 034 prepareFileSystem(); 035 } 036 037 protected static void prepareFileSystem() { 038 prepareKeystore(); 039 } 040 041 protected static void prepareKeystore() { 042 String filename = ConfigContext.getCurrentContextConfig().getProperty(OLEConstants.OLE_FS_KEYSTORE_FILE_PROPERTY); 043// File file = new File(filename); 044// if (file.exists()) { 045// logger.info("Keystore file located at [" + file + "]"); 046// return; 047// } 048// String location = PropertyLoadingFactoryBean.getBaseProperty(OLEConstants.OLE_FS_DEFAULT_KEYSTORE_FILE_LOCATION_PROPERTY); 049// try { 050// logger.info("Creating default keystore at [" + file + "] from [" + location + "]"); 051// OLEPropertyUtils.copy(location, file); 052// } 053// catch (IOException e) { 054// throw new IllegalStateException(e); 055// } 056 } 057 058}