Packages

object File extends Serializable

This defines some very useful methods to interact with text files at a high abstraction level.

Source
File.scala
Linear Supertypes
Serializable, Serializable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. File
  2. Serializable
  3. Serializable
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def ReadLineWise(f: File)(proc: (String) ⇒ Unit): Unit

    convenience method to read a file line by line

    convenience method to read a file line by line

    f

    the file

    proc

    a function applied to every line (without line terminator)

  5. def Reader(f: File): BufferedReader

    convenience method to obtain a typical (buffered, UTF-8) reader for a file

    convenience method to obtain a typical (buffered, UTF-8) reader for a file

    If f does not exist, Compress.name(f) is tried and automatically decompressed.

  6. def WriteLineWise(f: File, lines: List[String]): Unit

    convenience method for writing a list of lines into a file

    convenience method for writing a list of lines into a file

    overwrites existing files, creates directories if necessary

    f

    the target file

    lines

    the lines (without line terminator - will be chosen by Java and appended)

  7. def Writer(f: File, compress: Boolean = false): StandardPrintWriter

    compress

    if true, the file is compressed while writing

  8. def append(f: File, strings: String*): Unit
  9. def apply(s: String): File

    constructs a File from a string, using the java.io.File parser

  10. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  11. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  12. def copy(from: File, to: File, replace: Boolean): Boolean

    copies a file

  13. def download(uri: URI, file: File): Unit

    dereference a URL and save as a file

  14. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  15. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  16. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  17. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  18. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  19. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  20. implicit def java2Scala(file: java.io.File): File

    implicit conversion Java <-> Scala

  21. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  22. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  23. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  24. def read(f: File): String

    convenience method for reading a file into a string

    convenience method for reading a file into a string

    f

    the source file

    returns

    s the file content (line terminators are \n)

  25. def readProperties(manifest: File): Map[String, String]
  26. def readPropertiesFromString(s: String): Map[String, String]
  27. implicit def scala2Java(file: File): java.io.File

    implicit conversion Java <-> Scala

  28. def stream(f: File, begin: String = "", sep: String = "", end: String = "")(work: ((String) ⇒ Unit) ⇒ Unit): Unit

    streams a list-like object to a file

    streams a list-like object to a file

    f

    the file to write to

    begin

    initial text

    sep

    text in between elements

    end

    terminal text

    work

    bind a variable "write" and call it to write into the file example: (l: List[Node]) => stream(f, "<root>", "\n", "</root>"){out => l map {a => out(a.toString)}}

  29. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  30. def toString(): String
    Definition Classes
    AnyRef → Any
  31. def unzip(from: File, toDir: File, skipRootDir: Boolean = false): Unit

    unzips a file

  32. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  33. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  34. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  35. def write(f: File, strings: String*): Unit

    convenience method for writing a string into a file

    convenience method for writing a string into a file

    overwrites existing files, creates directories if necessary

    f

    the target file

    strings

    the content to write

Inherited from Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped