KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > help > internal > index > IndexFile


1 /*******************************************************************************
2  * Copyright (c) 2005, 2006 Intel Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * Intel Corporation - initial API and implementation
10  * IBM Corporation - 122967 [Help] Remote help system
11  *******************************************************************************/

12 package org.eclipse.help.internal.index;
13
14 import java.io.FileInputStream JavaDoc;
15 import java.io.IOException JavaDoc;
16 import java.io.InputStream JavaDoc;
17
18 import org.eclipse.help.internal.util.ResourceLocator;
19
20 public class IndexFile {
21
22     private String JavaDoc pluginId;
23     private String JavaDoc file;
24     private String JavaDoc locale;
25
26     public IndexFile(String JavaDoc pluginId, String JavaDoc file, String JavaDoc locale) {
27         this.pluginId = pluginId;
28         this.file = file;
29         this.locale = locale;
30     }
31
32     public String JavaDoc getFile() {
33         return file;
34     }
35
36     public String JavaDoc getLocale() {
37         return locale;
38     }
39
40     public String JavaDoc getPluginId() {
41         return pluginId;
42     }
43
44     public InputStream JavaDoc getInputStream() throws IOException JavaDoc {
45         if (pluginId != null)
46             return ResourceLocator.openFromPlugin(pluginId, file, locale);
47         else
48             return new FileInputStream JavaDoc(file);
49     }
50 }
51
Popular Tags