01: /*
02: * snapper
03: *
04: * Enhydra super-servlet business object
05: *
06: */
07:
08: package org.enhydra.snapperAdmin.business;
09:
10: // Enhydra SuperServlet specification imports
11:
12: import java.io.BufferedReader;
13: import java.io.File;
14: import java.io.FileInputStream;
15: import java.io.InputStreamReader;
16: import java.util.Vector;
17:
18: import org.enhydra.snapperAdmin.SnapperAdmin;
19: import org.enhydra.snapperAdmin.spec.*;
20:
21: // Standard imports
22: //import java.text.DateFormat;
23:
24: public class NotIndexedImpl implements NotIndexed {
25: public NotIndexed[] getListForID(String siteNAme, String str) {
26:
27: NotIndexed[] niArray = null;
28:
29: BufferedReader d = null;
30:
31: try {
32: Vector result = new Vector();
33:
34: String inputFileS = SnapperAdmin.getLogDirectory();
35: inputFileS = inputFileS + str;
36: File inputFile = new File(inputFileS);
37:
38: if (!inputFile.exists())
39: return null;
40:
41: FileInputStream fis = new FileInputStream(inputFile);
42: d = new BufferedReader(new InputStreamReader(fis));
43:
44: String curentObject = null;
45:
46: while ((curentObject = d.readLine()) != null) {
47: NotIndexed current = new NotIndexedImpl();
48: current.setPath(curentObject);
49: result.add(current);
50: }
51:
52: niArray = new NotIndexedImpl[result.size()];
53:
54: for (int k = 0; k < result.size(); k++) {
55:
56: niArray[k] = (NotIndexed) result.elementAt(k);
57:
58: }
59:
60: return niArray;
61:
62: } catch (Exception e) {
63: SnapperAdmin
64: .logError("Problem ocured while trying to read log not indexed file "
65: + e.getMessage());
66: return null;
67: } finally {
68: if (d != null) {
69: try {
70: d.close();
71: } catch (Exception e) {
72: }
73: d = null;
74: }
75: }
76:
77: }
78:
79: String path = "";
80:
81: public String getPath() {
82: return path;
83: }
84:
85: public void setPath(String str) {
86: path = str;
87: }
88:
89: }
|