srcanaapps/apiquerytool/com.nokia.s60tools.apiquery.cache/src/com/nokia/s60tools/apiquery/cache/util/SDKFinder.java
changeset 0 a02c979e8dfd
equal deleted inserted replaced
-1:000000000000 0:a02c979e8dfd
       
     1 /*
       
     2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 *
       
    16 */
       
    17  
       
    18 package com.nokia.s60tools.apiquery.cache.util;
       
    19 
       
    20 import org.osgi.framework.Version;
       
    21 
       
    22 import com.nokia.carbide.cpp.sdk.core.ISDKManager;
       
    23 import com.nokia.carbide.cpp.sdk.core.SDKCorePlugin;
       
    24 import com.nokia.s60tools.apiquery.shared.util.console.APIQueryConsole;
       
    25 import com.nokia.s60tools.sdk.SdkEnvInfomationResolveFailureException;
       
    26 import com.nokia.s60tools.sdk.SdkInformation;
       
    27 import com.nokia.s60tools.sdk.SdkManager;
       
    28 import com.nokia.s60tools.util.console.IConsolePrintUtility;
       
    29 
       
    30 
       
    31 /**
       
    32  * Helper Class for finding SDK information.
       
    33  */
       
    34 public class SDKFinder {
       
    35 
       
    36 	/**
       
    37 	 * Get SDK information by SDK ID
       
    38 	 * @param sdkID
       
    39 	 * @return information about SDK
       
    40 	 */
       
    41 	public static SdkInformation getSDKInformation(String sdkID){
       
    42 		try{
       
    43 			
       
    44 		SdkInformation[] sdkInfoColl = SdkManager.getSdkInformation();
       
    45 			
       
    46 			for (int i = 0; i < sdkInfoColl.length; i++) {
       
    47 				SdkInformation info = sdkInfoColl[i];
       
    48 			
       
    49 	
       
    50 	
       
    51 				if(info.getSdkId().equalsIgnoreCase(sdkID)){
       
    52 					return info;
       
    53 				}
       
    54 			}
       
    55 			return null;//Should not be able to occur
       
    56 		} catch (SdkEnvInfomationResolveFailureException e) {
       
    57 			e.printStackTrace();
       
    58 			APIQueryConsole.getInstance().println(e.getMessage(), 
       
    59 										IConsolePrintUtility.MSG_ERROR);
       
    60 			return null;
       
    61 		}		
       
    62 	}	
       
    63 	
       
    64 }