Object

com.malliina.file

FileUtilities

Related Doc: package file

Permalink

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
Visibility
  1. Public
  2. All

Value Members

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

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

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

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. var basePath: Path

    Permalink
  6. def clone(): AnyRef

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

    Permalink

    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

  8. def createFile(path: String): Unit

    Permalink

    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.Files, java.nio.file.Paths

  9. def diskUsagePercentage(path: Path): Int

    Permalink

    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

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  12. def fileToString(file: Path): String

    Permalink
  13. def finalize(): Unit

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

    Permalink

    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

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

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

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

    Permalink
  18. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  19. val lineSep: String

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

    Permalink
  21. def listPaths(basePath: Path): Seq[Path]

    Permalink

    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.

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

    Permalink
    Definition Classes
    AnyRef
  23. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  24. final def notifyAll(): Unit

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

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

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

    Permalink

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

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

    Permalink
  29. def rebase(file: Path, srcBase: Path, destBase: Path): Path

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

    Permalink

    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

  31. def stringToFile(str: String, file: Path): Unit

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

    Permalink
    Definition Classes
    AnyRef
  33. val tempDir: Path

    Permalink
  34. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  35. val userDir: Path

    Permalink
  36. val userDirString: String

    Permalink
  37. val userHome: Path

    Permalink
  38. def verifyFileReadability(file: Path): Unit

    Permalink
  39. final def wait(): Unit

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

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

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

    Permalink

    filename

    the file to write to

    op

    the file writing code

    See also

    http://stackoverflow.com/a/4608061

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

    Permalink

    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