KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > bluecubs > xinco > index > filetypes > XincoIndexText


1 /**
2 *Copyright 2005 blueCubs.com
3 *
4 *Licensed under the Apache License, Version 2.0 (the "License");
5 *you may not use this file except in compliance with the License.
6 *You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 *Unless required by applicable law or agreed to in writing, software
11 *distributed under the License is distributed on an "AS IS" BASIS,
12 *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 *See the License for the specific language governing permissions and
14 *limitations under the License.
15 *
16 *************************************************************
17 * This project supports the blueCubs vision of giving back
18 * to the community in exchange for free software!
19 * More information on: http://www.bluecubs.org
20 *************************************************************
21 *
22 * Name: XincoIndexText
23 *
24 * Description: indexing text files
25 *
26 * Original Author: Alexander Manes
27 * Date: 2005/02/05
28 *
29 * Modifications:
30 *
31 * Who? When? What?
32 * - - -
33 *
34 *************************************************************
35 */

36
37 package com.bluecubs.xinco.index.filetypes;
38
39 import java.io.BufferedReader JavaDoc;
40 import java.io.File JavaDoc;
41 import java.io.FileInputStream JavaDoc;
42 import java.io.InputStreamReader JavaDoc;
43 import java.io.Reader JavaDoc;
44
45 public class XincoIndexText implements XincoIndexFileType {
46
47     public XincoIndexText() {
48         super();
49     }
50
51     public Reader JavaDoc getFileContentReader(File JavaDoc f) {
52         Reader JavaDoc reader = null;
53         FileInputStream JavaDoc is =null;
54         try {
55             is = new FileInputStream JavaDoc(f);
56             reader = new BufferedReader JavaDoc(new InputStreamReader JavaDoc(is));
57             //reader.close();
58
//is.close();
59
} catch (Exception JavaDoc fe) {
60             if (reader != null) {
61                 try {
62                     reader.close();
63                 } catch (Exception JavaDoc re) {}
64             }
65             if (is != null) {
66                 try {
67                     is.close();
68                 } catch (Exception JavaDoc ise) {}
69             }
70             reader = null;
71         }
72         return reader;
73     }
74
75     public String JavaDoc getFileContentString(File JavaDoc f) {
76         return null;
77     }
78
79 }
80
Popular Tags