UnsupportedFileName

  • 10
  • Locked
Change the TxtInputStream class so that it only works with txt files (* .txt). For example, first.txt or name.1.part3.txt. If a non-txt file is passed (e.g. file.txt.exe), then the constructor should throw an UnsupportedFileNameException. Think about what else you need to do if an exception is throw
You can't complete this task, because you're not signed in.
Comments (2)
  • Popular
  • New
  • Old
You must be signed in to leave a comment
DarthGizka
Level 24 , Wittenberg, Germany
6 June, 16:05
task1814 (UnsupportedFileName) CAVEAT: when the requirements say 'you must also call super.close()' then you have to take that literally (that is, you need to specify the superfluous 'super.' prefix, even though 'close()' without the prefix is exactly the same thing in this case). Perhaps someone should send the programmer who is responsible for this on a Java course for beginners...
Switch/Cypher
Level 25 , Bexleyheath, United Kingdom
5 October 2020, 18:10
Knowing about x.endsWith(String) might have helped.....