scalax.file.ramfs

RamPath

class RamPath extends Path with RamFileOps

Linear Supertypes
RamFileOps, Path, Ordered[Path], Comparable[Path], PathFinder[Path], FileOps, Seekable, Output, Input, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. RamPath
  2. RamFileOps
  3. Path
  4. Ordered
  5. Comparable
  6. PathFinder
  7. FileOps
  8. Seekable
  9. Output
  10. Input
  11. AnyRef
  12. Any
Visibility
  1. Public
  2. All

Instance Constructors

  1. new RamPath (relativeTo: String, path: String, fileSystem: RamFileSystem)

Value Members

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

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

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

    Attributes
    final
    Definition Classes
    AnyRef → Any
  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 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
  5. 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
  6. def *** : PathSet[Path]

    Definition Classes
    PathPathFinder
  7. 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
  8. 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
  9. def / (child: String): RamPath

    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 the / will be encoded.

    returns

    A new path with the specified path appended

    Definition Classes
    RamPathPathPathFinder
    See also

    #\(String)

  10. def / (child: Path): Path

    Alias for /(child.

    Alias for /(child.name)

    returns

    A new path with the specified path appended

    Attributes
    final
    Definition Classes
    Path
    See also

    #/(String)

  11. def < (that: Path): Boolean

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

    Definition Classes
    Ordered
  13. def == (arg0: AnyRef): Boolean

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

    Attributes
    final
    Definition Classes
    Any
  15. def > (that: Path): Boolean

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

    Definition Classes
    Ordered
  17. def \ (child: Path): Path

    Alias for /(Path)

    Alias for /(Path)

    Attributes
    final
    Definition Classes
    Path
    See also

    #/(Path)

  18. def \ (child: String): Path

    Alias for #/(String)

    Alias for #/(String)

    Definition Classes
    PathPathFinder
    See also

    #/(String)

  19. 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

    Definition Classes
    Path
  20. 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

    Definition Classes
    RamPathPath
  21. 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

    Definition Classes
    Path
  22. def append (string: String)(implicit codec: Codec = Codec.default): Unit

    Append a string to the end of the Seekable object.

    Append a string to the end of the Seekable object.

    string

    the data to write

    codec

    the codec of the string to be written. The string will be converted to the encoding of codec

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

    Append bytes to the end of a file

    Append bytes to the end of a file

    Important: The use of an Array is highly recommended because normally arrays can be more efficiently written using the underlying APIs

    data

    The data to write. This can be any type that has a OutputConverter associated with it. There are predefined $outputConverters for several types. See the OutputConverter object for the predefined types and for objects to simplify implementing custom OutputConverter

    $converterParam

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

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

    Since the OutputConverter object defined for writing Ints encodes Ints using 4 bytes this method is provided to simply write an array of Ints as if they are Bytes.

    Since the OutputConverter object defined for writing Ints encodes Ints using 4 bytes this method is provided to simply write an array of Ints as if they are Bytes. In other words just taking the first byte. This is pretty common in Java.io style IO. IE

     outputStream.write(1) 
    

    1 is written as a single byte.

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

    Append several strings to the end of the Seekable object.

    Append several strings to the end of the Seekable object.

    strings

    The strings to write

    separator

    A string to add between each string. It is not added to the before the first string or after the last.

    codec

    The codec of the strings to be written. The strings will be converted to the encoding of codec

    Definition Classes
    Seekable
  27. def asInstanceOf [T0] : T0

    Attributes
    final
    Definition Classes
    Any
  28. def assertExists : Unit

    Attributes
    protected
    Definition Classes
    Path
  29. def attributes : Set[scalax.file.attributes.FileAttribute[_]]

    Definition Classes
    Path
  30. def attributes_= (attrs: Iterable[scalax.file.attributes.FileAttribute[_]]): Unit

    Definition Classes
    Path
  31. def blocks (blockSize: Option[Int] = None): LongTraversable[ByteBlock]

    Read the input as blocks of bytes.

    Read the input as blocks of bytes. This method should be avoided unless the maximum performance is absolutely required because bytes provides very good performance and is a better API for most applications.

    However since it better reflects how data is read with most input sources (like InputStreams and ReadableByteChannels); blocks is slightly more performance than bytes and therefore can be used when performance is the most important consideration.

    blockSize

    block size can optionally be specified but the default is normally acceptable.

    Definition Classes
    FileOpsSeekableInput
  32. def byteArray : Array[Byte]

    This method aspires to be the fastest way to read a stream of known length into memory.

    This method aspires to be the fastest way to read a stream of known length into memory.

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

    Obtains a Traversable for conveniently processing the resource as bytes.

    Obtains a Traversable for conveniently processing the resource as bytes.

    returns

    an non-strict traversable over all the bytes

    Definition Classes
    FileOpsSeekableInput
  34. def bytesAsInts : LongTraversable[Int]

    Obtains a Traversable for conveniently processing the file as Ints.

    Obtains a Traversable for conveniently processing the file as Ints.

    returns

    an non-strict traversable over all the bytes with the bytes being represented as Ints

    Definition Classes
    FileOpsSeekableInput
  35. def canExecute : Boolean

    Definition Classes
    Path
  36. def canRead : Boolean

    Definition Classes
    Path
  37. def canWrite : Boolean

    Definition Classes
    Path
  38. def channel (openOptions: OpenOption*): SeekableByteChannelResource[ArrayBufferSeekableChannel]

    Definition Classes
    RamFileOps
  39. def chars (implicit codec: Codec): LongTraversable[Char]

    The characters in the object.

    The characters in the object.

    If the codec is not the same as the source codec (the codec of the underlying data) then the characters will converted to the desired codec.

    codec

    The codec representing the desired encoding of the characters @return an traversable of all the characters

    Definition Classes
    FileOpsSeekableInput
  40. 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

    Definition Classes
    RamPathPath
  41. 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

    Definition Classes
    Path
  42. def children [U >: Path, F] (filter: F, options: Traversable[LinkOption])(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 @return A managed resource managing a PathSet.

    Definition Classes
    Path
    See also

    FileSystem#matcher(String,String)

    ,

    Path.Matching

    ,

    Path#walkTree

  43. def clone (): AnyRef

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

    Compares this path to the other lexigraphically.

    Compares this path to the other lexigraphically.

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

    Definition Classes
    Ordered → Comparable
  46. def copyDataTo (output: Output): Unit

    Copy all data from this Input object to the Output object as efficiently as possible.

    Copy all data from this Input object to the Output object as efficiently as possible.

    output

    output sink to copy the data to

    Definition Classes
    PathInput
  47. def copyTo [P <: Path] (target: P, createParents: Boolean, copyAttributes: Boolean, replaceExisting: Boolean, depth: Int): 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 @return the path to the new copy

    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

    Definition Classes
    Path
  48. def createDirectory (createParents: Boolean = true, failIfExists: Boolean = true, accessModes: Iterable[AccessMode] = List(Read,Write,Execute), attributes: Iterable[scalax.file.attributes.FileAttribute[_]] = Nil): Path

    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

    Definition Classes
    Path
  49. def createFile (createParents: Boolean = true, failIfExists: Boolean = true, accessModes: Iterable[AccessMode] = List(Read,Write), attributes: Iterable[scalax.file.attributes.FileAttribute[_]] = Nil): Path

    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

    Definition Classes
    Path
  50. def delete (force: Boolean): Path

    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

    Definition Classes
    RamPathPath
  51. 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

    Definition Classes
    Path
  52. 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.

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

    Definition Classes
    Path
  53. def descendants [U >: Path, F] (filter: F, depth: Int, options: Traversable[LinkOption])(implicit factory: PathMatcherFactory[F]): BasicPathSet[RamPath]

    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

    @return A managed resource managing a PathSet.

    Definition Classes
    RamPathPath
    See also

    FileSystem#matcher(String,String)

    ,

    Path.Matching

    ,

    Path#directoryStream(Option,Boolean)

  54. def doCopyFrom (input: Input): Unit

    If possible efficiently copy data from input.

    If possible efficiently copy data from input. It MUST NOT forward request to input's copyTo method because that could trigger an infinate loop

    Definition Classes
    PathOutput
  55. 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

    Definition Classes
    RamPathPath
  56. 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

    Definition Classes
    RamPathPath
  57. 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

    Definition Classes
    RamPathPath
  58. 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

    Definition Classes
    Path
  59. def eq (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  60. def equals (other: Any): Boolean

    Definition Classes
    Path → AnyRef → Any
  61. 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

    Definition Classes
    RamPathPath
    See also

    java.file.File#exists

  62. 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

    Definition Classes
    Path
  63. def fileChannel (openOptions: OpenOption*): None.type

    Definition Classes
    RamFileOps
  64. val fileSystem : RamFileSystem

    Definition Classes
    RamPathPath
  65. def finalize (): Unit

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

    Attributes
    final
    Definition Classes
    AnyRef → Any
  67. def hashCode (): Int

    Definition Classes
    Path → AnyRef → Any
  68. def inputStream : InputStreamResource[InputStream]

    Definition Classes
    RamFileOps
  69. def insert [T] (position: Long, data: T)(implicit converter: OutputConverter[T]): Any

    Inserts data at a position in the Seekable.

    Inserts data at a position in the Seekable. The actual position in the Seekable where the data is inserted depends on the type of data being written. For example if Longs are being written then position calculated as position * 8

    Important: The use of an Array is highly recommended because normally arrays can be more efficiently written using the underlying APIs

    position

    The position where the data is inserted into the Seekable. The actual position in the Seekable where the data is inserted depends on the type of data being written. For example if Longs are being written then position calculated as position * 8

    data

    The data to write. This can be any type that has a OutputConverter associated with it. There are predefined $outputConverters for several types. See the OutputConverter object for the predefined types and for objects to simplify implementing custom OutputConverter

    $converterParam

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

    Inserts a string at a position in the Seekable.

    Inserts a string at a position in the Seekable. This is a potentially inefficient because of the need to count characters. If the codec is not a fixed sized codec (for example UTF8) each character must be converted in the file up to the point of insertion.

    position

    The position in the file to perform the insert. A position of 2 will insert the character after the second character (not byte).

    string

    The string that will be inserted into the Seekable

    codec

    The codec to use for determining the location for inserting the string and for encoding the string as bytes

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

    Since the OutputConverter object defined for writing Ints encodes Ints using 4 bytes this method is provided to simply write an array of Ints as if they are Bytes.

    Since the OutputConverter object defined for writing Ints encodes Ints using 4 bytes this method is provided to simply write an array of Ints as if they are Bytes. In other words just taking the first byte. This is pretty common in Java.io style IO. IE

     outputStream.write(1) 
    

    1 is written as a single byte.

    Definition Classes
    Seekable
  72. 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.

    Definition Classes
    RamPathPath
    See also

    java.file.File#isAbsolute

  73. 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

    Definition Classes
    RamPathPath
    See also

    java.file.File#isDirectory

  74. 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

    Definition Classes
    RamPathPath
    See also

    java.file.File#isFile

  75. 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.

    Definition Classes
    Path
  76. 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

    Definition Classes
    RamPathPath
    See also

    java.file.File#isHidden()

  77. def isInstanceOf [T0] : Boolean

    Attributes
    final
    Definition Classes
    Any
  78. 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.

    Definition Classes
    Path
  79. 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.

    Definition Classes
    Path
  80. def iterator : Iterator[Path]

    Definition Classes
    PathPathFinder
  81. 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

    Definition Classes
    RamPathPath
    See also

    java.file.File#getLastModified()

  82. 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

    Definition Classes
    RamPathPath
    See also

    java.file.File#setLastModified(Long)

  83. def lines (terminator: Terminator = Terminators.Auto, includeTerminator: Boolean = false)(implicit codec: Codec = Codec.default): LongTraversable[String]

    Obtain an non-strict traversable for iterating through the lines in the object

    Obtain an non-strict traversable for iterating through the lines in the object

    If the codec is not the same as the source codec (the codec of the underlying data) then the characters will converted to the desired codec.

    terminator

    The strategy for determining the end of line Default is to auto-detect the EOL

    includeTerminator

    if true then the line will end with the line terminator Default is false

    @return a non-strict traversable for iterating through all the lines

    codec

    The codec representing the desired encoding of the characters

    Definition Classes
    Input
  84. 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

    Definition Classes
    Path
    See also

    FileSystem # matcher ( String, String )

  85. 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
    Definition Classes
    RamPathPath
  86. 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
    Definition Classes
    RamPathPath
  87. def moveTo [P <: Path] (target: P, replace: Boolean, atomicMove: Boolean): 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.

    atomicMove

    it will guarantee atomicity of the move False by default

    returns

    true the path to the moved object

    Definition Classes
    Path
  88. lazy val name : String

    Definition Classes
    RamPathPath
  89. def ne (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  90. def node : Option[Node]

  91. 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

    Definition Classes
    Path
  92. lazy val normalize : RamPath

    Definition Classes
    RamPathPath
  93. def notify (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
  94. def notifyAll (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
  95. def open [R] (openOptions: Seq[OpenOption])(action: (OpenSeekable) ⇒ R): R

    Definition Classes
    RamFileOps
  96. def open [U] (f: (OpenSeekable) ⇒ U): U

    Execute the function 'f' passing an Seekable instance that performs all operations on a single opened connection to the underlying resource.

    Execute the function 'f' passing an Seekable instance that performs all operations on a single opened connection to the underlying resource. Typically each call to one of the Seekable's methods results in a new connection. For example if write it called typically it will write to the start of the seekable but in open it will write to the current position.

    Even if the underlying resource is an appending, using open will be more efficient since the connection only needs to be made a single time.

    f

    the function to execute on the new Output instance (which uses a single connection)

    returns

    the result of the function

    Definition Classes
    Seekable
  97. def openOutput [U] (f: (Output) ⇒ U): U

    Execute the function 'f' passing an Output instance that performs all operations on a single opened connection to the underlying resource.

    Execute the function 'f' passing an Output instance that performs all operations on a single opened connection to the underlying resource. Typically each call to one of the Output's methods results in a new connection. For example if the underlying OutputStream truncates the file each time the connection is made then calling write two times will result in the contents of the second write overwriting the second write.

    Even if the underlying resource is an appending, using open will be more efficient since the connection only needs to be made a single time.

    f

    the function to execute on the new Output instance (which uses a single connection)

    returns

    the result of the function

    Definition Classes
    Output
  98. def outputStream (openOptions: OpenOption*): OutputStreamResource[OutputStream]

    Definition Classes
    RamFileOps
  99. lazy val parent : Option[RamPath]

    Definition Classes
    RamPathPath
  100. 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

    Definition Classes
    Path
    See also

    segments

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

    Update a portion of the file content at the declared location.

    Update a portion of the file content at the declared location. This is the most flexible of the random access methods but is also (probably) the trickiest to fully understand. That said it behaves (almost) identical to a scala.collection.Seq.patch method, so if you understand that you should not have difficulty understanding this method.

    Important: The use of an Array is highly recommended because normally arrays can be more efficiently written using the underlying APIs

    To append data the position must >= size

    If the position is within the file but the position + bytes.length is beyond the end of the file the file will be enlarged so that the entire string can fit in the file

    The write begins at the position indicated. So if position = 0 then the write will begin at the first byte of the file.

    position

    The start position of the update starting at 0. The position must be within the file or == size (for appending)

    data

    The data to write. This can be any type that has a OutputConverter associated with it. There are predefined $outputConverters for several types. See the OutputConverter object for the predefined types and for objects to simplify implementing custom OutputConverter

    overwrite

    The strategy that dictates how many characters/bytes/units are overwritten $converterParam

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

    Update a portion of the file content at the declared location.

    Update a portion of the file content at the declared location. This is the most flexible of the random access methods but is also (probably) the trickiest to fully understand. That said it behaves (almost) identical to a scala.collection.Seq.patch method, so if you understand that you should not have difficulty understanding this method.

    If the position is beyond the end of the file a BufferUnderflow Exception will be thrown

    If the position is within the file but the position + string.getBytes(codec).length is beyond the end of the file the file will be enlarged so that the entire string can fit in the file

    The write begins at the position indicated. So if position = 0 then the write will begin at the first byte of the file.

    position

    The start position of the update starting at 0. The position is the position'th character in the file using the codec for decoding the file The position must be within the file.

    string

    The string to write to the file starting at position.

    overwrite

    The strategy that dictates how many characters/bytes/units are overwritten

    codec

    The codec to use for decoding the underlying data into characters

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

    Since the OutputConverter object defined for writing Ints encodes Ints using 4 bytes this method is provided to simply write an array of Ints as if they are Bytes.

    Since the OutputConverter object defined for writing Ints encodes Ints using 4 bytes this method is provided to simply write an array of Ints as if they are Bytes. In other words just taking the first byte. This is pretty common in Java.io style IO. IE

     outputStream.write(1) 
    

    1 is written as a single byte.

    Definition Classes
    Seekable
  104. val 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

    Definition Classes
    RamPathPath
  105. def readWriteChannel [U] (f: (SeekableByteChannel) ⇒ U): U

    Attributes
    protected
    Definition Classes
    Seekable
  106. 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

    Definition Classes
    Path
  107. def resolve (other: String): 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)

    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)

    Definition Classes
    Path
  108. def resolve (other: Path): Path

    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 @return the constructed/resolved path

    Definition Classes
    Path
  109. def root : Option[Path]

    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

    Definition Classes
    Path
  110. 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

    Definition Classes
    Path
  111. val separator : String

    The path segment separator string for the filesystem

    The path segment separator string for the filesystem

    Definition Classes
    Path
    See also

    FileSystem#separator

  112. 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

    Definition Classes
    Path
  113. 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
    RamPathPathInput
    See also

    java.file.File#length()

  114. def slurpString (implicit codec: Codec = Codec.default): String

    Loads all the characters into memory.

    Loads all the characters into memory. There is no protection against loading very large files/amounts of data.

    codec

    The codec representing the desired encoding of the characters

    Definition Classes
    Input
  115. 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

    Definition Classes
    Path
  116. def synchronized [T0] (arg0: ⇒ T0): T0

    Attributes
    final
    Definition Classes
    AnyRef
  117. def tempFile (): Path

    Create a temporary file to use for performing certain operations.

    Create a temporary file to use for performing certain operations. It should be as efficient as possible to copy from the temporary file to this Seekable and vice-versa. Can be overridden for performance

    Attributes
    protected
    Definition Classes
    PathSeekable
  118. lazy val toAbsolute : RamPath

    Definition Classes
    RamPathPath
  119. def toString (): String

    Definition Classes
    RamPathPath → AnyRef → Any
  120. lazy val toURI : URI

    Definition Classes
    RamPathPath
  121. 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.

    Definition Classes
    Path
    See also

    java.file.File#toURI

  122. def truncate (position: Long): Unit

    Truncate/Chop the Seekable to the number of bytes declared by the position param

    Truncate/Chop the Seekable to the number of bytes declared by the position param

    Definition Classes
    Seekable
  123. def truncateString (position: Long)(implicit codec: Codec = Codec.default): Unit

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

    Attributes
    protected
    Definition Classes
    FileOpsSeekable
  125. def underlyingOutput : OutputStreamResource[OutputStream]

    Attributes
    protected
    Definition Classes
    FileOpsSeekableOutput
  126. def wait (): Unit

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

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

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()
  129. def withLock [R] (start: Long, size: Long, shared: Boolean)(block: (Seekable) ⇒ R): Option[R]

    Definition Classes
    RamFileOps
  130. def write (string: String)(implicit codec: Codec = Codec.default): Unit

    Writes a string.

    Writes a string.

    string

    the data to write

    codec

    the codec of the string to be written. The string will be converted to the encoding of sourceCodec Default is sourceCodec

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

    Write data to the underlying object.

    Write data to the underlying object. Each time write is called the resource is reopened, in the case of a file this means that the file will be opened and truncated. The

    In the case of writing ints and bytes it is often recommended to write arrays of data since normally the underlying object can write arrays of bytes or integers most efficiently.

    Since Characters require a codec to write to an OutputStream characters cannot be written with this method unless a OutputWriterFunction.CharFunction object is provided as the writer.

    data

    The data to write to underlying object. Any data that has a resolvable OutputConverter can be written. See the OutputConverter object for the defined OutputConverter implementations and classes to assist implementing more.

    writer

    The strategy used to write the data to the underlying object. Many standard data-types are implicitly resolved and do not need to be supplied

    Definition Classes
    Output
    See also

    #writeChars for more on writing characters

  132. def writeChars (characters: TraversableOnce[Char])(implicit codec: Codec = Codec.default): Unit

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

    Since the OutputConverter object defined for writing Ints encodes Ints using 4 bytes this method is provided to simply write an array of Ints as if they are Bytes.

    Since the OutputConverter object defined for writing Ints encodes Ints using 4 bytes this method is provided to simply write an array of Ints as if they are Bytes. In other words just taking the first byte. This is pretty common in Java.io style IO. IE

     outputStream.write(1) 
    

    1 is written as a single byte.

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

    Write several strings.

    Write several strings.

    strings

    The data to write

    separator

    A string to add between each string. It is not added to the before the first string or after the last.

    codec

    The codec of the strings to be written. The strings will be converted to the encoding of sourceCodec

    Definition Classes
    Output

Inherited from RamFileOps

Inherited from Path

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