scalax.file

NotFileException

case class NotFileException () extends IOException with ControlThrowable with Product with Serializable

This is a control exception that indicates the underlying filesystem object cannot be treated as a File.

IE a symbolic link maybe treated as a file in some cases but a Directory cannot. So if a file operation is attempted on a Directory a NotFileException will be thrown

To safely use File one should use the following code:


import scala.util.control.Exception._
catching(classOf[NotFileException]) opt {
  file.lines foreach (println _)
} match {
  case None => println ("Oh no the path is not a file")
  case Some(names) => println ("oh everything went as planned and we got all the lines: "+lines)
}

Since

1.0

Linear Supertypes
Serializable, Product, Equals, ControlThrowable, NoStackTrace, IOException, Exception, Throwable, Serializable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. NotFileException
  2. Serializable
  3. Product
  4. Equals
  5. ControlThrowable
  6. NoStackTrace
  7. IOException
  8. Exception
  9. Throwable
  10. Serializable
  11. AnyRef
  12. Any
Visibility
  1. Public
  2. All

Instance Constructors

  1. new NotFileException ()

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 == (arg0: AnyRef): Boolean

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

    Attributes
    final
    Definition Classes
    Any
  6. def asInstanceOf [T0] : T0

    Attributes
    final
    Definition Classes
    Any
  7. def canEqual (arg0: Any): Boolean

    Definition Classes
    NotFileException → Equals
  8. def clone (): AnyRef

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

    Attributes
    final
    Definition Classes
    AnyRef
  10. def equals (arg0: Any): Boolean

    Definition Classes
    NotFileException → Equals → AnyRef → Any
  11. def fillInStackTrace (): Throwable

    Definition Classes
    NoStackTrace → Throwable
  12. def finalize (): Unit

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  13. def getCause (): Throwable

    Definition Classes
    Throwable
  14. def getClass (): java.lang.Class[_]

    Attributes
    final
    Definition Classes
    AnyRef → Any
  15. def getLocalizedMessage (): String

    Definition Classes
    Throwable
  16. def getMessage (): String

    Definition Classes
    Throwable
  17. def getStackTrace (): Array[StackTraceElement]

    Definition Classes
    Throwable
  18. def hashCode (): Int

    Definition Classes
    NotFileException → AnyRef → Any
  19. def initCause (arg0: Throwable): Throwable

    Definition Classes
    Throwable
  20. def isInstanceOf [T0] : Boolean

    Attributes
    final
    Definition Classes
    Any
  21. def ne (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  22. def notify (): Unit

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

    Attributes
    final
    Definition Classes
    AnyRef
  24. def printStackTrace (arg0: PrintWriter): Unit

    Definition Classes
    Throwable
  25. def printStackTrace (arg0: PrintStream): Unit

    Definition Classes
    Throwable
  26. def printStackTrace (): Unit

    Definition Classes
    Throwable
  27. def productArity : Int

    Definition Classes
    NotFileException → Product
  28. def productElement (arg0: Int): Any

    Definition Classes
    NotFileException → Product
  29. def productIterator : Iterator[Any]

    Definition Classes
    Product
  30. def productPrefix : String

    Definition Classes
    NotFileException → Product
  31. def setStackTrace (arg0: Array[StackTraceElement]): Unit

    Definition Classes
    Throwable
  32. def synchronized [T0] (arg0: ⇒ T0): T0

    Attributes
    final
    Definition Classes
    AnyRef
  33. def toString (): String

    Definition Classes
    Throwable → AnyRef → Any
  34. def wait (): Unit

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

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

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()

Deprecated Value Members

  1. def productElements : Iterator[Any]

    Definition Classes
    Product
    Annotations
    @deprecated
    Deprecated

    use productIterator instead

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from ControlThrowable

Inherited from NoStackTrace

Inherited from IOException

Inherited from Exception

Inherited from Throwable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any