Skip to content

moh-i-ahmed/File-Server

Repository files navigation

File Server

Author: Mohammed Ibrahim Ahmed | github.com/moh-i-ahmed

Description: My implementation of a simple RESTful file server built using Java, Spring Boot & Spring Web. The server provides the following endpoints:

Endpoint Description
http://localhost:8080/files/ Retrieves list of all uploaded files with their name and download link
http://localhost:8080/files/open_me.txt Downloads the open_me.txt file present in the project
http://localhost:8080/files/upload Uploads a file to the server

Pre-requisites & setup

This application has been developed and tested only with the following, please ensure you have the Java and Gradle 8.5 versions installed.

Run instructions

Running the application:

  1. Open a terminal and navigate to the project's root directory.

    • cd <path_to_folder_containing_project\File-Server
  2. Start the file server using the gradle wrapper command:

    • .\gradlew bootRun
  3. In your browser or using a program such as Postman, access the endpoints described above.

Running the unit tests:

  1. Open a terminal and navigate to the project's root directory.

    • cd <path_to_folder_containing_project\File-Server
  2. Run the tests using the gradle wrapper command:

    • .\gradlew clean test --info
  3. The results will be displayed in the terminal and will also be stored in the folder:

    • File-Server\build\test-results folder

Project structure

File Server: The file server code is located in the folder File-Server\src\main\java\fileServer\FileServer

Unit tests: The unit tests are located in File-Server\src\test\java\fileServer\FileServer\FileServerEndpointTests.java

Releases

No releases published

Packages

No packages published

Languages