1 /*
2 * Copyright 2007 The Kuali Foundation
3 *
4 * Licensed under the Educational Community License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.opensource.org/licenses/ecl2.php
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16 package org.kuali.ole.sys.context;
17
18 import java.io.File;
19 import java.io.IOException;
20
21 import org.kuali.ole.sys.OLEConstants;
22 import org.kuali.rice.core.api.config.property.ConfigContext;
23 import org.slf4j.Logger;
24 import org.slf4j.LoggerFactory;
25
26
27 /**
28 *
29 */
30 public class ApplicationConfigurer {
31 private static final Logger logger = LoggerFactory.getLogger(ApplicationConfigurer.class);
32
33 public static void configureApplication() {
34 prepareFileSystem();
35 }
36
37 protected static void prepareFileSystem() {
38 prepareKeystore();
39 }
40
41 protected static void prepareKeystore() {
42 String filename = ConfigContext.getCurrentContextConfig().getProperty(OLEConstants.OLE_FS_KEYSTORE_FILE_PROPERTY);
43 // File file = new File(filename);
44 // if (file.exists()) {
45 // logger.info("Keystore file located at [" + file + "]");
46 // return;
47 // }
48 // String location = PropertyLoadingFactoryBean.getBaseProperty(OLEConstants.OLE_FS_DEFAULT_KEYSTORE_FILE_LOCATION_PROPERTY);
49 // try {
50 // logger.info("Creating default keystore at [" + file + "] from [" + location + "]");
51 // OLEPropertyUtils.copy(location, file);
52 // }
53 // catch (IOException e) {
54 // throw new IllegalStateException(e);
55 // }
56 }
57
58 }