mirror of https://github.com/sbt/sbt.git
Small improvements to I/O
This commit is contained in:
parent
26da622276
commit
5fa328551c
|
|
@ -58,7 +58,7 @@ object NothingFilter extends NameFilter
|
|||
|
||||
object GlobFilter
|
||||
{
|
||||
def apply(expression: String): NameFilter =
|
||||
implicit def apply(expression: String): NameFilter =
|
||||
{
|
||||
require(!expression.exists(java.lang.Character.isISOControl), "Control characters not allowed in filter expression.")
|
||||
if(expression == "*")
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ trait OpenFile[T] extends OpenResource[File, T]
|
|||
val parent = file.getParentFile
|
||||
if(parent != null)
|
||||
FileUtilities.createDirectory(parent)
|
||||
translate("Error opening " + file + ": ") { openImpl(file) }
|
||||
openImpl(file)
|
||||
}
|
||||
}
|
||||
object OpenResource
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import java.io.File
|
|||
|
||||
object Paths
|
||||
{
|
||||
implicit def stringToPath(s: String): Path = new Path(new File(s))
|
||||
implicit def fileToPath(f: File): Path = new Path(f)
|
||||
implicit def pathToFile(p: Path): File = p.asFile
|
||||
implicit def filesToPaths(fs: Set[File]): Paths = new Paths(fs)
|
||||
|
|
|
|||
Loading…
Reference in New Issue