· 6 years ago · Mar 30, 2020, 10:30 PM
1<html>
2<head></head>
3<body>
4<h1> Question:</h1>
5<div class="ugc-base question-body-text">
6<div class=""><p>Using Java</p>
7<p><img alt="JavaScript Object Notation or JSON is a well-known, lightweight data-interchange format, which is easily readable/writable by" aria-describedby="do7" src="https://media.cheggcdn.com/media/d54/d542f3a8-9899-4024-85f0-f0814569e82a/phpkQCEFQ.png" style="height:473px;width:641px;"/><img alt="There are many parsers available for JSON developed in may programming language as library, API, etc. Mendeley [3] is one exa" aria-describedby="do8" src="https://media.cheggcdn.com/media/f04/f041e1c8-1dbe-4d6f-b878-67d43159e639/phpB02P0B.png" style="height:222px;width:642px;"/><img alt="Or in ACM format would be: [1] J. Park et al. 2018. Optimal DASH-Multicasting over LTE. IEEE Transactions on Vehicular Techno" aria-describedby="do9" src="https://media.cheggcdn.com/media/0bb/0bb0bcbb-9169-45ab-8fa3-363730280d9c/phpbPLFTk.png" style="height:516px;width:648px;"/><img alt="The fine details of what you need to do and how your Bibliography Factory should work are given below. 1. For the purpose of" aria-describedby="doa" src="https://media.cheggcdn.com/media/488/488548e5-e2e3-4207-9fe6-48b2d4e42348/phpl7c6BD.png" style="height:393px;width:646px;"/><img alt="@ARTICLE 9247289. author Park and J. N. James and Q. Li and Y. Xu and W. Huang), journal IEEE Transactions on Vehicular Techn" aria-describedby="dob" src="https://media.cheggcdn.com/media/6a6/6a6dc58f-4855-4fe7-88c4-8dd0f0b2e894/phpren2c5.png" style="height:527px;width:630px;"/><img alt="3. In the main() method of the BibilographyFactory class, attempt to open all 10 input files (Latexl.bib to Latex 10.bib) for" aria-describedby="doc" src="https://media.cheggcdn.com/media/2b8/2b8bc8a9-4342-482a-94e0-c704fb21e8c4/phpQX7XPN.png" style="height:402px;width:631px;"/><img alt="NJ10.json). You need to use Print Writer to open these output files. If any of these output files cannot be created, then y" aria-describedby="dod" src="https://media.cheggcdn.com/media/da4/da46b0b8-3b59-4e1a-952c-36d90360163b/php1Vuo5e.png" style="height:433px;width:643px;"/><img alt="For instance, let us assume that the given input files (these files can be any files and they are not restricted to the ones" aria-describedby="doe" src="https://media.cheggcdn.com/media/dc7/dc761daf-36a5-4603-bed5-ae60857b0392/phpbX9OZ6.png" style="height:407px;width:649px;"/><img alt="I I . Bibilography Factory - 0 X File Home Share View 6 = > This PC > Windows (C) > Users > admin > eclipse-workspace > Bibil" aria-describedby="dof" src="https://media.cheggcdn.com/media/79a/79aa1f99-6b9a-4a74-a71e-569c6eeba93e/phpjYypKf.png" style="height:457px;width:654px;"/><img alt="8. Finally, here are some general information: a. It may assist you greatly if you take advantage of static variables/attribu" aria-describedby="dog" src="https://media.cheggcdn.com/media/c32/c32146b6-776c-4c55-af0f-5152f6931b10/php5g5BQL.png" style="height:343px;width:632px;"/><img alt="w ww active Core : c l aracy Program D . Feb 27, 2000, 2230 PM Error Detected Eesty Feld Probleme detected with input Fade Is" aria-describedby="doh" src="https://media.cheggcdn.com/media/2fd/2fd870ae-5d03-4120-8b79-8dab7b44285d/phpnxqlAq.png" style="height:658px;width:649px;"/><img alt="MATICLE author parland. N a d Q. Land Y. and. He journalIEEE Transactions on Vehicular Technology). title-Optimal MSH-Multica" aria-describedby="doi" src="https://media.cheggcdn.com/media/226/226a0eea-1ebd-4eee-9948-233bb4f15f04/php29K9h4.png" style="height:611px;width:640px;"/><img alt="1. PR . N. &0. L&Y & Hangoptimal Hulticasting over LTE. TEEE Transactions on whicular Technology. PP, 15-27(2016). 1. Jackson" aria-describedby="doj" src="https://media.cheggcdn.com/media/34d/34d3293b-7a11-4896-834d-eae9e5c41dbe/phpcmTZSx.png" style="height:122px;width:643px;"/></p>
8<div class="hidden" id="do7">JavaScript Object Notation or JSON is a well-known, lightweight data-interchange format, which is easily readable/writable by humans [1][2]. It is also easy for machines to parse and generate. JSON is based on data objects consisting of attribute-value pairs and array data types. It is widely used for asynchronous browser-server communication, including as a replacement for XML in some AJAX-style systems. As such, many journals and scientific servers are supporting this format. This format is easily extendable. The following is a typical sample (modified from an existing IEEE paper). @ARTICLE 8247289, author={J. Park and J. N. James and Q. Li and Y. Xu and W. Huang, journal={IEEE Transactions on Vehicular Technology, title={Optimal DASH-Multicasting over LTE), year={2018}, volume={PP}, number={99), pages={15-27), keywords={Forward error correction;Long Term Evolution; Maintenance engineering: Multicast communication;Resource management;Static VAr compensators; Streaming media;DASH;LTE;convex optimization;eMBMS;multicasting}, doi={10.1109/TVT.2018.2789899), ISSN={0018-9545), month={January), In JSON, the fields however do not need to be placed in specific order. For example, in the above example, you can have the "number" filed for instance, be written above the "year" field, and so on. </div><div class="hidden" id="do8">There are many parsers available for JSON developed in may programming language as library, API, etc. Mendeley [3] is one example that uses this format. With Mendeley you can create your own library from all articles that you have read so far and you can use them when you want to write an article. Consequently, this is very good for inserting the needed references on a published paper and managing them afterwards. In particular, such tools can import the article(s) information from a bibliography file (.bib) and generate the reference(s) in particular format according to the conference or journal publisher standard. For example, the representation of this file in IEEE format would be (this is a slightly simplified version than the actual one; however you need to follow this format for the scope of this assignment): J. Park, J. N. James, Q. Li, Y. Xu, W. Huang. "Optimal DASH-Multicasting over LTE", IEEE Transactions on Vehicular Technology, vol. PP, no. 99, p. 15-27, January 2018. </div><div class="hidden" id="do9">Or in ACM format would be: [1] J. Park et al. 2018. Optimal DASH-Multicasting over LTE. IEEE Transactions on Vehicular Technology. PP, 99 (2018), 15-27. DOI:https://doi.org/10.1109/TVT.2018.2789899. And finally, in Nature Journal (NJ), which is one of the most famous journals in natural science, would be J. Park & J. N. James & Q. Li & Y. Xu & W. Huang. Optimal DASH-Multicasting over LTE. IEEE Transactions on Vehicular Technology. PP, 15-27(2018). You should have a "very" detailed look at these formats to see how they are mapped from the original record of the article. In this assignment, you will be designing and implementing an alternative tool to the existing ones), called Bibliography Factory. The main task of this tool is read and process a given .bib file (which has one or more articles) and create 3 different files with the correct reference formats for IEEE, ACM and NJ. In short, you are given 10 files, called Latexl.bib to Latex 10.bib. You Bibliography Factory application will need to read all 10 input files (in one execution), determine whether each of these files is valid or not (details given below). If a file is valid, then Bibliography Factory will create 3 different files based on the articles in this file, one for IEEE format, one for ACM format and the last for NJ format. To distinguish our application from other existing similar software, we will call these files IEEEi.json, ACMi.json, and NJi.json (although in fact, the created files contain the references to the articles, and not json records!), where i is the Latex file #. For instance, Latex3.bib will result in the creation of 3 files called: IEEE3.json, ACM3.json and NJ3.json. If a file is invalid, then none of the 3 output reference files (for this invalid file) is created. So, in best case, Bibliography Factory execution will result in the creation of 30 output files if all given Latex files are valid, and in worst case it will create 0 files (when all 10 input files are invalid). </div><div class="hidden" id="doa">The fine details of what you need to do and how your Bibliography Factory should work are given below. 1. For the purpose of this assignment, and to provide little simplifications, the following should be assumed in relation to the input files and the articles (records) in these input file: a. Each file may have one or more articles; the number is unknown before processing, and your code must assume that; b. An article starts with @ARTICLE followed by the body of the article (between "{" and "?"). It is assumed that all articles have enclosing bodies; c. Inside each of these articles, there exists few fields; i.e. author, volume, year, etc. These fields are assumed to always start with the field name, followed by an " sign and a "" character. For instance: pages-{, month-, etc. d. It also assumed that each of the bodies of these fields have a closing character for its body. In specific, it is assumed that each of these fields end with ","; e. For simplicity, it is also assumed that there is a doi field, which maps to https://doi.org/ f. The order of the article is NOT important. i.e., it is okay to have any of these fields above or below other fields; g. It is also assumed that empty lines can be there within the body of the articles, as well as between different articles; h. HOWEVER (read carefully), any of the input files may have some of these fields as empty; i.e. number-{}, title-{}, etc. This is what we classify as an Invalid File. In other words, for a file to be valid, the file cannot have an empty field at any of its articles. Below is an image of an invalid file. </div><div class="hidden" id="dob">@ARTICLE 9247289. author Park and J. N. James and Q. Li and Y. Xu and W. Huang), journal IEEE Transactions on Vehicular Technology}, title={}, year={2018}, volume-{PP}, number={}, pages={15-27}, keywords-{Forward error correction; Long Term Evolution; Maintenance engineering, Multicast commun doi=10.1109/TVT.2018. 2789899}, ISSN={2018-9545), month-(January), This is also empty, but processing will not QARTICLE reach here as the file has already been determined to be invalid! 2380090 author- journal={IEEE Transactions on Computer Science}, title={Detecting Security Vulnerabilities in Binary Code), year-{2017}, volume={0} number={85}, pages-1), keywords{Security attacks;Binary code processing; Security error detection;Deep machine learnin doi={14.2408/TCS. 2017.4746889). Figure 1. Example of an Invalid Input File 2. Write an exception class called FileInvalidException exception. The class should have sufficient constructors allow: a. A default error message "Error: Input file cannot be parsed due to missing information (i.e. month={}, title={, etc.)“to be stored in the thrown object; and b. The passing of any different error message if desired. This is actually the constructor that you will be using throughout the assignment (see Figure 3 below). </div><div class="hidden" id="doc">3. In the main() method of the BibilographyFactory class, attempt to open all 10 input files (Latexl.bib to Latex 10.bib) for reading. You need to use the Scanner class for the reading these files. If any of these files does not exist, the program must display an error message indicating "Could not open input file xxxxx for reading. Please check if file exists! Program will terminate after closing any opened files.", and then exits. You MUST however, close all opened files before exiting the program. For example, if Latex3.bib does not exist, then the following image shows the behavior of the program. eclipse-workspace - BibCreator/src/Bibilographyfactory/Bibilography Factoryjava - Eclipse Eile Edit Source Refactor Navigate Search Project Fun Window Help Console 11 <terminated> Bibilography Factory Java Application C\Program Files Java pre 1.8.0 161\binjavaw.exe (Feb 27, 2020, 80631 PM) Welcome to Bibilography Factory! Could not open input file Latex3.bib for reading. Please check if file exists! Program will terminate after closing any opened files. Figure 2. Example of Program Termination - One of the Input Files does not Exist 4. If all 10 input files can successfully be opened, the program will attempt to open/create all 30 output files (IEEE1.json to IEEE10.json, ACM1.json to ACM10.json, and NJ1.json to </div><div class="hidden" id="dod">NJ10.json). You need to use Print Writer to open these output files. If "any" of these output files cannot be created, then you must: a. Display a message to the user indicating which file could not be opened/created; b. Delete all other created output files (if any). That is, if you cannot create all of these output files, then you must clean the directory by deleting all other created files; c. Close all opened input files; then exit the program. If you reach this step, then all 10 input files have been opened and all 30 output files have also been created (however, they are surely empty). 5. Write a method (you should take advantage of static throughout the entire assignment!) called process Files ForValidation. This method will represent the core engine for processing the input files and creating the output ones. You can pass any needed parameters to this method, and the method may return any needed information. This method however must NOT declare any exceptions. In other words, all needed handling of any exceptions that may occur within this method, must be handled by the method. In specific: a. The method should work on the already opened files; b. A method must process each of these files to find out whether it is valid or not; c. If a file is valid, then the method must create the proper records for each of the 3 formats (IEEE, ACM and NJ) and store them in these files; d. If a file is invalid, then the method must stop the processing of this file only, throws FileInvalidException to display the exception error message, then display a message indicating which file was detected as invalid, and where the "first" problem in that file was detected (See Figure 3). The corresponding output file MUST then be deleted; e. The method will then continue with the processing of the following file. </div><div class="hidden" id="doe">For instance, let us assume that the given input files (these files can be any files and they are not restricted to the ones provided with the assignment; in fact, the marker will execute your assignment with different files; so your code must work correctly for any given files) have 3 invalid files, Latex3.bib, Latex4.bib and Latex 8.bib. Your program must detect these invalid files and show the following: ac pre-warae w p actar Be Bot Source Recor D e Seara De Pue Wow Hele - .... SAP O ***** blog a ctory Cave Application Program File Welcome to Bibiloppy Factory! . 16 . 27. 2020, 2:17 PM Error: Detected Empty Field! Problem detected with input file: latex.bib File is invalid: Field onth is Empty. Processing stoped at this point. Other empty fields may be present as well Probles detected with Seput file latest in File is Invalid Field "pages" is Empty. Processing stoped at this point. Other ty fields way be present as well! Error Detected Empty Fieldi Problem detected with Snput Fle: Lates.bib File is Tnwalld: Field journal" is fepty, Processing stoped at this point. Other capty Helds wy be present as we111 A total of a les were invald, and could not be processed. All other actites huwe been created. Please enter the name of one of the files that you need to review: Figure 3. Example of Processing - Number of Invalid Files and Particular Fields are Indicated 6. Again, once the processing is done, all unsuccessfully created files MUST be deleted. Here is how the directory would look like at this point based on the above senario: </div><div class="hidden" id="dof">I I . Bibilography Factory - 0 X File Home Share View 6 = > This PC > Windows (C) > Users > admin > eclipse-workspace > Bibilography Factory Search Bibilography Factory Quick access settings bin STC classpath project ACM1 ACM2 ACMS Desktop Downloads Documents Pictures ACME ACM10 Latex1 Concordia Latexz Latex Latex Latex Latex 10 NJ1 Google Drive 5 File 10 Assg3 PPTS Student-ref-lett N2 NS NJ6 NT NJ9 N 10 OneDrive This PC Figure 4. Contents of Current Directory after above processing Example 7. Finally, at this point, the program needs to ask the user to enter the name of one of the created output files to display. If the user enters an invalid name, a FileNotFoundException should be thrown; however, the user is allowed a second and final chance to enter another name. If this second attempt also fails, then the program exits. Figure 5 and Figure 6 below show the behavior of this program. You must however apply the following: - If the entered file is valid, then your program must open this file for reading using the Buffered Reader class. Do not use the Scanner class to read the file for that task. </div><div class="hidden" id="dog">8. Finally, here are some general information: a. It may assist you greatly if you take advantage of static variables/attributes and static attributes throughout the assignment; in fact, it is not necessary to utilize other aspects such as Inheritance, Polymorphism, etc. b. You must exactly match the format and look of the expected output files. For instance, use & or et al. for the authors as expected, follow the exact order/format of the contents, use vol. instead of volume when as expected. In other words, a small difference in the expected output will surely result in mark deduction; c. For the processing of the authors, you may want to use the StringTokenizer class; d. You should minimize opening and closing the files as much as possible; a better mark will be given for that: e. Do not use any external libraries or existing software to produce what is needed; that will directly result in a 0 mark! f. Again, your program must work for any input files. The files provided with this assignment are only one possible version, and must not be considered as the general case when writing your code. g. To make sure that the requirments are very clear to you, Figure 7 given an image (partially) of a sample input file, and Figures 8, 9 & 10 show the output of this sample file in the 3 formats. These files are also provided with the assignment. </div><div class="hidden" id="doh">w ww active Core : c l aracy Program D . Feb 27, 2000, 2230 PM Error Detected Eesty Feld Probleme detected with input Fade Is Inwelle: Field le Latex.ba Is Boty. Processing stoped at this point therapy felds may be present as well File is Inwalid: Field s is Eroty. Processing stoped at this point. Other compty fields may be present as well Dette Ety Field Probe detected with Input les Lates.bib Filets Irelie: Fred journalisty. Processing this point other empty fulds may be present well A total of 3 files were invalid, and could not be processed. All other lid" file has been created Ce not open sout file. File does not exist possibly it could not be created the same of one of the files that you need to rev : Could not open input file again! Either le does not editar could not be created Sermet t e display desired last will crit! Figure 5. Example of Double-Fault for Displaying an Output File cowor o royector Bibliography Bloggtory level a Program AD Diagra Welcome to Bi L t ory Error Detected fry Field Probe detected with Input 1 Latex.bdb File is welie: Field oth is oly. Processing this point other ty es may be present as well Errer: Detected agty Field Probe detected with Input le Labib Files Invalid: Teld en Empty. Processing stoped at this point. Other empty fields may be present as well F3 is Invalie: Fuld journal" septy, Processing sedut this point other ty ses may be prental A total of 21s were invuld, and could not be proced. All other "Wild Tiles have been created Please enter the same of one of the files that you need to www . Could not open input file. File does not exist sibly it could not be created! However, you will be allowed another chance to enter another filenom e of one of the files that you need to re s 3. Park et al. 2018. Otal Hutcasting over LTE. TEEE Transactions on Vehicle Techlecy. PP. (2008), 15-7. DOIttps:// eng/10.1109/TV2018.789899 [2] T. Jackson et al. 2007. Detecting Security Wilnerabilities in Binary Code. TEEE Transion of Computer Science. 00.5 (2017), 1-12. Dotos// g/14.20/10 2017, 4706689 (3] S. Si et al. 2016. Salting Power Systems for the Detection of Rote Attacks. DEEE Transactions on Power System. FF. 2 (2016). 132-145. DOIts//doi.org/15.12 .2006.4399 (4) T K om et al. 20. Besedility itim Mobile works and lication , 2018), 64-12. DOI ://doi.org/23. / 2006.2003 Boedel Hope you have enjoyed creating the needed files using Bibilography Factory Figure 6. Example of Displaying the Contents of a Successfully Created Output File </div><div class="hidden" id="doi">MATICLE author parland. N a d Q. Land Y. and. He journalIEEE Transactions on Vehicular Technology). title-Optimal MSH-Multicasting over LTE). L (15-27). ordForward error correction; Long Term Evolutionisten do 10.1109/TVT. 2019.2729899), ISSA0018-9545). . NATICLE authorit. Jackson and A. H. Peterson and N. Wang, journal-IEEE Transactions on computer Science, year (2017) pages(12) titleDetecting Security vulnerabilities in Rimary Code). keywords-[Security attacks;Binary code processing security error detection; Deep machine learning Static analysis). dol-114.2406/T05.2017.41462) 1551-0018-9545) month(May). authors. Simon and K. Toman, journalTEEE Transactions on Power Systems). title-Simlating Power Systems for the detection of Remote Attacks) year (2010) volume) Figure 7. Example of a Sample Bib Input File - Partial Image Serge Nord He to for View Hep D. Park, ). N ames, Q. LI, Y. Xu, W. , "Optimal - Multicastleg over LTE", IEEE Transactions on vehicular Technology, vol. PP, no. 99, p. 15-27, January 2018 T. Jackson, A. H. Peterson, N. ing. "Detecting Security Vulnerabilities in Dinary Code, IEEE Transactions on Computer Science, vol. 9, no. 5, P. 1-12, May 2017. 5. Simon, K. Tomson. Simulating Power Systems for the detection of Remote Attacks", IEEE Transactions on Power Systems, vol. FF, No. 2, p. 132-145, November 2016 T. E. Roman, C. Henry or., L. Fevens. IP-Based Mobility Optimisation Mobile Networks and Application, vol. A, no. 4, p. -12, February 20L Figure 8. The Created IEEE File for the above Sample Bib File ACMSample - Noped Pe tot movie HD 11] . Park et al. 2018. Optimal DASH-Pulticasting over LTE, IEEE Transactions on vehicular Technology. PP, 99 (2018), 15-27. https://doi.org/10.1109/TVI.2018.2788899 (2) T. Jackson et al. 2017. Detecting Security vulnerabilities in Binary Code. IEEE Transaction on computer Science. W. (2017), 1-12. Dohttps://doi.org/14.20/TCS.2017.74S. [3] S. Simon et al. 2016. Similate Power Systems for the Detection of Remote Attacks. IEEE Transactions on Power Systems, FF, 92 (2016), 132-145. DOI:https/doi.org/15. 128/TP.2016 (a) T. E. Roman et al. 2011. IP-Based Mobility Optimization Mobile Wetworks and Applications. An, (2010), 6-12. DOI: https://doi.org/23.54198/PS.2016. 1700005 Figure 9. The Created ACM File for the above Sample Bib File </div><div class="hidden" id="doj">1. PR . N. &0. L&Y & Hangoptimal Hulticasting over LTE. TEEE Transactions on whicular Technology. PP, 15-27(2016). 1. Jackson & A. H. Peterson, w t ecting security willilities in Binary code. The transactions on computer Science. 00.1-122017) 5. Simon Town Simulation Power Systems for the Detection of te Attacks. BE Tractions on Power Systems , 12-1452016) T. & C. Henry Ir. & L. Fevens. IP Based Mobility optimization. Mobile networks and Applications, MA, 64-822018) Figure 10. The Created Natural Journal File for the above Sample Bib File </div></div>
9<span class="transcribed-text">Show transcribed image text</span> <span class="transcribed-image-text hidden">JavaScript Object Notation or JSON is a well-known, lightweight data-interchange format, which is easily readable/writable by humans [1][2]. It is also easy for machines to parse and generate. JSON is based on data objects consisting of attribute-value pairs and array data types. It is widely used for asynchronous browser-server communication, including as a replacement for XML in some AJAX-style systems. As such, many journals and scientific servers are supporting this format. This format is easily extendable. The following is a typical sample (modified from an existing IEEE paper). @ARTICLE 8247289, author={J. Park and J. N. James and Q. Li and Y. Xu and W. Huang, journal={IEEE Transactions on Vehicular Technology, title={Optimal DASH-Multicasting over LTE), year={2018}, volume={PP}, number={99), pages={15-27), keywords={Forward error correction;Long Term Evolution; Maintenance engineering: Multicast communication;Resource management;Static VAr compensators; Streaming media;DASH;LTE;convex optimization;eMBMS;multicasting}, doi={10.1109/TVT.2018.2789899), ISSN={0018-9545), month={January), In JSON, the fields however do not need to be placed in specific order. For example, in the above example, you can have the "number" filed for instance, be written above the "year" field, and so on. <br/>
10There are many parsers available for JSON developed in may programming language as library, API, etc. Mendeley [3] is one example that uses this format. With Mendeley you can create your own library from all articles that you have read so far and you can use them when you want to write an article. Consequently, this is very good for inserting the needed references on a published paper and managing them afterwards. In particular, such tools can import the article(s) information from a bibliography file (.bib) and generate the reference(s) in particular format according to the conference or journal publisher standard. For example, the representation of this file in IEEE format would be (this is a slightly simplified version than the actual one; however you need to follow this format for the scope of this assignment): J. Park, J. N. James, Q. Li, Y. Xu, W. Huang. "Optimal DASH-Multicasting over LTE", IEEE Transactions on Vehicular Technology, vol. PP, no. 99, p. 15-27, January 2018. <br/>
11Or in ACM format would be: [1] J. Park et al. 2018. Optimal DASH-Multicasting over LTE. IEEE Transactions on Vehicular Technology. PP, 99 (2018), 15-27. DOI:https://doi.org/10.1109/TVT.2018.2789899. And finally, in Nature Journal (NJ), which is one of the most famous journals in natural science, would be J. Park & J. N. James & Q. Li & Y. Xu & W. Huang. Optimal DASH-Multicasting over LTE. IEEE Transactions on Vehicular Technology. PP, 15-27(2018). You should have a "very" detailed look at these formats to see how they are mapped from the original record of the article. In this assignment, you will be designing and implementing an alternative tool to the existing ones), called Bibliography Factory. The main task of this tool is read and process a given .bib file (which has one or more articles) and create 3 different files with the correct reference formats for IEEE, ACM and NJ. In short, you are given 10 files, called Latexl.bib to Latex 10.bib. You Bibliography Factory application will need to read all 10 input files (in one execution), determine whether each of these files is valid or not (details given below). If a file is valid, then Bibliography Factory will create 3 different files based on the articles in this file, one for IEEE format, one for ACM format and the last for NJ format. To distinguish our application from other existing similar software, we will call these files IEEEi.json, ACMi.json, and NJi.json (although in fact, the created files contain the references to the articles, and not json records!), where i is the Latex file #. For instance, Latex3.bib will result in the creation of 3 files called: IEEE3.json, ACM3.json and NJ3.json. If a file is invalid, then none of the 3 output reference files (for this invalid file) is created. So, in best case, Bibliography Factory execution will result in the creation of 30 output files if all given Latex files are valid, and in worst case it will create 0 files (when all 10 input files are invalid). <br/>
12The fine details of what you need to do and how your Bibliography Factory should work are given below. 1. For the purpose of this assignment, and to provide little simplifications, the following should be assumed in relation to the input files and the articles (records) in these input file: a. Each file may have one or more articles; the number is unknown before processing, and your code must assume that; b. An article starts with @ARTICLE followed by the body of the article (between "{" and "?"). It is assumed that all articles have enclosing bodies; c. Inside each of these articles, there exists few fields; i.e. author, volume, year, etc. These fields are assumed to always start with the field name, followed by an " sign and a "" character. For instance: pages-{, month-, etc. d. It also assumed that each of the bodies of these fields have a closing character for its body. In specific, it is assumed that each of these fields end with ","; e. For simplicity, it is also assumed that there is a doi field, which maps to https://doi.org/ f. The order of the article is NOT important. i.e., it is okay to have any of these fields above or below other fields; g. It is also assumed that empty lines can be there within the body of the articles, as well as between different articles; h. HOWEVER (read carefully), any of the input files may have some of these fields as empty; i.e. number-{}, title-{}, etc. This is what we classify as an Invalid File. In other words, for a file to be valid, the file cannot have an empty field at any of its articles. Below is an image of an invalid file. <br/>
13@ARTICLE 9247289. author Park and J. N. James and Q. Li and Y. Xu and W. Huang), journal IEEE Transactions on Vehicular Technology}, title={}, year={2018}, volume-{PP}, number={}, pages={15-27}, keywords-{Forward error correction; Long Term Evolution; Maintenance engineering, Multicast commun doi=10.1109/TVT.2018. 2789899}, ISSN={2018-9545), month-(January), This is also empty, but processing will not QARTICLE reach here as the file has already been determined to be invalid! 2380090 author- journal={IEEE Transactions on Computer Science}, title={Detecting Security Vulnerabilities in Binary Code), year-{2017}, volume={0} number={85}, pages-1), keywords{Security attacks;Binary code processing; Security error detection;Deep machine learnin doi={14.2408/TCS. 2017.4746889). Figure 1. Example of an Invalid Input File 2. Write an exception class called FileInvalidException exception. The class should have sufficient constructors allow: a. A default error message "Error: Input file cannot be parsed due to missing information (i.e. month={}, title={, etc.)“to be stored in the thrown object; and b. The passing of any different error message if desired. This is actually the constructor that you will be using throughout the assignment (see Figure 3 below). <br/>
143. In the main() method of the BibilographyFactory class, attempt to open all 10 input files (Latexl.bib to Latex 10.bib) for reading. You need to use the Scanner class for the reading these files. If any of these files does not exist, the program must display an error message indicating "Could not open input file xxxxx for reading. Please check if file exists! Program will terminate after closing any opened files.", and then exits. You MUST however, close all opened files before exiting the program. For example, if Latex3.bib does not exist, then the following image shows the behavior of the program. eclipse-workspace - BibCreator/src/Bibilographyfactory/Bibilography Factoryjava - Eclipse Eile Edit Source Refactor Navigate Search Project Fun Window Help Console 11 Bibilography Factory Java Application C\Program Files Java pre 1.8.0 161\binjavaw.exe (Feb 27, 2020, 80631 PM) Welcome to Bibilography Factory! Could not open input file Latex3.bib for reading. Please check if file exists! Program will terminate after closing any opened files. Figure 2. Example of Program Termination - One of the Input Files does not Exist 4. If all 10 input files can successfully be opened, the program will attempt to open/create all 30 output files (IEEE1.json to IEEE10.json, ACM1.json to ACM10.json, and NJ1.json to <br/>
15NJ10.json). You need to use Print Writer to open these output files. If "any" of these output files cannot be created, then you must: a. Display a message to the user indicating which file could not be opened/created; b. Delete all other created output files (if any). That is, if you cannot create all of these output files, then you must clean the directory by deleting all other created files; c. Close all opened input files; then exit the program. If you reach this step, then all 10 input files have been opened and all 30 output files have also been created (however, they are surely empty). 5. Write a method (you should take advantage of static throughout the entire assignment!) called process Files ForValidation. This method will represent the core engine for processing the input files and creating the output ones. You can pass any needed parameters to this method, and the method may return any needed information. This method however must NOT declare any exceptions. In other words, all needed handling of any exceptions that may occur within this method, must be handled by the method. In specific: a. The method should work on the already opened files; b. A method must process each of these files to find out whether it is valid or not; c. If a file is valid, then the method must create the proper records for each of the 3 formats (IEEE, ACM and NJ) and store them in these files; d. If a file is invalid, then the method must stop the processing of this file only, throws FileInvalidException to display the exception error message, then display a message indicating which file was detected as invalid, and where the "first" problem in that file was detected (See Figure 3). The corresponding output file MUST then be deleted; e. The method will then continue with the processing of the following file. <br/>
16For instance, let us assume that the given input files (these files can be any files and they are not restricted to the ones provided with the assignment; in fact, the marker will execute your assignment with different files; so your code must work correctly for any given files) have 3 invalid files, Latex3.bib, Latex4.bib and Latex 8.bib. Your program must detect these invalid files and show the following: ac pre-warae w p actar Be Bot Source Recor D e Seara De Pue Wow Hele - .... SAP O ***** blog a ctory Cave Application Program File Welcome to Bibiloppy Factory! . 16 . 27. 2020, 2:17 PM Error: Detected Empty Field! Problem detected with input file: latex.bib File is invalid: Field onth is Empty. Processing stoped at this point. Other empty fields may be present as well Probles detected with Seput file latest in File is Invalid Field "pages" is Empty. Processing stoped at this point. Other ty fields way be present as well! Error Detected Empty Fieldi Problem detected with Snput Fle: Lates.bib File is Tnwalld: Field journal" is fepty, Processing stoped at this point. Other capty Helds wy be present as we111 A total of a les were invald, and could not be processed. All other actites huwe been created. Please enter the name of one of the files that you need to review: Figure 3. Example of Processing - Number of Invalid Files and Particular Fields are Indicated 6. Again, once the processing is done, all unsuccessfully created files MUST be deleted. Here is how the directory would look like at this point based on the above senario: <br/>
17I I . Bibilography Factory - 0 X File Home Share View 6 = > This PC > Windows (C) > Users > admin > eclipse-workspace > Bibilography Factory Search Bibilography Factory Quick access settings bin STC classpath project ACM1 ACM2 ACMS Desktop Downloads Documents Pictures ACME ACM10 Latex1 Concordia Latexz Latex Latex Latex Latex 10 NJ1 Google Drive 5 File 10 Assg3 PPTS Student-ref-lett N2 NS NJ6 NT NJ9 N 10 OneDrive This PC Figure 4. Contents of Current Directory after above processing Example 7. Finally, at this point, the program needs to ask the user to enter the name of one of the created output files to display. If the user enters an invalid name, a FileNotFoundException should be thrown; however, the user is allowed a second and final chance to enter another name. If this second attempt also fails, then the program exits. Figure 5 and Figure 6 below show the behavior of this program. You must however apply the following: - If the entered file is valid, then your program must open this file for reading using the Buffered Reader class. Do not use the Scanner class to read the file for that task. <br/>
188. Finally, here are some general information: a. It may assist you greatly if you take advantage of static variables/attributes and static attributes throughout the assignment; in fact, it is not necessary to utilize other aspects such as Inheritance, Polymorphism, etc. b. You must exactly match the format and look of the expected output files. For instance, use & or et al. for the authors as expected, follow the exact order/format of the contents, use vol. instead of volume when as expected. In other words, a small difference in the expected output will surely result in mark deduction; c. For the processing of the authors, you may want to use the StringTokenizer class; d. You should minimize opening and closing the files as much as possible; a better mark will be given for that: e. Do not use any external libraries or existing software to produce what is needed; that will directly result in a 0 mark! f. Again, your program must work for any input files. The files provided with this assignment are only one possible version, and must not be considered as the general case when writing your code. g. To make sure that the requirments are very clear to you, Figure 7 given an image (partially) of a sample input file, and Figures 8, 9 & 10 show the output of this sample file in the 3 formats. These files are also provided with the assignment. <br/>
19w ww active Core : c l aracy Program D . Feb 27, 2000, 2230 PM Error Detected Eesty Feld Probleme detected with input Fade Is Inwelle: Field le Latex.ba Is Boty. Processing stoped at this point therapy felds may be present as well File is Inwalid: Field s is Eroty. Processing stoped at this point. Other compty fields may be present as well Dette Ety Field Probe detected with Input les Lates.bib Filets Irelie: Fred journalisty. Processing this point other empty fulds may be present well A total of 3 files were invalid, and could not be processed. All other lid" file has been created Ce not open sout file. File does not exist possibly it could not be created the same of one of the files that you need to rev : Could not open input file again! Either le does not editar could not be created Sermet t e display desired last will crit! Figure 5. Example of Double-Fault for Displaying an Output File cowor o royector Bibliography Bloggtory level a Program AD Diagra Welcome to Bi L t ory Error Detected fry Field Probe detected with Input 1 Latex.bdb File is welie: Field oth is oly. Processing this point other ty es may be present as well Errer: Detected agty Field Probe detected with Input le Labib Files Invalid: Teld en Empty. Processing stoped at this point. Other empty fields may be present as well F3 is Invalie: Fuld journal" septy, Processing sedut this point other ty ses may be prental A total of 21s were invuld, and could not be proced. All other "Wild Tiles have been created Please enter the same of one of the files that you need to www . Could not open input file. File does not exist sibly it could not be created! However, you will be allowed another chance to enter another filenom e of one of the files that you need to re s 3. Park et al. 2018. Otal Hutcasting over LTE. TEEE Transactions on Vehicle Techlecy. PP. (2008), 15-7. DOIttps:// eng/10.1109/TV2018.789899 [2] T. Jackson et al. 2007. Detecting Security Wilnerabilities in Binary Code. TEEE Transion of Computer Science. 00.5 (2017), 1-12. Dotos// g/14.20/10 2017, 4706689 (3] S. Si et al. 2016. Salting Power Systems for the Detection of Rote Attacks. DEEE Transactions on Power System. FF. 2 (2016). 132-145. DOIts//doi.org/15.12 .2006.4399 (4) T K om et al. 20. Besedility itim Mobile works and lication , 2018), 64-12. DOI ://doi.org/23. / 2006.2003 Boedel Hope you have enjoyed creating the needed files using Bibilography Factory Figure 6. Example of Displaying the Contents of a Successfully Created Output File <br/>
20MATICLE author parland. N a d Q. Land Y. and. He journalIEEE Transactions on Vehicular Technology). title-Optimal MSH-Multicasting over LTE). L (15-27). ordForward error correction; Long Term Evolutionisten do 10.1109/TVT. 2019.2729899), ISSA0018-9545). . NATICLE authorit. Jackson and A. H. Peterson and N. Wang, journal-IEEE Transactions on computer Science, year (2017) pages(12) titleDetecting Security vulnerabilities in Rimary Code). keywords-[Security attacks;Binary code processing security error detection; Deep machine learning Static analysis). dol-114.2406/T05.2017.41462) 1551-0018-9545) month(May). authors. Simon and K. Toman, journalTEEE Transactions on Power Systems). title-Simlating Power Systems for the detection of Remote Attacks) year (2010) volume) Figure 7. Example of a Sample Bib Input File - Partial Image Serge Nord He to for View Hep D. Park, ). N ames, Q. LI, Y. Xu, W. , "Optimal - Multicastleg over LTE", IEEE Transactions on vehicular Technology, vol. PP, no. 99, p. 15-27, January 2018 T. Jackson, A. H. Peterson, N. ing. "Detecting Security Vulnerabilities in Dinary Code, IEEE Transactions on Computer Science, vol. 9, no. 5, P. 1-12, May 2017. 5. Simon, K. Tomson. Simulating Power Systems for the detection of Remote Attacks", IEEE Transactions on Power Systems, vol. FF, No. 2, p. 132-145, November 2016 T. E. Roman, C. Henry or., L. Fevens. IP-Based Mobility Optimisation Mobile Networks and Application, vol. A, no. 4, p. -12, February 20L Figure 8. The Created IEEE File for the above Sample Bib File ACMSample - Noped Pe tot movie HD 11] . Park et al. 2018. Optimal DASH-Pulticasting over LTE, IEEE Transactions on vehicular Technology. PP, 99 (2018), 15-27. https://doi.org/10.1109/TVI.2018.2788899 (2) T. Jackson et al. 2017. Detecting Security vulnerabilities in Binary Code. IEEE Transaction on computer Science. W. (2017), 1-12. Dohttps://doi.org/14.20/TCS.2017.74S. [3] S. Simon et al. 2016. Similate Power Systems for the Detection of Remote Attacks. IEEE Transactions on Power Systems, FF, 92 (2016), 132-145. DOI:https/doi.org/15. 128/TP.2016 (a) T. E. Roman et al. 2011. IP-Based Mobility Optimization Mobile Wetworks and Applications. An, (2010), 6-12. DOI: https://doi.org/23.54198/PS.2016. 1700005 Figure 9. The Created ACM File for the above Sample Bib File <br/>
211. PR . N. &0. L&Y & Hangoptimal Hulticasting over LTE. TEEE Transactions on whicular Technology. PP, 15-27(2016). 1. Jackson & A. H. Peterson, w t ecting security willilities in Binary code. The transactions on computer Science. 00.1-122017) 5. Simon Town Simulation Power Systems for the Detection of te Attacks. BE Tractions on Power Systems , 12-1452016) T. & C. Henry Ir. & L. Fevens. IP Based Mobility optimization. Mobile networks and Applications, MA, 64-822018) Figure 10. The Created Natural Journal File for the above Sample Bib File </span>
22</div>
23
24<h1> Answer: </h1>
25<div class="answer-given-body ugc-base">
26<p>Yes JSON files are used to store unstructured data as Key-value
27pairs and their sequence doesn't matter while reading or parsing
28them in your program files, just remember the key and use it to
29extract the value.</p>
30</div>
31
32<style>
33body {
34padding: 0;
35}
36
37h1 {
38background-color: skyblue;
39border: 1px solid black;
40padding: 5px;
41}
42
43img {
44margin: 10px;
45}
46
47</style>
48</body>
49</html>