formatting

This commit is contained in:
Eugene Yokota 2019-04-28 17:27:24 -04:00
parent 2e3ceb2d92
commit 04197db2ec
2 changed files with 13 additions and 3 deletions

View File

@ -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

View File

@ -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