mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-08 06:25:51 +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))
|
||||
}
|
||||
}
|
||||
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 = {
|
||||
defining(new java.util.Properties()){ props =>
|
||||
if(GitBucketConf.exists){
|
||||
props.load(new java.io.FileInputStream(GitBucketConf))
|
||||
using(new java.io.FileInputStream(GitBucketConf)) {
|
||||
in =>
|
||||
props.load(in)
|
||||
}
|
||||
}
|
||||
SystemSettings(
|
||||
getOptionValue[String](props, BaseURL, None).map(x => x.replaceFirst("/\\Z", "")),
|
||||
|
||||
Reference in New Issue
Block a user