blob: 66d31fa18b437e37e5f41f79819b54548976e1da (
plain) (
tree)
|
|
package dotty.tools
package dottydoc
package staticsite
trait ResourceFinder {
/** If, for some reason, the supplied default files cannot be found - this
* exception will be thrown in `layouts`.
*/
final case class ResourceNotFoundException(message: String) extends Exception(message)
protected def getResource(r: String): String =
Option(getClass.getResourceAsStream(r)).map(scala.io.Source.fromInputStream)
.map(_.mkString)
.getOrElse(throw ResourceNotFoundException(r))
}
|