diff options
author | vlad <vlad@driver.xyz> | 2017-11-02 13:38:23 -0700 |
---|---|---|
committer | vlad <vlad@driver.xyz> | 2017-11-02 13:38:23 -0700 |
commit | 144d8da225d18584dbc19589ba735b84cf3b6637 (patch) | |
tree | 17f8f196f857ed1cb36399c9efd6c78ab4382fe1 /src/main/scala/xyz/driver/pdsuicommon/resources | |
parent | 022e55f0723cbb957e77a06e717e3df847abb00c (diff) | |
download | rest-query-144d8da225d18584dbc19589ba735b84cf3b6637.tar.gz rest-query-144d8da225d18584dbc19589ba735b84cf3b6637.tar.bz2 rest-query-144d8da225d18584dbc19589ba735b84cf3b6637.zip |
PDSUI-2329 Removing `isRationaleRequired` field from the `PatientHypothesis`v0.12.3
Diffstat (limited to 'src/main/scala/xyz/driver/pdsuicommon/resources')
-rw-r--r-- | src/main/scala/xyz/driver/pdsuicommon/resources/ResourcesStorage.scala | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/src/main/scala/xyz/driver/pdsuicommon/resources/ResourcesStorage.scala b/src/main/scala/xyz/driver/pdsuicommon/resources/ResourcesStorage.scala deleted file mode 100644 index 2be7ed7..0000000 --- a/src/main/scala/xyz/driver/pdsuicommon/resources/ResourcesStorage.scala +++ /dev/null @@ -1,36 +0,0 @@ -package xyz.driver.pdsuicommon.resources - -import scala.io.{Codec, Source} - -trait ResourcesStorage { - - /** - * @param resourcePath Don't forget / at start - */ - def getFirstLine(resourcePath: String): String -} - -object RealResourcesStorage extends ResourcesStorage { - - def getFirstLine(resourcePath: String): String = { - val resourceUrl = getClass.getResource(resourcePath) - Option(resourceUrl) match { - case Some(url) => - val source = Source.fromURL(resourceUrl)(Codec.UTF8) - try { - val lines = source.getLines() - if (lines.isEmpty) throw new RuntimeException(s"'$resourcePath' is empty") - else lines.next() - } finally { - source.close() - } - case None => - throw new RuntimeException(s"Can not find the '$resourcePath'!") - } - } -} - -object FakeResourcesStorage extends ResourcesStorage { - - def getFirstLine(resourcePath: String): String = "" -} |