A File/Object converter utility for software developers built using java for CPSC 210.
- About the Project
- Tools and Technologies Used / Built With
- How it Works
- Developed By
- About Me and Why I built this Project
- Getting Started
- License
- Usage/API Docs
- Pull Requests
- Contact
- Acknowledgements
- User Stories - Phase 1
- User Stories - Phase 2
- User Stories - Phase 3
- User Stories - Phase 4
This project is a File/Object converter utility for software developers. Many software developers require conversion of files and data to another forms such as JSON to push to their database or for data analysis. Developers often do not want to use free online tools to convert their data due to privacy reasons. This open source software can be used as a utility in their code. Moreover, this project is fully extensible.
Utilizes open source Apache File reader APIs and object construction to perform the necessary file conversions. Uses those scanners to Stream read every file and perform necessary object construction / conversion. Custom API docs for this software's usage will be released in the future. Note : This software is not a product of Apache software foundation.
I'm Vishal Desh in year 2 pursuing Bachelor of Science and Master of Management. I am passionate about software development. I worked on some software projects and participated in several hackathons over the summer. I had to use a lot of databases for my projects (Firestore, MongoDB etc.) which majorly used JSON structures. I had to convert the data fetched from the APIs to JSON. Similarly, when I query the database I had to read and process JSON structures. I felt the need for a secure utility which would do this job for me. This was not the only time I need this utility. Even in my data science class I had to convert excel / web scraped tables to CSV files. I soon found the need to build something which would be useful for me and would also contribute to the open source community. The libraries exist, but I found the need to build myself a secure all-in-one platform which is fully extensible. CPSC 210’s personal project is a great opportunity for me to build this and get guidance for making this project successful with an interactive UI.
Follow these steps to get the software up and running on your local machine.
MAC OS:
- Intel-based Mac running Mac OS X 10.8.3+, 10.9+
- Administrator privileges for installation
- 64-bit browser
WINDOWS:
- Windows Server 2008 R2 SP1 (64-bit) and above
- RAM: 128 MB
- Disk space: 124 MB for JRE; 2 MB for Java Update
- Processor: Minimum Pentium 2 266 MHz processor
- Browsers: Internet Explorer 9 and above, Firefox
STEPS:
- Get java IDE installed.
- To test and modify the code have Amazon Correto JDK 8 installed
jre [INSTALLCFG=configuration_file_path] [options]
- Clone the repo
git clone https://github.students.cs.ubc.ca/CPSC210-2020W-T1/project_w6y2b.git
- Open Source Code on any java IDE.
Copyright (C) 2020 Vishal Desh
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
API docs and video tutorials - To be updated soon.....
- Just fork a version of this repository, make the changes you want to, and make a pull request.
- I will review the pull request, and accept or reject any incoming changes after testing.
Vishal Desh - LinkedIn - [email protected]
Personal Website: Link
- Apache POI HSSF and XSSF Examples
- Apache POI Tutorial by Code Java
- JSON load/save data UBC
- Swing Tutorial for Combo Box
- Introduction to Swing Tutorial
- Login Application Swing Tutorial
- Swing Tutorial for Forms in inteliJ
- As a User, I want to be able to read all the Source File Formats
- As a User, I want to be able to display the current Source File contents in the Console based UI
- As a User, I want to be able to convert the file into another File Type Object
- As a User, I want to be able to Navigate through a user-friendly Console UI
- As a User, I want to be able to provide commands for particular file conversions (eg: Providing the Delimiter for Text File data conversion)
- Path for Excel File Test :
./data/student.xlsx
- Path for Text File Test :
./data/gdpdemo.txt
- Path for XML File Test :
./data/XMLFile.xml
- Path for CSV File Test :
./data/SampleData.csv
- Excel to JSON (Returns JSON object and then converted to String)
- As a User, I want to be able to perform a file conversion and save it in the new format in my disk
- As a User, I want to be able to login (Load and Read from Workroom) to use this application
- As a User, I want to provide access permission to add kids to this application
- As a User, I want to be able to sign-up (Save to WorkRoom) as a new user and get added to the workroom of this application (Multiple X -> Y)
- Path for Excel File Test :
./data/student.xlsx
- Path for Text File Test :
./data/gdpdemo.txt
- Path for XML File Test :
./data/XMLFile.xml
- Path for CSV File Test :
./data/SampleData.csv
This will now be followed by a prompt to save in your data folder.
- Follow the console to login or create an User account.
- You will be able to manually view the Json file in the data folder.
- You can allot access permission as true and false for the users you create and test that by following the UI.
- All the file conversions can now be saved to your disk in the appropriate file format and extension.
- Follow the UI to write to the data file path and then view it on inteliJ.
- As a User, I want to be able to navigate through a user-friendly GUI.
- As a User, I want to be able to login (Load and Read from Workroom) to use this application.
- As a User, through the GUI, I want to be able to sign-up (Save to WorkRoom) as a new user and get added to the workroom of this application (Multiple X -> Y)
- As a User, through the GUI, I want to see all the names / user names registered in my Work Room / System (Displaying a subset of X's in Y)
- As a User, through the GUI, I want to be able to Login (Read from WorkRoom) to use the DevTools Utility Hub.
- As a user, Through the GUI, I want to be able to perform all types of file conversions
- As a user, I should be able to hear sounds when I click a buttons (Audio-Visual Component).
- Path for Excel File Test :
./data/student.xlsx
- Path for Text File Test :
./data/gdpdemo.txt
- Path for XML File Test :
./data/XMLFile.xml
- Path for CSV File Test :
./data/SampleData.csv
Chosen Option : Make appropriate use of the Map interface somewhere in your code.
- Used Map interface in
Read and Operate CSV
class to create a JSON structure by mapping all the values in a CSV file separated by commas using aCSVMapper
and placing them in theMap
using aMapping iterator
. I have used this to construct a JSON structure which can then be written into a JSON File.
UML Class Level Diagram Located in Path : ./UML Class Diagram for DevTools.png
All the model classes had a Test class which tested it (uni-directional)
-
Class
Login
: Has an object of User,Workrrom and JsonWriter, JsonReader each as its data members -
Class
WorkRoom
: Has two instances of a dependency with a User Object. (Temporarily uses the user object in its function body) -
Class
User
: Implements Writable. The dotted line used here doesnt have a white arrow head. -
Class
JsonReader
: Has two instances of a dependency with a WorkRoom Object. (Temporarily uses the user object in its function body) -
Class
JsonWriter
: Has two instances of a dependency with a WorkRoom Object. (Temporarily uses the user object in its function body) -
Class
ConverterPageUI
: Has a dependency of a User object passed through the constructor. It doesn't initialize a data member. Hence, it is depicted with (extends+dotted arrows). Note : There is no inheritance which takes place here. (Just noted with two arrows).
- Analyzing the UML diagram, you can see that there isn’t a lot of simplification you can do to the Type Hierarchy.
- Looking at the code there are several classes which could potentially be simplified to remove redundant code.
- For example, in the Phase 1 model design, there were several instances of redundant
convertToX
methods for each source file type. To mitigate this issue, I would have created a separate abstract class with these methods and extend the source file classes to the abstract class to remove redundant code. - Also, I would refactor the duplicate UI methods. For example, the quit method in every UI page performs the same action. I would create these common methods separately as an utility class and make calls to it.