Skip to main content
summaryrefslogtreecommitdiffstats
blob: d68e28cbee3473997be1cc811ca6d5bf3bb0e1b9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package org.eclipse.help.internal.server;

/*
 * Licensed Materials - Property of IBM,
 * WebSphere Studio Workbench
 * (c) Copyright IBM Corp 2000
 */

import java.net.*;

/**
 * Creates the URL objects according to the their type
 */
public class HelpURLFactory {
	/**
	 * HelpURLFactory constructor.
	 */
	public HelpURLFactory() {
		super();
	}
	public static HelpURL createHelpURL(String url) {
		if (url == null || url.length() == 0)
			return new PluginURL("", "");

		// Strip off the leading "/" and the query
		String query = "";
		int indx = url.indexOf("?");
		if (indx != -1) {
			query = url.substring(indx + 1);
			url = url.substring(1, indx);
		} else
			url = url.substring(1);

		if (url.startsWith(TempURL.getPrefix())) // "/working"
			return new TempURL(url.substring(TempURL.getPrefix().length() + 1), query);

		else
			if (url.startsWith(SearchURL.getPrefix()))
				return new SearchURL(
				//request.substring(URLResolver.getSearchContext().length() + 1),
				"", query);

			else ////if (url.startsWith(PluginURL.getPrefix())) 
				return new PluginURL(url.substring(PluginURL.getPrefix().length()), query);

	}
}

Back to the top