Class | Line # | Actions | |||||
---|---|---|---|---|---|---|---|
URLNormalizer | 40 | 0 | - | 0 | 0 |
1 | /* | |
2 | * See the NOTICE file distributed with this work for additional | |
3 | * information regarding copyright ownership. | |
4 | * | |
5 | * This is free software; you can redistribute it and/or modify it | |
6 | * under the terms of the GNU Lesser General Public License as | |
7 | * published by the Free Software Foundation; either version 2.1 of | |
8 | * the License, or (at your option) any later version. | |
9 | * | |
10 | * This software 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 GNU | |
13 | * Lesser General Public License for more details. | |
14 | * | |
15 | * You should have received a copy of the GNU Lesser General Public | |
16 | * License along with this software; if not, write to the Free | |
17 | * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | |
18 | * 02110-1301 USA, or see the FSF site: http://www.fsf.org. | |
19 | */ | |
20 | package org.xwiki.url; | |
21 | ||
22 | import org.xwiki.component.annotation.Role; | |
23 | ||
24 | /** | |
25 | * Normalize a relative URL. Various implementations can exist, for example one implementation may normalize the passed | |
26 | * relative URL into a full absolute {@link java.net.URL} object. Another implementation may simply prefix the passed | |
27 | * relative URL with a Servlet Container's webapp name (aka application context name). Note that in general the | |
28 | * implementations will depends on the Container in which XWiki is executing (eg Servlet Container). | |
29 | * <p> | |
30 | * It's also important that Normalizers should be independent of URL Scheme formats since they should be usable | |
31 | * for all URL Schemes. Note that Normalizers should not replace {@link org.xwiki.resource.ResourceReferenceSerializer} | |
32 | * implementations. | |
33 | * </p> | |
34 | * | |
35 | * @param <T> the type of object to return (eg {@link ExtendedURL}, {@link java.net.URL}) | |
36 | * @version $Id: 0f660ffe97a994533d2090b556d18672ad6cf2a2 $ | |
37 | * @since 6.1M2 | |
38 | */ | |
39 | @Role | |
40 | public interface URLNormalizer<T> | |
41 | { | |
42 | /** | |
43 | * @param partialURL the partial URL to normalize | |
44 | * @return the normalized URL, what is done depends on the implementation | |
45 | */ | |
46 | T normalize(ExtendedURL partialURL); | |
47 | } |