scalax.file

FileSystem

abstract class FileSystem extends AnyRef

Provides an interface to a file system and is a factory for other objects for accessing files and directories. Also is used for obtaining metadata about the filesystem.

Since

1.0

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

Instance Constructors

  1. new FileSystem()

Type Members

  1. abstract type PathType <: Path

Abstract Value Members

  1. abstract def context: ResourceContext

    Get the Resource context associated with this FileSystem instance.

    Get the Resource context associated with this FileSystem instance.

    returns

    the associated ResourceContext

    Note

    as FileSystems are immutable objects a given Resource instance will always be associated with the same ResourceContext

  2. abstract def createTempDirectory(prefix: String = randomPrefix, suffix: String = null, dir: String = null, deleteOnExit: Boolean = true): PathType

    Creates an empty directory in the provided directory with the provided prefix and suffixes, if the filesystem supports it.

    Creates an empty directory in the provided directory with the provided prefix and suffixes, if the filesystem supports it. If not then a UnsupportedOperationException is thrown. The directory will not replace an existing file/directory and it is guaranteed to be unique and not previously used by another process at time of creation.

    prefix

    the starting characters of the directory name. Default is a randomly generated prefix

    suffix

    the last characters of the directory name Default is null (no suffix)

    dir

    the directory to create the directory in. If null or not declared the directory will be created in the system temporary folder Default is null (system/user temp folder)

    deleteOnExit

    If true then the directory and all contained folders will be deleted when the JVM is shutdown. Default is true

    Exceptions thrown
    java.lang.UnsupportedOperationException

    If the filesystem does not support temporary files

  3. abstract def createTempFile(prefix: String = randomPrefix, suffix: String = null, dir: String = null, deleteOnExit: Boolean = true): PathType

    Creates an empty file in the provided directory with the provided prefix and suffixes, if the filesystem supports it.

    Creates an empty file in the provided directory with the provided prefix and suffixes, if the filesystem supports it. If not then a UnsupportedOperationException is thrown.

    The file will not replace an existing file and it is guaranteed to be unique and not previously used by another process at time of creation.

    prefix

    the starting characters of the file name. Default is a randomly generated prefix

    suffix

    the last characters of the file name Default is null (no suffix)

    dir

    the directory to create the file in. If null or not declared the file will be created in the system temporary folder Default is null (system/user temp folder)

    deleteOnExit

    If true then the file will be deleted when the JVM is shutdown Default is true

    Exceptions thrown
    java.lang.UnsupportedOperationException

    If the filesystem does not support temporary files

  4. abstract def doCreateFromSeq(segments: Seq[String]): PathType

    Attributes
    protected
  5. abstract def name: String

    A name identifying the filesystem

  6. abstract def roots: Set[PathType]

    Returns the list of roots for this filesystem

  7. abstract def separator: String

    The path segment separator string for the filesystem

  8. abstract def updateContext(newContext: ResourceContext): FileSystem

    Create a new FileSystem instance that is configured with the new ResourceContext

    Create a new FileSystem instance that is configured with the new ResourceContext

    newContext

    a new ResourceContext

    returns

    a new instance configured with the new context

Concrete Value Members

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

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

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

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

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

    Definition Classes
    Any
  6. def apply(pathRepresentation: String, separator: Char): PathType

  7. def apply(segments: String*): PathType

  8. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  9. def checkSegmentForSeparators(segment: String): Unit

    Checks if the separator or a "Common" separator is in the segment.

    Checks if the separator or a "Common" separator is in the segment.

    If the separator is found the an IllegalArgumentException is thrown. If a common separator is found (/ or \) then a warning is logged and the stack trace is logged if fine is enabled for the filesystem's logger.

    Exceptions thrown
    IllegalArgumentException

    If the separator is found the an IllegalArgumentException is thrown

  10. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  11. final def eq(arg0: AnyRef): Boolean

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

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

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  14. def fromSeq(segments: Seq[String]): PathType

    Create a path object for the filesystem from the path segments

  15. def fromString(path: String): PathType

    Create a path object for the filesystem

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

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

    Definition Classes
    AnyRef → Any
  18. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  19. val legalChars: List[Char]

    Attributes
    protected
  20. lazy val logger: Logger

    Attributes
    protected
  21. def matcher(pattern: String, syntax: String = PathMatcher.StandardSyntax.GLOB): PathMatcher[Path]

    Creates a function that returns true if parameter matches the pattern used to create the function.

    Creates a function that returns true if parameter matches the pattern used to create the function.

    If the syntax is glob then the following patterns are accepted:

    • The * character matches zero or more characters of a name component without crossing directory boundaries.
    • <The ** characters matches zero or more characters crossing directory boundaries.
    • The ? character matches exactly one character of a name component.
    • The backslash character (\) is used to escape characters that would otherwise be interpreted as special characters. The expression \\ matches a single backslash and "\{" matches a left brace for example.

    Currently unsupported slated to be supported shortly are:

    • The [ ] characters are a bracket expression that match a single character of a name component out of a set of characters. For example, [abc] matches "a", "b", or "c". The hyphen (-) may be used to specify a range so [a-z] specifies a range that matches from "a" to "z" (inclusive). These forms can be mixed so [abce-g] matches "a", "b", "c", "e", "f" or "g". If the character after the [ is a ! then it is used for negation so [!a-c] matches any character except "a", "b", or "c".
    • Within a bracket expression the *, ? and \ characters match themselves. The (-) character matches itself if it is the first character within the brackets, or the first character after the ! if negating.
    • The { } characters are a group of subpatterns, where the group matches if any subpattern in the group matches. The "," character is used to separate the subpatterns. Groups cannot be nested.
    • All other characters match themselves in an implementation dependent manner. This includes characters representing any name-separators.

    The matching of root components is highly implementation-dependent and is not specified.

    If the syntax is regex then the pattern component is a pattern as defined by the java.util.regex.Pattern class

    In both cases the matching is case sensitive

    pattern

    the pattern of the match

    syntax

    the identifier of the syntax that will be used to interpret the pattern Default is glob

    returns

    a function that matches paths against the matching specification in syntax and Pattern

    See also

    Path#contents

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

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

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

    Definition Classes
    AnyRef
  25. lazy val presentWorkingDirectory: PathType forSome {val _10: PathType}

  26. def randomPrefix: String

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

    Definition Classes
    AnyRef
  28. def toString(): String

    Definition Classes
    AnyRef → Any
  29. def updateContext(f: (ResourceContext) ⇒ ResourceContext): FileSystem

    Update the current ResourceContext and return a new FileSystem instance with the updated context

    Update the current ResourceContext and return a new FileSystem instance with the updated context

    f

    A function for transforming the current context to a new context with new values.

    returns

    a new instance configured with the new context

  30. def urlStreamHandler: Option[URLStreamHandler]

    Returns a URLStreamHandler if the protocol in the URI is not supported by default JAVA.

    Returns a URLStreamHandler if the protocol in the URI is not supported by default JAVA. This handler is used to construct URLs for the Paths as well as by scalax.file.PathURLStreamHandlerFactory The default behavoir is to return None this assumes that the default protocol handlers can handle the protocol

  31. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws()

Inherited from AnyRef

Inherited from Any

Ungrouped