Java BufferedReader Read loadMetaFile(File metaFile)

Here you can find the source of loadMetaFile(File metaFile)

Description

load Meta File

License

Open Source License

Declaration

private static List<String> loadMetaFile(File metaFile) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2005-2011 eBay Inc./*from www. ja va 2s  .  co m*/
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 *******************************************************************************/

import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;

import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;

import java.util.List;

public class Main {
    private static List<String> loadMetaFile(File metaFile) {
        List<String> list = new ArrayList<String>();
        FileReader fr;
        try {
            fr = new FileReader(metaFile);
            BufferedReader reader = new BufferedReader(fr);
            String s = reader.readLine();
            while (s != null) {
                list.add(s);
                s = reader.readLine();
            }
            return list;
        } catch (FileNotFoundException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return new ArrayList<String>();

    }
}

Related

  1. loadList(final File file)
  2. loadList(String listName)
  3. loadListFromTextFile(String filename, String defaultitem, String linePrefix, String lineSuffix)
  4. loadLongArray(BufferedReader in)
  5. loadMetadata(File file)
  6. loadMimeTypes(Reader in, Map extMap, Map mimeMap)
  7. loadModel(String fileName, Hashtable dictionary, Hashtable> modelPairs)
  8. loadNameMap(String mapName, boolean reverseMap)
  9. loadNumUsers(String fileName)