KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > pluto > portalImpl > core > ResourceURLProviderImpl


1 /*
2  * Copyright 2003-2005 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16
17 package org.apache.pluto.portalImpl.core;
18
19 import org.apache.pluto.om.window.PortletWindow;
20 import org.apache.pluto.services.information.ResourceURLProvider;
21
22 public class ResourceURLProviderImpl implements ResourceURLProvider
23 {
24
25     private String JavaDoc stringUrl = "";
26     private String JavaDoc base = "";
27
28     public ResourceURLProviderImpl(DynamicInformationProviderImpl provider,
29                                    PortletWindow portletWindow)
30     {
31 // this.base = PortalURL.getBaseURLexcludeContext();
32
}
33
34     // ResourceURLProvider implementation.
35

36     public void setAbsoluteURL(String JavaDoc path)
37     {
38         stringUrl = path;
39     }
40     
41     public void setFullPath(String JavaDoc path)
42     {
43         stringUrl = base + path;
44     }
45     
46     public String JavaDoc toString()
47     {
48 /*
49         URL url = null;
50
51         if (!"".equals(stringUrl))
52         {
53             try
54             {
55                 url = new URL(stringUrl);
56             }
57             catch (MalformedURLException e)
58             {
59                 throw new java.lang.IllegalArgumentException("A malformed URL has occured");
60             }
61         }
62
63         return ((url==null)?"":url.toString());
64 */

65         return stringUrl;
66     }
67
68 }
69
Popular Tags