A console-based file system simulation developed in Java. The project models a hierarchical file system and provides operations for navigating, creating, deleting, searching, and listing files and directories.
- Navigate through directories
- Create new directories and files
- Delete files and directories
- Recursive search by file or directory name
- Recursive search by file extension
- O(1) lookup in the current directory using a HashMap
- USER and SYSTEM access levels
- Automatic directory metadata updates
- Load the initial file system structure from a text file
- Display file and directory information including size, modification date, and access level
java-file-system-simulator/
├── src/
│ ├── Main.java
│ ├── FileSystemNode.java
│ ├── DirectoryNode.java
│ ├── FileNode.java
│ ├── FileSystemLoader.java
│ └── FileSystemManager.java
├── filesystem.txt
├── .gitignore
└── README.md
Abstract base class for file system elements. It stores common information such as name, size, last modified date, access level, and parent directory.
Represents directories in the file system. Child nodes are stored using both a list and a HashMap, allowing efficient direct lookup within the current directory.
Represents individual files together with their file extension and metadata.
Reads the file system hierarchy from filesystem.txt and constructs the directory structure.
Handles file system operations such as directory navigation, file and directory creation, deletion, recursive searching, and content listing.
Provides the console-based user interface and allows users to interact with the simulated file system.
This project demonstrates several core programming and data structure concepts:
- Object-Oriented Programming
- Inheritance and abstraction
- Tree-based hierarchical structures
- Recursion
- ArrayList
- HashMap
- Stack
- File I/O
- Java Development Kit (JDK)
From the project root directory:
javac src/*.javajava -cp src MainKeep filesystem.txt in the project root directory because the application loads the initial file system structure from this file.
The console application allows the user to:
1 - Change current directory
2 - Navigate to a subdirectory
3 - Add a new directory
4 - Add a new file
5 - Delete a file or directory
6 - Search recursively by name
7 - Search recursively by extension
8 - Search in the current directory using O(1) lookup
9 - List current directory contents
This project was developed as an academic Java project to practice object-oriented programming, recursive algorithms, hierarchical data structures, file processing, and efficient lookup techniques.
Zeynep Oktay