Description of the 3335FS:
public class FileInfo{
String filename; //name of the file being stored
int block1; //index number in the blocks_info array containing starting data of the file
}
//Declaration of the File System
public static final int MAX_SIZE = 256;
FileInfo [] files = new FileInfo[MAX_SIZE] //index i is null if file is deleted
int [] blocks_info = new int [MAX_SIZE] //block# for the next block, 0 if available, -1 for EOF, -2 for bad block
String [] blocks = new String [MAX_SIZE] //Actual block data
//Explanation
FileInfo: Represents each file stores in the FS. block1 contains the index of the blocks_info array where the data of this file is stored
files array: Initialized to all null values. When a file is deleted, its corresponding FileInfo object is set to null. When a new file is allocated, its object gets stored at the first available (null) index in the array
blocks_info array: Contains the indices info for the stored data of each file. Every blocks_info[i] can have 4 types of values:
int value between 0-255: If a file spans more than one file, will contain the array index for the next block
0: if the block is available
-1: if this is the last block for a file
-2: a bad block, do not use
blocks array: Actual data of the files. Each blocks[i] can hold a maximum string size of 256. blocks[i] is null if no data stored here.
Project Details:
Implement the 3335FS explained above in java. Your main menu should have the following options:
1. Store a file -- asks the user for a filename on your harddrive and stores it in the 3335FS. Should print an error message if the file does not exist on the hard drive.
2. Delete a file -- asks the user for a filename stored in your 3335FS and deletes it. Should print an error message if the file does not exist in the 3335FS.
3. Print 3335FS to file -- saves the whole file system in "[login to view URL]" on your hard drive. The data should be properly formatted for readability.
4. Exit
Hi,
I am OCPJP certified java developer having 6 yr of experience.
I have designed db for large ERP projects (AFS based).
I can do this task easily.
Regards,
Haresh Amin