Home | History | Annotate | Download | only in basicjar3
      1 package com.android.tests.basicjar3;
      2 
      3 import java.io.BufferedReader;
      4 import java.io.IOException;
      5 import java.io.InputStream;
      6 import java.io.InputStreamReader;
      7 
      8 public class BasicJar3 {
      9 
     10     public static String getContent() {
     11         InputStream input = BasicJar3.class.getResourceAsStream("/com/android/tests/basicjar3/basicJar3.txt");
     12         if (input == null) {
     13             return "FAILED TO FIND basicJar3.txt";
     14         }
     15 
     16         BufferedReader reader = null;
     17         try {
     18             reader = new BufferedReader(new InputStreamReader(input, "UTF-8"));
     19 
     20             return reader.readLine();
     21         } catch (IOException e) {
     22         } finally {
     23             if (reader != null) {
     24                 try {
     25                     reader.close();
     26                 } catch (IOException e) {
     27                 }
     28             }
     29         }
     30 
     31         return "FAILED TO READ CONTENT";
     32     }
     33 }