com.mle.util

FileUtilities

object FileUtilities

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. FileUtilities
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. var basePath: Path

  8. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. def copy(srcBase: Path, files: Set[Path], dest: Path): Set[Path]

    Copies the given files to a destination directory, where the files' subdirectory is calculated relative to the given base directory.

    Copies the given files to a destination directory, where the files' subdirectory is calculated relative to the given base directory.

    srcBase

    the base directory for the source files

    files

    the source files to copy

    dest

    the destination directory, so each source file is copied to dest / srcBase.relativize(file)

    returns

    the destination files

  10. def createFile(path: String): Unit

    Creates the file referenced by the specified path and any non-existing parent directories.

    Creates the file referenced by the specified path and any non-existing parent directories. No-ops if the file already exists.

    path

    the path to the file to create

    See also

    ), java.nio.file.Paths

  11. def diskUsagePercentage(path: Path): Int

    Calculates the amount of used disk space, in percentages, according to the formula: usable_space / total_space.

    Calculates the amount of used disk space, in percentages, according to the formula: usable_space / total_space. For example, if a 10 GB disk contains 3 GB of data, this method returns 30 for that disk.

    path

    the path to the disk or file store

    returns

    the amount of used disk space as a percentage [0,100] of the total disk space capacity, rounded up to the next integer

  12. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  13. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  14. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  15. def firstLine(path: Path): String

    Throws if the file doesn't exist/has no first line (?)

    Throws if the file doesn't exist/has no first line (?)

    path

    location of file

    returns

    the first line of the file at the specified location

  16. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  17. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  18. def init(appName: String): Unit

  19. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  20. val lineSep: String

  21. def listFiles(srcDir: Path, visitor: FileCollectingVisitor): Seq[Path]

  22. def listPaths(basePath: Path): Seq[Path]

    Performs a recursive search of files and directories under the given base path.

    Performs a recursive search of files and directories under the given base path.

    basePath

    the base directory

    returns

    The files and directories under the base directory. Directories precede any files they contain in the returned sequence.

  23. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  24. final def notify(): Unit

    Definition Classes
    AnyRef
  25. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  26. def pathTo(location: String): Path

  27. def propsToFile(props: String*): Seq[Path]

  28. def readerFrom[T](resource: String)(code: (Iterator[String]) ⇒ T): T

    Avoids io.

    Avoids io.Source.fromURI(uri) because it seems to fail unless the supplied URI points to a file.

    T
    resource
    code
    returns

  29. def readerFrom[T](path: Path)(code: (Iterator[String]) ⇒ T): T

  30. def rebase(file: Path, srcBase: Path, destBase: Path): Path

  31. def resourceToFile(resource: String): Option[Path]

    resource

    the resource to lookup and write to file

    returns

    the path wrapped in an option if it was written, None if no file was written because it already existed

  32. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  33. def toString(): String

    Definition Classes
    AnyRef → Any
  34. val userDir: Path

  35. val userDirString: String

  36. val userHome: Path

  37. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  38. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  39. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  40. def writerTo(filename: Path)(op: (PrintWriter) ⇒ Unit): Unit

    filename

    the file to write to

    op

    the file writing code

    See also

    http://stackoverflow.com/a/4608061

  41. def writerTo(filename: String)(op: (PrintWriter) ⇒ Unit): Path

    filename

    the file to write to

    op

    the file writing code

    See also

    http://stackoverflow.com/a/4608061

Inherited from AnyRef

Inherited from Any

Ungrouped