-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWirelessNetworksReader.java
More file actions
50 lines (45 loc) · 1.38 KB
/
WirelessNetworksReader.java
File metadata and controls
50 lines (45 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import java.io.FileNotFoundException;
/** WirelessNetworksPart3.
* @author Adam Bostwick
* @version 11.18.19
*/
public class WirelessNetworksReader
{
/** main.
* @param args input for file name
* throws InvalidCategoryException true
*/
public static void main(String[] args)
//throws InvalidCategoryException
{
//Scanner userInput = new Scanner(System.in);
if (args.length == 0)
{
System.out.print("File name expected as command line argument."
+ "\nProgram ending.\n");
}
else
{
String filename = args[0];
try
{
WirelessNetworkList myList = new WirelessNetworkList();
myList.readFile(filename);
String output = myList.generateReport()
+ myList.generateReportByName()
+ myList.generateReportByBandwidth()
+ myList.generateReportByMonthlyCost()
+ myList.generateInvalidRecordsReport();
System.out.print(output);
}
catch (FileNotFoundException fnfe)
{
String errorMsg = fnfe + "";
errorMsg = errorMsg.replace("java.io.FileNotFoundException",
"*** Attempted to read file");
System.out.print(errorMsg);
return; //System.exit(0);
}
}
}
}