o

geotrellis.util

Filesystem

object Filesystem

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Filesystem
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. def basename(path: String): String

    Return the path string with the final extension removed.

    Return the path string with the final extension removed.

    path

    The path whose extension is to be removed (if it has one)

    returns

    The path minus the extension

  2. def copy(source: File, target: File): Unit

    Copy the given file, obliterating any existing file that already has the target name.

    Copy the given file, obliterating any existing file that already has the target name.

    source

    The path to the file to be copied

    target

    The path to the place where the file is to be copied

  3. def copy(source: String, target: String): Unit

    Copy the given file, obliterating any existing file that already has the target name.

    Copy the given file, obliterating any existing file that already has the target name.

    source

    The path to the file to be copied

    target

    The path to the place where the file is to be copied

  4. def ensureDirectory(path: String): String

    Ensure the existence of a given directory.

    Ensure the existence of a given directory.

    path

    The path to the directory

  5. def exists(path: String): Boolean
  6. def join(parts: String*): String

    Join the given parts into a single string, with the parts separated by the system's file separator.

    Join the given parts into a single string, with the parts separated by the system's file separator.

    parts

    A list of parts which are to be concatenated

    returns

    The parts concatenated, separated by the file separator

  7. def mapToByteArray(path: String, data: Array[Byte], startIndex: Int, size: Int): Unit

    Make a contiguous chunk of a file available in the given array.

    Make a contiguous chunk of a file available in the given array.

    path

    The path to the file which is to be (partially) mapped into memory

    data

    An array to contain the portion of the file in question

    startIndex

    The offset into the file where the contiguous region begins

    size

    The size of the contiguous region

  8. def move(source: File, target: File): Unit

    Move (rename) the given file, obliterating any existing file that already has the target name.

    Move (rename) the given file, obliterating any existing file that already has the target name.

    source

    A java.nio.file.File representing the desired source

    target

    A java.nio.file.File representing the desired destination

  9. def move(source: String, target: String): Unit

    Move (rename) the given file, obliterating any existing file that already has the target name.

    Move (rename) the given file, obliterating any existing file that already has the target name.

    source

    The path to the file before moving

    target

    The path to the file after moving

  10. def readText(file: File): String

    Return the contents of a file, interpreted as text, as a string.

    Return the contents of a file, interpreted as text, as a string.

    file

    The the file to be read

    returns

    A string containing the file's contents

  11. def readText(path: String): String

    Return the contents of a file, interpreted as text, as a string.

    Return the contents of a file, interpreted as text, as a string.

    path

    The path to the file to be read

    returns

    A string containing the file's contents

  12. def slurp(path: String, bs: Int = 1<<18): Array[Byte]

    Read the contents of a file into an array.

    Read the contents of a file into an array.

    path

    The path to the file to be read

    bs

    The block size; The file will be read in chunks of this size

    returns

    An array of bytes containing the file contents

  13. def split(path: String): (String, String)

    Split the given path into a tuple of base and extension.

    Split the given path into a tuple of base and extension.

    path

    The path which is to be split

    returns

    A tuple of the basename and the extension of the given path

  14. def toMappedByteBuffer(path: String): ByteBuffer

    Read the contents of a file into a MappedByteBuffer.

    Read the contents of a file into a MappedByteBuffer.

    path

    The path to the file to be read

    returns

    A MappedByteBuffer containing the mapped file contents

  15. def writeBytes(path: String, bytes: Array[Byte]): Unit

    Write the given array of bytes to the file pointed to by the given path.

    Write the given array of bytes to the file pointed to by the given path. This is a truncating write.

    path

    The path to the file where the data are to be written

    bytes

    An array of bytes containing the data to be written

  16. def writeText(file: File, text: String): Unit

    Write the given text into a file.

    Write the given text into a file. This is a truncating write.

    text

    A string containing the text to be written

  17. def writeText(path: String, text: String): Unit

    Write the given text into the file pointed to by the given path.

    Write the given text into the file pointed to by the given path. The is a truncating write.

    path

    The path to the file where the text will be written

    text

    A string containing the text to be written