01: package ca.ulaval.bibl.lius.index.OpenOffice;
02:
03: /*
04:
05: * LIUS - Lucene Index Update and Search
06: * http://sourceforge.net/projects/lius/
07: *
08: * Copyright (c) 2005, Laval University Library. All rights reserved.
09: *
10: * This library is free software; you can redistribute it and/or
11: * modify it under the terms of the GNU Lesser General Public
12: * License as published by the Free Software Foundation; either
13: * version 2.1 of the License, or (at your option) any later version.
14: *
15: * This library is distributed in the hope that it will be useful,
16: * but WITHOUT ANY WARRANTY; without even the implied warranty of
17: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18: * Lesser General Public License for more details.
19: *
20: * You should have received a copy of the GNU Lesser General Public
21: * License along with this library; if not, write to the Free Software
22: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23: */
24:
25: import java.io.StringReader;
26:
27: import org.xml.sax.EntityResolver;
28: import org.xml.sax.InputSource;
29:
30: /**
31: *
32: * @author Rida Benjelloun (rida.benjelloun@bibl.ulaval.ca)
33: *
34: */
35:
36: public class OpenOfficeEntityResolver
37:
38: implements EntityResolver {
39:
40: public InputSource resolveEntity(String publicId, String systemId)
41:
42: {
43:
44: if (systemId.endsWith(".dtd"))
45:
46: {
47:
48: StringReader stringInput =
49:
50: new StringReader(" ");
51:
52: return new InputSource(stringInput);
53:
54: }
55:
56: else
57:
58: {
59:
60: return null;
61:
62: }
63:
64: }
65:
66: }
|