Implement a web-based file manager that observes file changes. The work has been done in the framework of a practice-based research in computer science that took place in Exadel, 2013.
-
Implement a file indexing console application
Implement console application which takes directory path as argument.
The application should:- Create an index for each file in the target directory. Index should contain file name, file size and last update fields.
- Collection of indexes should be serialised as XML on disc.
- Before serialisation application should check if previously serialised data for target directory already exists.
- Application should print complete report about file changes based on their previous and current index data.
- After report old serialised data should be rewritten by actual.
-
Provide choice to use DB file indexes storage
Make application more flexible: provide choice to store file indexes in DB.- Develop interface for required directory and file indexes operations. Refactor existed code to make it an implementation of the interface.
- Develop another implementation of the interface which will use DB as file indexes storage. Write SQL script for DB creation. Store DB settings in application properties file. Use Spring framework JDBC data access abstraction for the implementation.
- Use Inversion of Control (IoC) pattern to choose between two implementations. Create Spring context for the application. Select an implementation depending on key from application properties.
-
Create WEB application
Create WEB application based on existed functionality.- Use Servlets/JSP technology to develop WEB application. Use Tomcat as J2EE web container.
- The application should allow file tree navigation providing list of subdirectories as well as file changes indexes.
- Provide user control for directory file indexes update.
- (Optional) Use Spring Web MVC for the implementation.
Technologies: Maven, J2EE, Servlets/JSP, Tomcat, MVC, Spring Framework.
You can choose to store index either in DB or XML.
- Create database. Find and execute
src/main/resources/DB create.sql
. - Tweak JDBC connection in
jdbc connection.properties
file. - Set
app.use.implementation
to eitherspringDBService
ordbService
inapplication.properties
file if you want to use database as a storage.
Set app.use.implementation
to xmlService
in application.properties
file if you want to use XML-based storage.
mvn clean package
Output: /target/file-tree.war
mvn clean jar:jar
Output: /target/file-tree.jar
- Deploy the application to Tomcat;
- Open http://localhost:8080/<deploy-path> in a browser;
- Guess credentials!
- And browse your
D:\
drive from the browser!
java -jar ./file-tree.jar "D:/example"
The first argument is a root folder for indexing.
Make changes... Refresh page