All Downloads are FREE. Search and download functionalities are using the official Maven repository.

scala.build.preprocessing.PreprocessingUtil.scala Maven / Gradle / Ivy

package scala.build.preprocessing

import java.nio.charset.StandardCharsets

import scala.build.errors.{BuildException, FileNotFoundException}

object PreprocessingUtil {

  private def defaultCharSet = StandardCharsets.UTF_8

  def maybeRead(f: os.Path): Either[BuildException, String] =
    if (os.isFile(f)) Right(os.read(f, defaultCharSet))
    else Left(new FileNotFoundException(f))
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy