aboutsummaryrefslogtreecommitdiff
path: root/testapps/javaProjectTest/lib2/src/com/android/tests/javaprojecttest/lib2/Lib2.java
blob: 5831cb2d14d525573ea50e9bf7d28ada85b6fc07 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package com.android.tests.javaprojecttest.lib2;

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

public class Lib2 {

    public static String getContent() {
        InputStream input = Lib2.class.getResourceAsStream("Lib2.txt");
        if (input == null) {
            return "FAILED TO FIND Lib2.txt";
        }

        BufferedReader reader = null;
        try {
            reader = new BufferedReader(new InputStreamReader(input, "UTF-8"));

            return reader.readLine();
        } catch (IOException e) {
        } finally {
            if (reader != null) {
                try {
                    reader.close();
                } catch (IOException e) {
                }
            }
        }
        
        return "FAILED TO READ CONTENT";
    }
}