we would like to build a system in java ( set of classes ) to manage and handle text files . the required software
uses the predefined java streams (FileReader, FileWriter,...) and allows creating and opening of new text files as well as writing
and reading.In plus, it allows the user to enter or retrieve information about employees like :
Name, profession, recent Diploma, salary, address...
Practically, this software (set of classes) at excution time , ask the user about the operation he would like to do :
- create and name a new text file ?
- Open and append (add new information to ) an existing file ?
- Update record(s)?
- Delete record(s)?
- Make one copy of a specific text file in a specific directory into new file in the same or in other specific directory?
To implement the idea :
1- create the class HandleFile that contains the following static methods :
a- public static create (String filename);
b- public static Update (String filename, int record_number);
c- public static Delete (String filename, int record_number);
d- public static append (String filename);
e- public static copy (String sourceFileName, String destinationFileName);
2- in all the above methods, handle all possible Exceptions by try- catch blocks.
3- Write a driver class to test your created system by creating a text file and by calling all the implemented methods. the user
can input the name of the files as well as the record data by using the pre-defined scanner class.