scalax.file

Path

abstract class Path extends FileOps with PathFinder[Path] with Ordered[Path]

A file reference that locates a file using a system independent path. The file is not required to exist.

Self Type
Path
Since

0.1

Linear Supertypes
Ordered[Path], Comparable[Path], PathFinder[Path], FileOps, Seekable, Output, Input, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Path
  2. Ordered
  3. Comparable
  4. PathFinder
  5. FileOps
  6. Seekable
  7. Output
  8. Input
  9. AnyRef
  10. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Path(fileSystem: FileSystem)

Abstract Value Members

  1. abstract def /(child: String): PathType

    If child is relative, creates a new Path based on the current path with the child appended.

    If child is relative, creates a new Path based on the current path with the child appended. If child is absolute the child is returned

    <

    • if other is null return this
    • if other is absolute return other
    • if other is not absolute the return this append other

    @note child is a single child if it contains a path separator it will NOT be considered a separator character

    Examples include:

    
    path / "child" / "grandchild"
    path / ".." / "sibling"
    
    

    Illegal examples include;

    
    path / "child/grandchild"
    path / "../sibling"
    
    
    In these cases an exception will be thrown

    returns

    A new path with the specified path appended

    Definition Classes
    PathPathFinder
    See also

    #\(String)

  2. abstract def access_=(accessModes: Iterable[AccessMode]): Unit

    Sets the standard access modes on the underlying path.

    Sets the standard access modes on the underlying path. If the underlying object does not exist it will throw an exception. If the underlying system does not support support the mode the mode will be ignored

    accessModes

    the modes to set on the file in (if possible) a single atomic update

  3. abstract def channel(openOptions: OpenOption*): SeekableByteChannelResource[SeekableByteChannel]

    Obtains a ByteChannel for read/write access to the file.

    Obtains a ByteChannel for read/write access to the file. If no OpenOptions are specified the underlying file will be opened with read/write/create/truncate options.

    The Resource will be configured with the associated fileSystem's ResourceContext

    All OpenOption can be used

    openOptions

    the options that define how the file is opened when using the stream Default is options only

    Definition Classes
    FileOps
  4. abstract def checkAccess(modes: AccessMode*): Boolean

    Check if the referenced file both exists and be accessed with the requested modes

    Check if the referenced file both exists and be accessed with the requested modes

    modes

    the modes to check for on the file. If empty then only existance is checked

    returns

    true if all modes are available on the file

  5. abstract def delete(force: Boolean = false): Path.this.type

    Deletes the file or throws an IOException on failure

    Deletes the file or throws an IOException on failure

    force

    if the file is write protected force will override the write protection and delete the file. If not force then an IOException will be thrown indicating failure of deletion. Default is false

    returns

    this

    Exceptions thrown
    IOException

    if the file could not be deleted

  6. abstract def descendants[U >: Path, F](filter: F = PathMatcher.All, depth: Int = 1, options: Traversable[LinkOption] = Nil)(implicit factory: PathMatcherFactory[F]): PathSet[Path]

    An iterable that traverses all the elements in the directory tree down to the specified depth

    An iterable that traverses all the elements in the directory tree down to the specified depth

    The filter parameter is a function because the PathSet can return files from many directories. The function provides the mechanism for declaring which PathMatcher to use at each level. The two parameters are original path and the path to be visited relative to the original path. By default the function always returns None.

    If the depth parameter is non-negative then that restricts the depth that will be traversed. The value 0 will not return any elements, depth = 1 is essentially the path#directoryStream(Option,Boolean) method and values < 0 will return all elements at any depth.

    The traversal order is pre-order.

    No exceptions will be thrown by this method if it is called and the Path is a File or does not exist. Instead the PathSet will throw a NotDirectoryException when a method is called and the underlying object is not a Directory.

    filter

    A filter that restricts what paths are available in the PathSet If the filter is a PathMatcher and the underlying filesystem supports the PatchMatcher implementation then the maximum performance will be achieved. All Paths that are passed to matcher is relative to this Path Default is PathMatcher.All

    depth

    How deep down the tree to traverse 1 is just visit the objects in the directory negative values will visit entire tree Default is -1

    returns

    A managed resource managing a PathSet.

    See also

    FileSystem#matcher(String,String)

    Path.Matching

    Path#directoryStream(Option,Boolean)

  7. abstract def doCreateDirectory(): Boolean

    NOT PUBLIC API: Create a directory for the current path without considering if the parents has been previously created.

    NOT PUBLIC API: Create a directory for the current path without considering if the parents has been previously created. This method should fail if the parent does not exist

    Attributes
    protected
  8. abstract def doCreateFile(): Boolean

    NOT PUBLIC API: Create a file for the current path without considering if the parents has been previously created.

    NOT PUBLIC API: Create a file for the current path without considering if the parents has been previously created. This method should fail if the parent does not exist

    Attributes
    protected
  9. abstract def doCreateParents(): Unit

    NOT PUBLIC API: Create all parent directories of the current Path

    NOT PUBLIC API: Create all parent directories of the current Path

    Attributes
    protected
  10. abstract def exists: Boolean

    True if the path exists in the file system

    True if the path exists in the file system

    returns

    true if the path exists in the file system

    See also

    java.file.File#exists

  11. abstract def fileChannel(openOptions: OpenOption*): Option[SeekableByteChannelResource[SeekableByteChannel]]

    Obtains a FileChannel for read/write access to the file.

    Obtains a FileChannel for read/write access to the file. Not all filesystems can support FileChannels therefore None will be returned if the filesystem does not support FileChannels. If no OpenOptions are specified the underlying file will be opened with read/write/create/truncate options

    All OpenOption can be used

    The Resource will be configured with the associated fileSystem's ResourceContext

    openOptions

    the options that define how the file is opened when using the stream Default is read/write/create/truncate

    Definition Classes
    FileOps
  12. abstract def inputStream(): InputStreamResource[InputStream]

    Obtains an input stream resource for reading from the file

    Obtains an input stream resource for reading from the file

    The Resource will be configured with the associated fileSystem's ResourceContext

    Definition Classes
    FileOps
  13. abstract def isAbsolute: Boolean

    True is the file is absolute.

    True is the file is absolute. IE is rooted at a filesystem root

    returns

    true if file is absolute.

    See also

    java.file.File#isAbsolute

  14. abstract def isDirectory: Boolean

    True if the path exists and is a directory

    True if the path exists and is a directory

    returns

    true if the path exists and is a directory

    See also

    java.file.File#isDirectory

  15. abstract def isFile: Boolean

    True if the path exists and is a file

    True if the path exists and is a file

    returns

    true if the path exists and is a file

    See also

    java.file.File#isFile

  16. abstract def isHidden: Boolean

    True if the file is a hidden file for the current filesystem

    True if the file is a hidden file for the current filesystem

    returns

    True if the file is a hidden file for the current filesystem

    See also

    java.file.File#isHidden()

  17. abstract def lastModified: Long

    The time of the last modification of the file

    The time of the last modification of the file

    returns

    the time modified or -1 if not applicable for fileSystem

    See also

    java.file.File#getLastModified()

  18. abstract def lastModified_=(time: Long): Long

    Set the last time modified of the file

    Set the last time modified of the file

    returns

    the new time

    See also

    java.file.File#setLastModified(Long)

  19. abstract def moveDirectory(target: Path, atomicMove: Boolean): Unit

    Called to move the current directory to another location on the same filesystem

    Called to move the current directory to another location on the same filesystem

    Attributes
    protected
  20. abstract def moveFile(target: Path, atomicMove: Boolean): Unit

    Called to move the current file to another location on the same filesystem

    Called to move the current file to another location on the same filesystem

    Attributes
    protected
  21. abstract def name: String

    The name of the file.

    The name of the file. This includes the extension of the file

    returns

    the name of the file

  22. abstract def outputStream(openOptions: OpenOption*): OutputStreamResource[OutputStream]

    Obtains an OutputStreamResource for writing to the file

    Obtains an OutputStreamResource for writing to the file

    The Resource will be configured with the associated fileSystem's ResourceContext

    All OpenOption can be used except Read which will be ignored if present

    openOptions

    the options that define how the file is opened when using the stream The Write option is implicitly added to the set of options Default is write/create/truncate

    Definition Classes
    FileOps
  23. abstract def parent: Option[Path]

    The parent path segment if it is possible (for example a root will not have a parent)

    The parent path segment if it is possible (for example a root will not have a parent)

    returns

    the parent path segment if it possible

    See also

    parents

  24. abstract def path: String

    The path of the file.

    The path of the file. It may or may not be relative

    returns

    the path of the file

  25. abstract def size: Option[Long]

    The size of the file/directory in bytes

    The size of the file/directory in bytes

    returns

    The size of the file/directory in bytes

    Definition Classes
    Path → Input
    See also

    java.file.File#length()

  26. abstract def toAbsolute: PathType

    Modifies the Path so that it is absolute from a root of the file system.

    Modifies the Path so that it is absolute from a root of the file system. However it is not necessarily canonical. For example /home/user/../another is a valid absolute path.

    See also

    normalize

  27. abstract def toRealPath(linkOptions: LinkOption*): PathType

    The true/real representation of the current path.

    The true/real representation of the current path.

    The full and true path of this path will be resolved, links will be handled according to the link options . and .. etc... will be resolved and if this path is relative it will be made absolute.

    If no linkOptions are supplied this method will follow links

    linkOptions

    How to handle link options

    returns

    the real path

    Note

    in Java 6 linkOptions are ignored because only Java.io.File apis are used but in Java 7 linkOptions are correctly handled

  28. abstract def toURI: URI

    Creates a URI from the path.

    Creates a URI from the path.

    See also

    java.file.File#toURI

  29. abstract def withLock[R](start: Long = 0, size: Long = 1, shared: Boolean = false, context: ResourceContext = fileSystem.context)(block: (Seekable) ⇒ R): Option[R]

    Performs an operation on the file with a FileLock

    Performs an operation on the file with a FileLock

    Not all filesystems support locking. If not then None will be returned by the method

    The defaults will lock the entire file with an exclusive lock. It is possible to modify the lock so that it only locks part of the file and may be a shared lock. Not all filesystems support shared locks but if that is the case the lock will automatically be upgraded to a exclusiveLock

    The semantics of this locking behavious are very similar to those in the java.nio.channels.FileLock It is recommended that those javadocs are read and the warnings present in those docs are followed.

    start

    the start position of the lock. Must be a non-negative Long

    size

    the length in bits the lock. If -1 then the entire file from start to the end will be locked

    shared

    If true then a shared lock will be obtained if possible. If shared locks are not supported then an exclusive lock will be obtained

    context

    The context for controlling buffer sizes error handling and other low level configuration

    returns

    the result the result from the block or None if the filesystem does not support locking

    Definition Classes
    FileOps

Concrete Value Members

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

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

    Definition Classes
    AnyRef → Any
  3. def *[F](filter: F)(implicit factory: PathMatcherFactory[F]): PathSet[Path]

    Constructs a new finder that selects all paths with a name that matches filter and are immediate children of paths selected by this finder.

    Constructs a new finder that selects all paths with a name that matches filter and are immediate children of paths selected by this finder.

    Definition Classes
    PathPathFinder
  4. def **[F](filter: F)(implicit factory: PathMatcherFactory[F]): PathSet[Path]

    Constructs a new finder that selects all paths with a name that matches filter and are descendants of paths selected by this finder.

    Constructs a new finder that selects all paths with a name that matches filter and are descendants of paths selected by this finder.

    Definition Classes
    PathPathFinder
  5. def ***: PathSet[Path]

    Definition Classes
    PathPathFinder
  6. def +++[U >: Path](includes: PathFinder[U]): PathSet[U]

    The union of the paths found by this PathSet with the paths found by 'paths'.

    The union of the paths found by this PathSet with the paths found by 'paths'. Note that if the same element is added twice it will be present twice in the PathFinder (in most implementations). Consider: (Path("a") +++ Path("a")).iterator. the iterator will return Path("a") twice.

    Definition Classes
    PathPathFinder
  7. def ---[U >: Path](excludes: PathFinder[U]): PathSet[Path]

    Excludes all paths from excludes from the paths selected by this PathSet.

    Excludes all paths from excludes from the paths selected by this PathSet.

    Definition Classes
    PathPathFinder
  8. final def /(child: Path): PathType

    Alias for /(child.

    Alias for /(child.name)

    returns

    A new path with the specified path appended

    See also

    #/(String)

  9. def /(pathRepresentation: String, separator: Char): PathType

    Add several children to this path.

    Add several children to this path. The sep character will be used to split the path string, A path will be created from the resulting sequence and finally all children will be added to this path.

    Examples:

    path / ("a,c,d,e", ',') // results in path / a / c / d / e
    path / ("/a/b/c/d/", '/') // results in path / a / b / c / d
    path / ("//../a","/") // results in path / .. / a
    
    path / ("/a",',') // results in an exception if / == Path.separator
    path / ("//",'/') // returns same Path
  10. def <(that: Path): Boolean

    Definition Classes
    Ordered
  11. def <=(that: Path): Boolean

    Definition Classes
    Ordered
  12. final def ==(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  13. def >(that: Path): Boolean

    Definition Classes
    Ordered
  14. def >=(that: Path): Boolean

    Definition Classes
    Ordered
  15. final def \(child: Path): PathType

    Alias for /(Path)

    Alias for /(Path)

    See also

    #/(Path)

  16. def \(pathRepresentation: String, separator: Char): PathType

  17. def \(child: String): PathType

    Alias for /(String)

    Alias for /(String)

    Definition Classes
    PathPathFinder
    See also

    /(String)

  18. def access: AccessSet

    Reads the access modes from the file and returns the Set This does not lock the file so the modes could be out of date even by the time the method returns if used in a heavily parallel environment

    Reads the access modes from the file and returns the Set This does not lock the file so the modes could be out of date even by the time the method returns if used in a heavily parallel environment

    returns

    the access modes set on the file

  19. def access_=(accessModes: String): Unit

    Short cut for setting the standard access modes on the underlying path.

    Short cut for setting the standard access modes on the underlying path. If the underlying object does not exist it will throw an exception. If the underlying system does not support support the mode the mode will be ignored

    accessModes

    string representation of the modes. The standard options include r - read, w - write, e - execute. The options are filesystem dependent

  20. def append(string: String)(implicit codec: Codec): Unit

    Definition Classes
    Seekable
  21. def append[T](data: T)(implicit converter: OutputConverter[T]): Unit

    Definition Classes
    Seekable
  22. def appendChannel[U](f: (SeekableByteChannel) ⇒ U): U

    Attributes
    protected
    Definition Classes
    Seekable
  23. def appendIntsAsBytes(data: Int*): Unit

    Definition Classes
    Seekable
  24. def appendStrings(strings: Traversable[String], separator: String)(implicit codec: Codec): Unit

    Definition Classes
    Seekable
  25. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  26. def assertExists: Unit

    Attributes
    protected
  27. def attributes: Set[FileAttribute[_]]

  28. def attributes_=(attrs: TraversableOnce[FileAttribute[_]]): Unit

  29. def blocks(blockSize: Option[Int]): LongTraversable[ByteBlock]

    Definition Classes
    Seekable → Input
  30. def byteArray: Array[Byte]

    Definition Classes
    Input
  31. def bytes: LongTraversable[Byte]

    Definition Classes
    Seekable → Input
  32. def bytesAsInts: LongTraversable[Int]

    Definition Classes
    Seekable → Input
  33. def canExecute: Boolean

  34. def canRead: Boolean

  35. def canWrite: Boolean

  36. def chars(implicit codec: Codec): LongTraversable[Char]

    Definition Classes
    FileOps → Seekable → Input
  37. def checkAccess(modes: String): Boolean

    Check modes using the rwx characters.

    Check modes using the rwx characters. The string can be from 1-3 characters long and can be r w x in any order. Spaces are ignored

  38. def children[U >: Path, F](filter: F = PathMatcher.All, options: Traversable[LinkOption] = Nil)(implicit factory: PathMatcherFactory[F]): PathSet[Path]

    An iterable over the contents of the directory.

    An iterable over the contents of the directory. This is simply walkTree with depth=1.

    The filter parameter restricts what paths are available through the PathSet. This is different from using the filter, filterFold or filterEach methods in PathSet because PathMatchers can be used by the underlying filesystem natively and can potentially provide dramatically improved performance for very large directories.

    filter

    A filter that restricts what paths are available in the PathSet If the filter is a PathMatcher and the underlying filesystem supports the PatchMatcher implementation then the maximum performance will be achieved. All Paths that are passed to matcher is relative to this Path Default is PathMatcher.All

    returns

    A managed resource managing a PathSet.

    See also

    FileSystem#matcher(String,String)

    Path.Matching

    Path#walkTree

  39. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  40. def compare(other: Path): Int

    Compares this path to the other lexigraphically.

    Compares this path to the other lexigraphically.

    Definition Classes
    Path → Ordered
  41. def compareTo(that: Path): Int

    Definition Classes
    Ordered → Comparable
  42. def context: ResourceContext

    Definition Classes
    Path → Seekable → Input
  43. def copyDataTo(output: Output): Unit

    Definition Classes
    Path → Input
  44. def copyTo[P <: Path](target: P, createParents: Boolean = true, copyAttributes: Boolean = true, replaceExisting: Boolean = false, depth: Int = Int.MaxValue): P

    Copy the underlying object if it exists to the target location.

    Copy the underlying object if it exists to the target location. If the underlying object is a directory it is not copied recursively.

    target

    the target path to copy the filesystem object to.

    copyAttributes

    if true then copy the File attributes of the object as well as the data. True by default

    replaceExisting

    if true then replace any existing target object unless it is a non-empty directory in which case an IOException is thrown. False by default

    depth

    The depth of the copy if the path is a Directory. A depth of 0 means only the current Path is copied A depth of 1 means all children are copied as well, etc... default is entire tree

    returns

    the path to the new copy

    Exceptions thrown
    IOException

    if the copy could not be satisfied because the target could not be written to or if this path cannot be copied

  45. def createDirectory(createParents: Boolean = true, failIfExists: Boolean = true, accessModes: Iterable[AccessMode] = List(Read,Write,Execute), attributes: TraversableOnce[FileAttribute[_]] = Nil): PathType

    Create the directory referenced by this path.

    Create the directory referenced by this path.

    If failIfExists then IOException is thrown if the file already exists. In the next Java 7 only version it will throw FileAlreadyExistsException

    An exception is always thrown if the file is a directory and that directory contains children

    An exception will also be thrown if the parent directory does not have write permission

    createParents

    If true then the containing directories will be created if they do not exist Default is true

    failIfExists

    If true and an object exists then an exception will be thrown If false then the object will be deleted if possible If not possible to delete the object or it is a non-empty directory an exception will be thrown Default is true

    accessModes

    The access modes that to set on the file Default is Read,Write

    attributes

    Filesystem specific attributes to fromString to the file Ignored unless on Java 7+ JVM

    Exceptions thrown
    IOException

    if file or directory already exists. In the next Java 7 only version it will throw FileAlreadyExistsException If the process does not have write permission to the parent directory If parent directory does not exist

  46. def createFile(createParents: Boolean = true, failIfExists: Boolean = true, accessModes: Iterable[AccessMode] = List(Read,Write), attributes: TraversableOnce[FileAttribute[_]] = Nil): PathType

    Create the file referenced by this path.

    Create the file referenced by this path.

    If failIfExists then IOException is thrown if the file already exists. In the next Java 7 only version it will throw FileAlreadyExistsException

    An exception is always thrown if the file is a directory and that directory contains children

    An Exception will also be thrown if the parent directory does not have write permission

    createParents

    If true then the containing directories will be created if they do not exist Default is true

    failIfExists

    If true and an object exists then an exception will be thrown If false then the object will be deleted if possible If not possible to delete the object or it is a non-empty directory an exception will be thrown Default is true

    accessModes

    The access modes that to set on the file Default is Read,Write

    attributes

    Filesystem specific attributes to fromString to the file Ignored unless on Java 7+ JVM

    Exceptions thrown
    IOException

    If file or directory already exists. In the next Java 7 only version it will throw FileAlreadyExistsException If the process does not have write permission to the parent directory If parent directory does not exist

  47. def deleteIfExists(force: Boolean = false): Boolean

    Delete the filesystem object if the file exists.

    Delete the filesystem object if the file exists.

    If the file exists and is a non-empty Directory or there is some other reason the operation cannot be performed an IOException will be thrown.

    If the file does not exist it will return false

    force

    if the file is write protected force will override the write protection and delete the file. If not force then an IOException will be thrown indicating failure of deletion. Default is false

    Exceptions thrown
    IOException

    if the file cannot be written or if there is some other reason the file cannot be deleted. For example if the file is a non-empty directory

  48. def deleteRecursively(force: Boolean = false, continueOnFailure: Boolean = false): (Int, Int)

    Deletes the directory recursively.

    Deletes the directory recursively.

    This method does not detect circular directory graphs and does not promise to perform the delete in an atomic operation

    Use with caution!

    force

    if the file is write protected force will override the write protection and delete the file. If not force then an IOException will be thrown indicating failure of deletion. Default is false

    continueOnFailure

    If false then method will throw an exception when encountering a file that cannot be deleted. Otherwise it will continue to delete all the files that can be deleted. Note: this method is not transactional, all files visited before failure are deleted.

    returns

    Tuple with (The number of files deleted, The number of files remaining)

    Exceptions thrown
    IOException

    when continueOnFailure is false and a file cannot be deleted

  49. def doCopyFrom(input: Input): Unit

    Definition Classes
    Path → Output
  50. def endsWith(other: Path): Boolean

    True if this path ends with the other path

    True if this path ends with the other path

    returns

    True if this path ends with the other path

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

    Definition Classes
    AnyRef
  52. def equals(other: Any): Boolean

    Definition Classes
    Path → AnyRef → Any
  53. lazy val extension: Option[String]

    The extension of the name of the path, if it exists.

    The extension of the name of the path, if it exists. if name ends with an extension (e.g. "foo.jpg") returns the extension ("jpg")

    returns

    the extension of the path

  54. def fileOption: Option[File]

    Return a java.

    Return a java.io.File if possible

  55. val fileSystem: FileSystem

  56. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  57. final def getClass(): Class[_]

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

    Definition Classes
    Path → AnyRef → Any
  59. def insert[T](position: Long, data: T)(implicit converter: OutputConverter[T]): Any

    Definition Classes
    Seekable
  60. def insert(position: Long, string: String)(implicit codec: Codec): Unit

    Definition Classes
    Seekable
  61. def insertIntsAsBytes(position: Long, data: Int*): Any

    Definition Classes
    Seekable
  62. def isFresher(other: Path): Boolean

    True if this path has been modified more recently than other.

    True if this path has been modified more recently than other. If this file does not exist it is not fresh than other

    returns

    True if this path has been modified more recently than other.

  63. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  64. def isSame(other: Path): Boolean

    True if this path and the other path reference the same file.

    True if this path and the other path reference the same file.

    This means the two paths may have different segments and perhaps even have symlinks in the path but if they reference the same file then this will return true. Use equals to test if the paths are the same

    returns

    True if this path and the other path reference the same file.

  65. def isSymlink: Boolean

    True if the file is a symlink.

    True if the file is a symlink.

    This method is generally correct but depending the filesystem there is a possibility of getting the the incorrect result since the canonical and absolute paths are compared and no native code is used. Future versions will be guaranteed to work correctly but this version cannot be because of limitations of the VM.

    returns

    True if the file is a symlink.

  66. def iterator: Iterator[Path]

    Definition Classes
    PathPathFinder
  67. def lines(terminator: Terminator, includeTerminator: Boolean)(implicit codec: Codec): LongTraversable[String]

    Definition Classes
    Input
  68. def matcher(pattern: String, syntax: String = PathMatcher.StandardSyntax.GLOB): PathMatcher[Path]

    Create a matcher from this path's filesystem

    Create a matcher from this path's filesystem

    See also

    FileSystem # matcher ( String, String )

  69. def moveTo[P <: Path](target: P, replace: Boolean = false, atomicMove: Boolean = false): P

    Move the underlying object if it exists to the target location.

    Move the underlying object if it exists to the target location.

    If copying of the file is required this will happen, as long as atomicMove = false. If atomicMove = true and the move requires copy then deletion an exception will be thrown. This is filesystem dependent

    target

    the target path to move the filesystem object to.

    replace

    if true then replace any existing target object unless it is a non-empty directory in which case an IOException is thrown. False by default

    atomicMove

    it will guarantee atomicity of the move False by default

    returns

    true the path to the moved object

    Exceptions thrown
    IOException

    if the move could not be satisfied because the target could not be written to or if this path cannot be moved

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

    Definition Classes
    AnyRef
  71. def nonExistent: Boolean

    False if the path does not exist in the file system

    False if the path does not exist in the file system

    returns

    false if the path does not exist in the file system

  72. lazy val normalize: PathType

    Returns the related Path that starts at a root of the file system and is the direct path with all relative segments are resolved.

    Returns the related Path that starts at a root of the file system and is the direct path with all relative segments are resolved.

    For example /home/user/../another is not a valid normalized path.

    See also

    java.file.File#toCanonical

    #toAbsolute

  73. final def notify(): Unit

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

    Definition Classes
    AnyRef
  75. def outputProcessor: OutputProcessor

    Definition Classes
    Output
  76. lazy val parents: Seq[Path]

    The path segments of the path excluding the current path segment.

    The path segments of the path excluding the current path segment. The first segment is the first segment in the path.

    returns

    The path segments of the path excluding the current path segment

    See also

    segments

  77. def patch[T](position: Long, data: T, overwrite: Overwrite)(implicit converter: OutputConverter[T]): Unit

    Definition Classes
    Seekable
  78. def patch(position: Long, string: String, overwrite: Overwrite)(implicit codec: Codec): Unit

    Definition Classes
    Seekable
  79. def patchIntsAsBytes(position: Long, overwrite: Overwrite, data: Int*): Unit

    Definition Classes
    Seekable
  80. def readWriteChannel[U](f: (SeekableByteChannel) ⇒ U): U

    Attributes
    protected
    Definition Classes
    Seekable
  81. def relativize(other: Path): Path

    Make the current path relative to the other path.

    Make the current path relative to the other path. If the two paths are on different drives then the other path is returned. If the two paths have different roots the other path is returned. If the two paths reference the same path then the other path is returned

    returns

    relative path from the current path to the other path

  82. def resolve(pathSegments: String*): PathType

    Constructs a path from other using the same file system as this path and resolves the this and other in the same manner as Path#resolve(Path)

    Constructs a path from other using the same file system as this path and resolves the this and other in the same manner as Path#resolve(Path)

    Examples:

    path resolve ("a/b/c",'/') // result is Path / a / b / c
    path resolve ("//..//b//",'/') // result is Path / .. / b
    pathSegments

    the path segments that make up the path

    returns

    a path resolved as a child of this

  83. def resolve(other: String, separator: Char): PathType

    Constructs a path from other using the same file system as this path and resolves the this and other in the same manner as Path#resolve(Path)

    Constructs a path from other using the same file system as this path and resolves the this and other in the same manner as Path#resolve(Path)

    Examples:

    path resolve ("a/b/c",'/') // result is Path / a / b / c
    path resolve ("//..//b//",'/') // result is Path / .. / b
    other

    the string representation of the path with segment separators as indicated by separator

    separator

    the separator character used in other

    returns

    a path resolved as a child of this

  84. def resolve(other: Path): PathType

    Resolve this path with other.

    Resolve this path with other. In the simplest case that means appending other to this.

    Does the same thing as the / method

    other

    another path to append to this path

    returns

    the constructed/resolved path

  85. lazy val root: Option[PathType]

    The root of the file system of the path if it can be determined.

    The root of the file system of the path if it can be determined.

    returns

    the root of the file system

  86. def seekableProcessor(openOptions: Seq[OpenOption] = List(Read,Write), context: ResourceContext = fileSystem.context): SeekableProcessor

    Runs several operations as efficiently as possible.

    Runs several operations as efficiently as possible. If the filesystem permits random access then the same channel will be used to perform all operations.

    Note: only the direct file operations (bytes,lines,write,patch etc...) can be used and expected to use the same resource. The resource methods all created new streams.

    Note: not all file systems support this, if not then at worst the performance is the same as if they where performed outside an open block

    openOptions

    The options that define how the file is opened for the duration of the operation Default is Write/Create/Truncate

    context

    The context for controlling buffer sizes error handling and other low level configuration defaults to filesystem Resource context

    Definition Classes
    FileOps
  87. def seekableProcessor: SeekableProcessor

    Definition Classes
    Seekable
  88. lazy val segments: Seq[String]

    The segments in the path including the current element of the path.

    The segments in the path including the current element of the path. If the the path is relative only the segments defined are returned... NOT the absolute path

    Note segments.last should == name

    returns

    the segments in the path

  89. val separator: String

    The path segment separator string for the filesystem

    The path segment separator string for the filesystem

    See also

    FileSystem#separator

  90. def sibling(pathSegments: String*): PathType

    Resolves other against this path's parent in the same manner as sibling(Path)

    Resolves other against this path's parent in the same manner as sibling(Path)

    pathSegments

    the path from parent to the sibling.

    returns

    a path resolved as a child of parent or other if there is no parent

  91. def sibling(other: String, separator: Char): PathType

    Resolves other against this path's parent in the same manner as sibling(Path)

    Resolves other against this path's parent in the same manner as sibling(Path)

    other

    the path from parent to the sibling.

    separator

    the separator character that is used in other

    returns

    a path resolved as a child of parent or other if there is no parent

  92. def sibling(other: Path): PathType

    Resolves other against this path's parent in the same manner as in resolve(Path).

    Resolves other against this path's parent in the same manner as in resolve(Path).

    If parent does not exist fileSystem.fromSeq(other.segments) will be returned. Otherwise parent.resolve(other) will be returned

    other

    the path from parent to the sibling.

    returns

    a path resolved as a child of parent or None if parent is None

  93. def simpleName: String

    The name of the file excluding of the file

    The name of the file excluding of the file

    returns

    name of the file excluding of the file

  94. def startsWith(other: Path): Boolean

    True if this path starts with the other path

    True if this path starts with the other path

    returns

    True if this path starts with the other path

  95. def string(implicit codec: Codec): String

    Definition Classes
    Input
  96. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  97. def tempFile(): Path

    Attempts to obtain a secured PathSet.

    Attempts to obtain a secured PathSet. This method and the associated secureTree are intended to be used for security sensitive operations that need to access and/or traverse directory structures in a race free manner.

    Not all filesystems can support this, if not then None will be returned. Using this method will ensure that during the duration of an operation on the PathSet no external processes are able to modify the directory.

    The stream can also be used as a "virtual" working directory

    No exceptions will be thrown by this method if it is called and the Path is a File or does not exist. Instead the PathSet will throw a NotDirectoryException when a method is called and the underlying object is not a Directory.

    Note: calling this method does not lock the directory. Only performing operations on the SecureDirectoryStream will lock the directory.

    For Example:

    
    val tree = path.walkTree()
    // directory is not yet locked
    tree.foreach {
      // now the directory is locked
      println _
    }
    // directory has been unlocked
    
    
    
    
    @param filter
             A filter that restricts what paths are available in the PathSet.
             The directoryStream methods explains why this is often the efficient method
             for filtering directories
             Default is None
    @return
             A managed resource managing a PathSet.
    
    @see Path#directoryStream(Option)
    @see Path#secureTree(Function2,Int)
    

    Attributes
    protected
    Definition Classes
    Path → Seekable
  98. def toByteChannelResource(): InputResource[ByteChannel]

    Attributes
    protected
    Definition Classes
    FileOps → Seekable
  99. def toString(): String

    Definition Classes
    Path → AnyRef → Any
  100. def toURL: URL

    Creates a URL from the path.

    Creates a URL from the path. This does have the bug present in java.file.File#toURL and can be used directly.

    See also

    java.file.File#toURI

  101. def truncate(position: Long): Unit

    Definition Classes
    Seekable
  102. def truncateString(position: Long)(implicit codec: Codec): Unit

    Definition Classes
    Seekable
  103. def underlyingChannel(append: Boolean): OpenedResource[SeekableByteChannel]

    Attributes
    protected
    Definition Classes
    FileOps → Seekable
  104. def underlyingOutput: OutputResource[WritableByteChannel]

    Attributes
    protected
    Definition Classes
    FileOps → Seekable → Output
  105. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  108. def write(string: String)(implicit codec: Codec): Unit

    Definition Classes
    Output
  109. def write[T](data: T)(implicit writer: OutputConverter[T]): Unit

    Definition Classes
    Output
  110. def writeChars(characters: TraversableOnce[Char])(implicit codec: Codec): Unit

    Definition Classes
    Output
  111. def writeIntsAsBytes(data: Int*): Unit

    Definition Classes
    Output
  112. def writeStrings(strings: Traversable[String], separator: String)(implicit codec: Codec): Unit

    Definition Classes
    Output

Inherited from Ordered[Path]

Inherited from Comparable[Path]

Inherited from PathFinder[Path]

Inherited from FileOps

Inherited from Seekable

Inherited from Output

Inherited from Input

Inherited from AnyRef

Inherited from Any

Ungrouped