Question: In this lab, your initial focus will be on understanding various file formats, such as XML , JSON, and CSV . This involves understanding their

In this lab, your initial focus will be on understanding various file formats, such as XML, JSON, and CSV. This involves understanding their structures and how they represent data.
Following this, you will proceed to create endpoints for a specific resource within your web service. These endpoints will be designed to serve the resource using three different file format representations, allowing clients to interact with the data in XML, JSON, or CSV.
The entire process, from handling file formats to exposing the resource through endpoints, will be facilitated by the GlassFish server, which serves as the hosting environment for your web service.
Prerequisites
Ensure your GlassFish setup is functional, as this lab is a continuation from Lab 2.
Lab Work
Part 1- File Creation
Given the dataset below represented in a tabular format, your task is to transform it into other file formats.
name id gpa
Ryan Gosling 1000000004.3
Keanu Reeves 1000000012.9
Richard Dean Anderson 1000000022.7
Brad Pitt 1000000033.9
Ed Norton 1000000042.2
Helena Bonham Carter 1000000052.0
Convert the data above into the following formats:
JSON
XML
CSV
Name each file students (e.g., students.json) and place them within src/main/resources/.
For the purpose of autograding, follow these formatting guidelines for each file type:
For all 3 formats:
Fields for each record should be lowercase (e.g., name and not NAME)
Fields should be ordered as: name, id, gpa
Records should be sorted by the value of id from least to greatest
For JSON:
All the records should be stored in an array named students
Each record should be a JSON object with following fields and value types:
name is a string
id and gpa are numbers
For XML:
The parent element should be called students
Each record should be called student
Each field in a record (i.e., name, id and gpa) should have its own tag (e.g.,)
Include an XML header at the beginning of the file with following attributes:
version: 1.0
encoding: utf-8
For CSV:
Header should be copied from the table above
Delimiter should be a comma

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!