Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
OLAT CI-CD Testing Project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lars Oliver Dam
OLAT CI-CD Testing Project
Commits
79be3c00
"README.md" did not exist on "05dbcfdd1de545de0c982cf148a488838f7f6b0c"
Commit
79be3c00
authored
13 years ago
by
srosse
Browse files
Options
Downloads
Patches
Plain Diff
OO-59: remove OLATPropertyPlaceholderConfigurer
parent
b09d7e7d
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/org/olat/core/configuration/OLATPropertyPlaceholderConfigurer.java
+0
-69
0 additions, 69 deletions
...core/configuration/OLATPropertyPlaceholderConfigurer.java
with
0 additions
and
69 deletions
src/main/java/org/olat/core/configuration/OLATPropertyPlaceholderConfigurer.java
deleted
100644 → 0
+
0
−
69
View file @
b09d7e7d
/**
* OLAT - Online Learning and Training<br>
* http://www.olat.org
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); <br>
* you may not use this file except in compliance with the License.<br>
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing,<br>
* software distributed under the License is distributed on an "AS IS" BASIS, <br>
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <br>
* See the License for the specific language governing permissions and <br>
* limitations under the License.
* <p>
* Copyright (c) since 2004 at Multimedia- & E-Learning Services (MELS),<br>
* University of Zurich, Switzerland.
* <hr>
* <a href="http://www.openolat.org">
* OpenOLAT - Online Learning and Training</a><br>
* This file has been modified by the OpenOLAT community. Changes are licensed
* under the Apache 2.0 license as the original file.
*/
package
org.olat.core.configuration
;
import
java.io.File
;
import
org.olat.core.logging.StartupException
;
import
org.olat.core.util.FileUtils
;
import
org.springframework.beans.factory.config.PropertyPlaceholderConfigurer
;
import
org.springframework.core.io.ClassPathResource
;
import
org.springframework.core.io.Resource
;
/**
* Description:<br>
* this overwrites the default spring property placeholder configurator with our custom one
*
* <P>
* Initial Date: 01.02.2010 <br>
* @author guido
*/
public
class
OLATPropertyPlaceholderConfigurer
extends
PropertyPlaceholderConfigurer
{
private
String
localProps
=
"olat.local.properties"
;
private
final
String
INTRO
=
"************************************************************************************************\n"
+
"OLAT comes with default config values in olat.propeties and you can overwrite this properties "
+
"with a file called olat.local.properties which gets search on the classpath.\nThe classpath is searched in the following order: "
+
"WEB-INF/classes $CATALINA_HOME/lib .\n"
+
"\nTo have the local config outside of OLAT we recoment to use $CATALINA_HOME/lib folder for your configuration"
;
public
OLATPropertyPlaceholderConfigurer
()
{
//check at construction time whether the olat.local,properties file exists
//in not try to create an empty one, if this fails throw an exception
Resource
overwritePropertiesRes
=
new
ClassPathResource
(
localProps
);
if
(!
overwritePropertiesRes
.
exists
())
{
String
catalinaHome
=
System
.
getProperty
(
"catalina.home"
);
if
(
catalinaHome
==
null
)
{
String
msg
=
INTRO
+
"There is no "
+
localProps
+
" file in the classpath and I cannot figure out where to save one."
+
" Please save yourself an empty "
+
localProps
+
" file to your tomcat/lib/ directory"
+
"************************************************************************************************\n"
;
throw
new
StartupException
(
msg
);
}
File
props
=
new
File
(
catalinaHome
+
"/lib/"
+
localProps
);
FileUtils
.
save
(
props
,
""
,
"utf-8"
);
throw
new
StartupException
(
INTRO
+
"\n\nOLAT Created automatically an empty "
+
localProps
+
" file for you at \""
+
props
.
getAbsolutePath
()+
"\", just start OLAT again and your done!\n"
);
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment