Java BufferedReader Read loadTemplateParametersFile(File f)

Here you can find the source of loadTemplateParametersFile(File f)

Description

load Template Parameters File

License

Open Source License

Declaration

@SuppressWarnings("resource")
    public static Map<String, String> loadTemplateParametersFile(File f) 

Method Source Code


//package com.java2s;
/*//from   ww w  . j av  a 2s. c o  m
   This file is part of RUbioSeq-GUI.
    
   RUbioSeq-GUI is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation, either version 3 of the License, or
   (at your option) any later version.
    
   RUbioSeq-GUI is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.
    
   You should have received a copy of the GNU General Public License
   along with RUbioSeq-GUI.  If not, see <http://www.gnu.org/licenses/>.
*/

import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.util.HashMap;
import java.util.Map;

public class Main {
    @SuppressWarnings("resource")
    public static Map<String, String> loadTemplateParametersFile(File f) {
        Map<String, String> toret = new HashMap<String, String>();
        BufferedReader br;
        try {
            br = new BufferedReader(new FileReader(f));
        } catch (FileNotFoundException e1) {
            return toret;
        }
        if (!f.exists()) {
            return toret;
        }
        try {
            String line;
            while ((line = br.readLine()) != null) {
                String[] parts = line.split("   ");
                if (parts.length == 4) {
                    String parameterName = parts[0];
                    String parameterValue = parts[3];
                    toret.put(parameterName, parameterValue);
                }
            }
        } catch (Exception e) {

        }
        return toret;
    }
}

Related

  1. loadStreamContent(InputStream stream)
  2. loadSystemClassPath()
  3. loadTableList(List list, String fileName)
  4. loadTemplate(final String resource)
  5. loadTemplate(String templateUrl)
  6. loadTestFixture(String path)
  7. loadTestUserEventRelation(String eventFilePath, HashMap> TestUser2EventIndexSetMap)
  8. loadToStringListFromFile(String fullFileName)
  9. loadTrustDistrustSets(String trust_data_set)