Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package randomclassnamegenerator;
- import java.io.File;
- import java.util.ArrayList;
- import java.util.Arrays;
- import java.util.List;
- import java.util.Scanner;
- /**
- *
- * @author yamitatsu
- */
- public class RandomClassNameGenerator {
- static List<String> fileA = new ArrayList<String>();
- /**
- * @param args the command line arguments
- * @throws java.lang.Throwable
- */
- public static void main(String[] args) throws Throwable {
- // TODO code application logic here
- fileA = loadData("/home/yamitatsu/Téléchargements/Wget/fileA.txt");
- System.out.println(fileA);
- }
- private static List loadData(String fileName) throws Throwable {
- List<String> fileContent = new ArrayList<String>();
- File file = new File(fileName);
- Scanner scanner = new Scanner(file).useDelimiter("\\Z");
- String contents = scanner.next();
- fileContent = Arrays.asList(contents.split(" "));
- return fileContent;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement