|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ModuleAddress | Line # 31 | 0 | 0 | - |
-1.0
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
No Tests | |||
1 | /* $Id: ModuleAddress.java,v 1.2 2008/07/26 07:59:40 m31 Exp $ | |
2 | * | |
3 | * This file is part of the project "Hilbert II" - http://www.qedeq.org | |
4 | * | |
5 | * Copyright 2000-2008, Michael Meyling <mime@qedeq.org>. | |
6 | * | |
7 | * "Hilbert II" is free software; you can redistribute | |
8 | * it and/or modify it under the terms of the GNU General Public | |
9 | * License as published by the Free Software Foundation; either | |
10 | * version 2 of the License, or (at your option) any later version. | |
11 | * | |
12 | * This program is distributed in the hope that it will be useful, | |
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 | * GNU General Public License for more details. | |
16 | */ | |
17 | ||
18 | package org.qedeq.kernel.common; | |
19 | ||
20 | import java.io.IOException; | |
21 | import java.net.URL; | |
22 | ||
23 | import org.qedeq.kernel.base.module.Specification; | |
24 | ||
25 | /** | |
26 | * An address for a QEDEQ module. | |
27 | * | |
28 | * @version $Revision: 1.2 $ | |
29 | * @author Michael Meyling | |
30 | */ | |
31 | public interface ModuleAddress { | |
32 | ||
33 | /** | |
34 | * Get module address as {@link ModuleContext}. Creates a new object. | |
35 | * | |
36 | * @return Module address as {@link ModuleContext}. | |
37 | */ | |
38 | public ModuleContext createModuleContext(); | |
39 | ||
40 | /** | |
41 | * Get address header (including protocol, host, port, user) | |
42 | * but without file path. | |
43 | * | |
44 | * @return address header | |
45 | */ | |
46 | public String getHeader(); | |
47 | ||
48 | /** | |
49 | * Get address path (without protocol, host, port and file name). | |
50 | * | |
51 | * @return module path | |
52 | */ | |
53 | public String getPath(); | |
54 | ||
55 | /** | |
56 | * Get module file name. | |
57 | * | |
58 | * @return Module file name. | |
59 | */ | |
60 | public String getFileName(); | |
61 | ||
62 | /** | |
63 | * Get name of module (file name without <code>.xml</code>). | |
64 | * | |
65 | * @return Module name. | |
66 | */ | |
67 | public String getName(); | |
68 | ||
69 | /** | |
70 | * Get fully qualified URL of module. | |
71 | * | |
72 | * @return URL for QEDEQ module. | |
73 | */ | |
74 | public URL getURL(); | |
75 | ||
76 | /** | |
77 | * Was this module address created relatively? | |
78 | * | |
79 | * @return Relatively created? | |
80 | */ | |
81 | public boolean isRelativeAddress(); | |
82 | ||
83 | /** | |
84 | * Is this a local QEDEQ file. That means the address starts with <code>file:</code>. | |
85 | * | |
86 | * @return Is the QEDEQ module a local file? | |
87 | */ | |
88 | public boolean isFileAddress(); | |
89 | ||
90 | ||
91 | /** | |
92 | * Get all potential module addresses from a module specification. | |
93 | * | |
94 | * TODO mime 20070326: add context information (for error case) | |
95 | * | |
96 | * @param spec Here are the (perhaps relative) addresses to | |
97 | * another module. | |
98 | * @return Array of absolute address strings. | |
99 | * @throws IOException One address is not correctly formed. | |
100 | */ | |
101 | public ModuleAddress[] getModulePaths(final Specification spec) throws IOException; | |
102 | ||
103 | } |
|