Replaced DictionaryProp.java with a standard Hashtable.
UPnPDevice description  is now built with proper capitalized keys.
That has some consequence for client of imported UPnP devices that 
before now could look for lower case keys.


git-svn-id: https://svn.apache.org/repos/asf/incubator/felix/trunk@471326 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/upnp.basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/MyCtrlPoint.java b/upnp.basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/MyCtrlPoint.java
index 3d6c175..1e93656 100644
--- a/upnp.basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/MyCtrlPoint.java
+++ b/upnp.basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/MyCtrlPoint.java
@@ -64,7 +64,6 @@
 import org.apache.felix.upnp.basedriver.importer.core.event.structs.SubscriptionQueue;

 import org.apache.felix.upnp.basedriver.importer.core.upnp.UPnPDeviceImpl;

 import org.apache.felix.upnp.basedriver.importer.core.upnp.UPnPServiceImpl;

-import org.apache.felix.upnp.basedriver.importer.util.DictionaryProp;

 import org.apache.felix.upnp.basedriver.importer.util.ParseUSN;

 import org.apache.felix.upnp.extra.util.Converter;

 

@@ -468,7 +467,7 @@
 										   * 

 										   * only if there is a compatibile device

 										   */

-					Dictionary dic = new DictionaryProp();

+					Dictionary dic = new Hashtable();

 					for (int i = 0; i < devicesRefs.length; i++) {

 						UPnPDevice device = (UPnPDevice) context.getService(devicesRefs[i]);

 						dic.put(UPnPDevice.ID, device.getDescriptions(null).get(UPnPDevice.UDN));

@@ -560,7 +559,7 @@
 										   * 

 										   * only if there is a compatibile device

 										   */

-					Dictionary dic = new DictionaryProp();

+					Dictionary dic = new Hashtable();

 					/* 

 					 * look for the service that match

 					 */

@@ -577,9 +576,7 @@
 						if (services != null) {

 							for (int j = 0; j < services.length; j++) {

 								dic.put(UPnPService.ID, services[j].getId());

-								dic

-										.put(UPnPService.TYPE, services[j]

-												.getType());

+								dic.put(UPnPService.TYPE, services[j].getType());

 

 								UPnPStateVariable[] stateVars = services[j]

 										.getStateVariables();

diff --git a/upnp.basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/upnp/UPnPDeviceImpl.java b/upnp.basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/upnp/UPnPDeviceImpl.java
index ef5c099..d081483 100644
--- a/upnp.basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/upnp/UPnPDeviceImpl.java
+++ b/upnp.basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/core/upnp/UPnPDeviceImpl.java
@@ -25,16 +25,13 @@
 import java.util.Hashtable;

 import java.util.Vector;

 

+import org.apache.felix.upnp.basedriver.importer.util.DeviceSetup;

 import org.cybergarage.upnp.Device;

-

 import org.osgi.framework.BundleContext;

 import org.osgi.service.upnp.UPnPDevice;

 import org.osgi.service.upnp.UPnPIcon;

 import org.osgi.service.upnp.UPnPService;

 

-import org.apache.felix.upnp.basedriver.importer.util.DeviceSetup;

-import org.apache.felix.upnp.basedriver.importer.util.DictionaryProp;

-

 /* 

 * @author <a href="mailto:felix-dev@incubator.apache.org">Felix Project Team</a>

 */

@@ -43,7 +40,7 @@
 	/**

 	 * <code>properties</code> Dictionary that contains Device properties

 	 */

-	private DictionaryProp properties;

+	private Dictionary properties;

 	private Vector icons;

 	private Hashtable services;

 	/**

@@ -52,7 +49,7 @@
 	 *            Device

 	 */

 	public UPnPDeviceImpl(Device dev, BundleContext context) {

-		properties = new DictionaryProp();

+		properties = new Hashtable();

 		this.services=new Hashtable();

 		this.icons=new Vector();

 		DeviceSetup.deviceSetup(properties,dev,icons,services);

diff --git a/upnp.basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/util/DeviceSetup.java b/upnp.basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/util/DeviceSetup.java
index 32d612f..cc248fc 100644
--- a/upnp.basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/util/DeviceSetup.java
+++ b/upnp.basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/util/DeviceSetup.java
@@ -20,6 +20,7 @@
 package org.apache.felix.upnp.basedriver.importer.util;

 

 

+import java.util.Dictionary;

 import java.util.HashSet;

 import java.util.Hashtable;

 import java.util.Iterator;

@@ -45,7 +46,7 @@
 

 public class DeviceSetup {

 

-	public static void deviceSetup(DictionaryProp properties, Device dev,Vector icons,Hashtable services) {

+	public static void deviceSetup(Dictionary properties, Device dev,Vector icons,Hashtable services) {

 		//TODO if I don't have any device, the size of devlist is 0 

 		DeviceList devList = dev.getDeviceList();

 		/* childrenUDN property */

diff --git a/upnp.basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/util/DictionaryProp.java b/upnp.basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/util/DictionaryProp.java
deleted file mode 100644
index e2fee7e..0000000
--- a/upnp.basedriver/src/main/java/org/apache/felix/upnp/basedriver/importer/util/DictionaryProp.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/* 

- * Licensed to the Apache Software Foundation (ASF) under one

- * or more contributor license agreements.  See the NOTICE file

- * distributed with this work for additional information

- * regarding copyright ownership.  The ASF licenses this file

- * to you under the Apache License, Version 2.0 (the

- * "License"); you may not use this file except in compliance

- * with the License.  You may obtain a copy of the License at

- *

- *   http://www.apache.org/licenses/LICENSE-2.0

- *

- * Unless required by applicable law or agreed to in writing,

- * software distributed under the License is distributed on an

- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

- * KIND, either express or implied.  See the License for the

- * specific language governing permissions and limitations

- * under the License.

- */

-

-package org.apache.felix.upnp.basedriver.importer.util;

-

-import java.util.*;

-

-/* 

-* @author <a href="mailto:felix-dev@incubator.apache.org">Felix Project Team</a>

-*/

-public class DictionaryProp extends Dictionary {

-	private Hashtable hash=null;

-	/* (non-Javadoc)

-	 * @see java.util.Dictionary#size()

-	 */

-

-	public DictionaryProp(){

-		hash=new Hashtable();

-	}

-	

-	public int size() {

-		// TODO Auto-generated method stub

-		return hash.size();

-	}

-

-	/* (non-Javadoc)

-	 * @see java.util.Dictionary#isEmpty()

-	 */

-	public boolean isEmpty() {

-		// TODO Auto-generated method stub

-		return hash.isEmpty();

-	}

-

-	/* (non-Javadoc)

-	 * @see java.util.Dictionary#elements()

-	 */

-	public Enumeration elements() {

-		// TODO Auto-generated method stub

-		return hash.elements();

-	}

-

-	/* (non-Javadoc)

-	 * @see java.util.Dictionary#keys()

-	 */

-	public Enumeration keys() {

-		// TODO Auto-generated method stub

-		return hash.keys();

-	}

-

-	/* (non-Javadoc)

-	 * @see java.util.Dictionary#get(java.lang.Object)

-	 */

-	public Object get(Object key) {

-		// TODO Auto-generated method stub

-		String s=((String)key).toLowerCase();

-		return hash.get(s);

-	}

-

-	/* (non-Javadoc)

-	 * @see java.util.Dictionary#remove(java.lang.Object)

-	 */

-	public Object remove(Object arg0) {

-		// TODO Auto-generated method stub

-		String s=((String)arg0).toLowerCase();

-		return hash.remove(s);

-	}

-

-	/* (non-Javadoc)

-	 * @see java.util.Dictionary#put(java.lang.Object, java.lang.Object)

-	 */

-	public Object put(Object arg0, Object arg1) {

-		// TODO Auto-generated method stub

-		String s=((String)arg0).toLowerCase();

-		return hash.put(s,arg1);

-	}

-

-	/**

-	 * @param key

-	 * @return

-	 */

-	public boolean containsKey(Object key) {

-		//String s=((String)key).toLowerCase();

-		return hash.containsKey(key);

-	}

-

-	public String toString() {

-		StringBuffer sb = new StringBuffer("");

-		Enumeration e = keys();

-		while (e.hasMoreElements()) {

-			String key = (String) e.nextElement();

-			sb.append(key).append(" = ");

-			if(get(key) instanceof String[]){

-				String[] aux = (String[]) get(key);

-				sb.append("[");

-				for (int i = 0; i < aux.length-1; i++) {

-					sb.append(aux[i]).append(",");

-				}

-				if(aux.length>0)

-					sb.append(aux[aux.length-1]);

-				sb.append("]");

-			}else{

-				sb.append(get(key).toString());

-			}

-			sb.append("\n");

-		}

-		return sb.toString();

-	}

-}