OnlineShop/shop/fassade/OnlineShopSystem.java

32 lines
671 B
Java

package fassade;
import domain.Product;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.Scanner;
public class OnlineShopSystem {
private ArrayList<Product> storage;
public OnlineShopSystem(String filePath) throws FileNotFoundException {
storage = new ArrayList<Product>();
loadProducts(filePath);
}
private void loadProducts(String filePath) throws FileNotFoundException {
Scanner sc = new Scanner(new File(filePath));
int counter = 0;
while (sc.hasNextLine()) {
String product = sc.nextLine();
counter ++;
}
}
}