File version maintenance utility

 
A team of software developers has been asked to develop a file version maintenance utility . The utility should maintain all the 
version of a file. When a user modifies a file, the current version of the file should be stored separately before the update
operation is executed. The application should also keep a records of:
• The date and time of the modification.
• The name of the user who modified the file.
 
DESIGN SPECIFICATION 
The File Version Maintenance Utility should be designed to meet the following specification
• It should be a console based application for a standalone machine.
• It should provide menu options to perform various activities.
• For every file maintained by the utility, a history folder should be maintained. The history folder should contain the previous 
versions of the file.
• A user needs to provide a user name and password to log on to the utility.
• Users of two types, normal users and administrators.
• After successful logon, a normal user can perform the following tasks.
1. Add, modify, delete, and view files
2. View previous versions of a file
• A user with administrative rights should be able to perform the following task after logging on:
1. Add, modify, delete, and view files
2. View previous versions of a file
3. Create new user accounts
• When a user edits a file, the current version of the file should be copied to the history folder. After that, the modifications in the 
file should be saved.
• The different versions of a file need to be stored with different names in history folder. The name of a version can be chosen in 
the< File Name>_<w Version Number> format. For example, the first two versions of the file named EmployeeDetails.txt can be 
Stored in the History folder as EmployeeDetails_1.txt and EmployeeDetails_2.txt.
• A user can list the version history of a file. After listing the various versions of the file, the user can view any version of the file by
providing the version number.
• A user can also replace the current version of the file with any of its previous versions
• When a file is deleted, its complete version history should be deleted.

What have you done so far?

To develop a file version maintenance utility that meets the requirements mentioned in the design specifications, follow these steps:

1. Design a console-based application: Create a user interface using a console to interact with the users. Display a menu with options for various activities.

2. Implement user authentication: Prompt the user to enter a username and password for logging into the utility. Verify the credentials against a user database. Differentiate between normal users and administrators based on their roles.

3. Implement file management functions: Allow users to perform the following tasks on files:
- Add: Prompt the user to provide a file to add and save it to a designated location. Additionally, create a history folder for the file.
- Modify: When a user modifies a file, save the current version of the file by copying it to the history folder. Then, apply the modifications to the file.
- Delete: If a file is deleted, remove it from the designated location and delete its complete version history from the history folder.
- View: Allow users to view the current version of a file.

4. Implement version history: Store the previous versions of each file in the history folder. Create a naming convention for versioned files, such as <File Name>_<Version Number>. For example, EmployeeDetails_1.txt and EmployeeDetails_2.txt. When a user views the version history of a file, list all the versions provided with their respective version numbers. Allow users to select and view any specific version by providing its version number.

5. Implement administrative tasks: If the user has administrative rights, provide additional functionality, including:
- Creating new user accounts by prompting for a username and password.
- Viewing previous versions of files.
- Modifying and deleting files.

By following these design specifications and implementing the steps mentioned above, you can develop a file version maintenance utility that meets the desired requirements.