Dotty Documentation

0.5.0-bin-SNAPSHOT

class File
extends Path with Chars

An abstraction for files. For character data, a Codec can be supplied at either creation time or when a method involving character data is called (with the latter taking precedence if supplied.) If neither is available, the value of scala.io.Codec.default is used.

[-] Constructors

File ( jpath: JPath )
File ( implicit constructorCodec: Codec )

[-] Members

[+] private implicit val constructorCodec : Codec
[+] override val creationCodec : Codec

Calls to methods requiring byte<->char transformations should be offered in a form which allows specifying the codec. When it is not specified, the one discovered at creation time will be used, which will always find the one in scala.io.Codec if no other is available. This can be overridden to use a different default.

[+] private val jpath : JPath
[+] override def addExtension ( ext: String ) : File
[+] def appendAll ( strings: [ String ] ) : Unit
[+] def bufferedOutput ( append: Boolean ) : BufferedOutputStream
[+] def bufferedWriter ( ) : BufferedWriter

Wraps a BufferedWriter around the result of writer().

[+] def bufferedWriter ( append: Boolean ) : BufferedWriter
[+] def bufferedWriter ( append: Boolean , codec: Codec ) : BufferedWriter
[+] def inputStream ( ) : InputStream

Obtains an InputStream.

[+] override def length : Long
[+] override def normalize : File
[+] def outputStream ( append: Boolean ) : OutputStream

Obtains a OutputStream.

[+] def printWriter ( ) : PrintWriter
[+] def printlnAll ( strings: [ String ] ) : Unit

Calls println on each string (so it adds a newline in the PrintWriter fashion.)

[+] def safeSlurp ( ) : Option [ String ]
[+] def setExecutable ( executable: Boolean , ownerOnly: Boolean ) : Boolean

Reflection since we're into the java 6+ API.

[+] override def toAbsolute : File
[+] override def toDirectory : Directory
[+] override def toFile : File
[+] override def walkFilter ( cond: Path => Boolean ) : Iterator [ Path ]
[+] def writeAll ( strings: [ String ] ) : Unit

Creates a new file and writes all the Strings to it.

[+] def writer ( append: Boolean , codec: Codec ) : OutputStreamWriter

Obtains an OutputStreamWriter wrapped around a FileOutputStream. This should behave like a less broken version of java.io.FileWriter, in that unlike the java version you can specify the encoding.