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