Commit 3c93c62b authored by trh010's avatar trh010
Browse files

Trying to figure out input file path

parent 866d4940
package main;
import java.util.ArrayList;
public class AdjacencyList {
private ArrayList<ArrayList<String>> adjList;
public AdjacencyList(){
adjList = new ArrayList<ArrayList<String>>();
}
}
......@@ -6,17 +6,27 @@ import java.util.Scanner;
public class Main {
public static void main(String[] args){
AdjacencyList adjList;
public Main(){
adjList = new AdjacencyList();
}
//reads args[0] for input file path
File file = new File(args[0]);
public void createGraph(String path){
File file = new File(path);
try {
Scanner in = new Scanner(file);
System.out.println(in.next());
in.close();
} catch (FileNotFoundException e) {
System.err.println("Error in opening the file: " + args[0] + ". Please check the file path.");
System.err.println("Error in opening the file: " + path + ". Please check the file path.");
}
}
public static void main(String[] args){
Main main = new Main();
main.createGraph(args[0]);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment