package com.ms.biz.test;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;

public class ReadResourceFileTest {

    public static void main(String[] args) {
        String resourceFileName = "/application.properties"; // 注意路径的开头是一个斜杠

        try (InputStream is = InputStream.class.getResourceAsStream(resourceFileName);
             BufferedReader reader = new BufferedReader(new InputStreamReader(is))) {
            String line;
            while ((line = reader.readLine()) != null) {
                System.out.println(line);
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
