Hello,
2nd.Req. is not meet.
Line 14 is deleted.
Line 15 is uncomment.
What should I do? What is a default behavior, FileInputStream.
@Overide methods from FileInputStream?
package pl.codegym.task.task18.task1814;
import java.io.*;
/*
UnsupportedFileName
*/
public class TxtInputStream extends FileInputStream {
String fileName;
public TxtInputStream(String fileName) throws UnsupportedFileNameException, IOException {
super();
//super(fileName);
if (fileName.substring((fileName.length()-4), (fileName.length()-1)) != ".txt") {
super.close();
throw new UnsupportedFileNameException();
} else {
this.fileName = fileName;
}
}
public static void main(String[] args) {
}
}