Here you can find the source of loadHeader(String fileName)
Parameter | Description |
---|---|
fileName | a parameter |
Parameter | Description |
---|---|
IOException | an exception |
public static String loadHeader(String fileName) throws IOException
//package com.java2s; //License from project: Apache License import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; public class Main { /**/*from w ww. j ava 2s . com*/ * Read the header part of a properties file into a String. * @param fileName * @return * @throws IOException * */ public static String loadHeader(String fileName) throws IOException { FileReader fr = null; BufferedReader br = null; try { fr = new FileReader(fileName); br = new BufferedReader(fr); String header = br.readLine(); if (header != null && header.indexOf('#') == 0) { header = header.substring(1); } return header; } finally { if (br != null) { br.close(); } if (fr != null) { fr.close(); } } } }