mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-09 15:05:50 +01:00
(refs #380)Close stream certainly
This commit is contained in:
@@ -43,7 +43,10 @@ trait SystemSettingsService {
|
|||||||
ldap.keystore.foreach(x => props.setProperty(LdapKeystore, x))
|
ldap.keystore.foreach(x => props.setProperty(LdapKeystore, x))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
props.store(new java.io.FileOutputStream(GitBucketConf), null)
|
using(new java.io.FileOutputStream(GitBucketConf)) {
|
||||||
|
out =>
|
||||||
|
props.store(out, null)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -51,7 +54,10 @@ trait SystemSettingsService {
|
|||||||
def loadSystemSettings(): SystemSettings = {
|
def loadSystemSettings(): SystemSettings = {
|
||||||
defining(new java.util.Properties()){ props =>
|
defining(new java.util.Properties()){ props =>
|
||||||
if(GitBucketConf.exists){
|
if(GitBucketConf.exists){
|
||||||
props.load(new java.io.FileInputStream(GitBucketConf))
|
using(new java.io.FileInputStream(GitBucketConf)) {
|
||||||
|
in =>
|
||||||
|
props.load(in)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
SystemSettings(
|
SystemSettings(
|
||||||
getOptionValue[String](props, BaseURL, None).map(x => x.replaceFirst("/\\Z", "")),
|
getOptionValue[String](props, BaseURL, None).map(x => x.replaceFirst("/\\Z", "")),
|
||||||
|
|||||||
Reference in New Issue
Block a user