mirror of https://github.com/sbt/sbt.git
formatting
This commit is contained in:
parent
2e3ceb2d92
commit
04197db2ec
|
|
@ -14,14 +14,20 @@ private[inc] object ResourceLoader {
|
|||
def getPropertiesFor(resource: String, classLoader: ClassLoader): Properties = {
|
||||
val properties = new java.util.Properties
|
||||
val propertiesStream = getClass.getResource(resource).openStream
|
||||
try { properties.load(propertiesStream) } finally { propertiesStream.close() }
|
||||
try {
|
||||
properties.load(propertiesStream)
|
||||
} finally {
|
||||
propertiesStream.close()
|
||||
}
|
||||
properties
|
||||
}
|
||||
|
||||
def getSafePropertiesFor(resource: String, classLoader: ClassLoader): Properties = {
|
||||
val properties = new Properties
|
||||
val propertiesStream = classLoader.getResourceAsStream(resource)
|
||||
try { properties.load(propertiesStream) } catch { case _: Exception => } finally {
|
||||
try {
|
||||
properties.load(propertiesStream)
|
||||
} catch { case _: Exception => } finally {
|
||||
if (propertiesStream ne null) propertiesStream.close()
|
||||
}
|
||||
properties
|
||||
|
|
|
|||
|
|
@ -122,7 +122,11 @@ object ZincComponentManager {
|
|||
lazy val (version, timestamp) = {
|
||||
val properties = new java.util.Properties
|
||||
val propertiesStream = versionResource.openStream
|
||||
try { properties.load(propertiesStream) } finally { propertiesStream.close() }
|
||||
try {
|
||||
properties.load(propertiesStream)
|
||||
} finally {
|
||||
propertiesStream.close()
|
||||
}
|
||||
(properties.getProperty("version"), properties.getProperty("timestamp"))
|
||||
}
|
||||
lazy val stampedVersion = version + "_" + timestamp
|
||||
|
|
|
|||
Loading…
Reference in New Issue