Search⌘ K
AI Features

Setting Up a gRPC Service

Explore setting up a gRPC service by defining server configuration files, implementing FTP service methods in Java, and managing file transfers. This lesson guides you through creating configuration properties, initializing logger settings, and coding service classes that handle file additions and deletions on the server side.

Configuration files

In this lesson, we will define the boilerplate code for the FTP service. Before we define the class containing the service implementation, we will define the configuration properties for the server. We will create a file config.properties in the src/main/resources directory. You can find the file, along with its explanation, in the Server and Client Configuration Properties lesson. We will also add configuration properties for the logger in a file named log4j2.properties in the src/main/resources directory. Details of this file can be found in Configuring the Logger lesson. Both files are shown below:

Files
config.properties
log4j2.properties
Java
DESTINATION_DIRECTORY_ON_SERVER=/Users/IdeaProjects/grpc-ftp-project/destOnServer/
TEMP_WRITE_PATH=/Users/IdeaProjects/grpc-ftp-project/destOnServer/tmp
Config files for server and logger configuration

After defining the configuration file, we will create a class called ServerConfiguration in the utils package inside ...