<commit_before>package blended.mgmt.repo.rest.internal

import blended.mgmt.repo.ArtifactRepo
import blended.spray.BlendedHttpRoute
import org.slf4j.LoggerFactory
import spray.http.StatusCodes
import blended.security.spray.BlendedSecuredRoute

trait ArtifactRepoRoutes
    extends BlendedHttpRoute
    with BlendedSecuredRoute {

  private[this] val log = LoggerFactory.getLogger(classOf[ArtifactRepoRoutes])

  protected def artifactRepo: ArtifactRepo

  override val httpRoute = get { r =>
    requirePermission("artifact:get") {
      val path = r.unmatchedPath.toString()
      log.debug("Request for path: {}", path)

      artifactRepo.findFile(path) match {
        case Some(file) => getFromFile(file)
        case None => complete(StatusCodes.NotFound)
      }
    }
  }

}<commit_msg>Logging and explicit return type<commit_after>package blended.mgmt.repo.rest.internal

import blended.mgmt.repo.ArtifactRepo
import blended.spray.BlendedHttpRoute
import org.slf4j.LoggerFactory
import spray.http.StatusCodes
import blended.security.spray.BlendedSecuredRoute
import spray.routing.Route

trait ArtifactRepoRoutes
    extends BlendedHttpRoute
    with BlendedSecuredRoute { self =>

  private[this] val log = {
    val log = LoggerFactory.getLogger(classOf[ArtifactRepoRoutes])
    log.debug("Creating {}", self)
    log
  }

  protected def artifactRepo: ArtifactRepo

  override val httpRoute: Route = get { r =>
    requirePermission("artifact:get") {
      val path = r.unmatchedPath.toString()
      log.debug("Request for path: {}", path)

      artifactRepo.findFile(path) match {
        case Some(file) => getFromFile(file)
        case None => complete(StatusCodes.NotFound)
      }
    }
  }

}
{'fraction_non_alphanumeric': 0.09345794392523364, 'fraction_numerical': 0.0011682242990654205, 'mean_word_length': 3.979651162790698, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5222175', 'n_tokens_mistral': 524, 'n_tokens_neox': 519, 'n_words': 107}