// Path: plugins/org.wso2.developerstudio.eclipse.logging/src/org/wso2/developerstudio/eclipse/logging/core/IDeveloperStudioLog.java
// public interface IDeveloperStudioLog {
// 
// 	public void setPluginId(String pluginId);
// 
// 	public String getPluginId();
// 
// 	public void setClassObj(Class<Object> classObj);
// 
// 	public Class<Object> getClassObj();
// 
// 	public void info(String message);
// 
// 	public void info(String message, Exception e);
// 
// 	public void warn(String message);
// 
// 	public void warn(String message, Exception e);
// 
// 	public void error(String message);
// 
// 	public void error(Exception e);
// 	
// 	public void error(String message, Exception e);
// 
// 	public void error(Throwable e);
// 
// 	public void error(String message, Throwable e);
// 
// 	public void info(Throwable e);
// 
// 	public void info(String message, Throwable e);
// 
// 	public void warn(Throwable e);
// 
// 	public void warn(String message, Throwable e);
// 
// }
// 
// Path: plugins/org.wso2.developerstudio.eclipse.platform.core/src/org/wso2/developerstudio/eclipse/platform/core/Activator.java
// public class Activator extends AbstractUIPlugin {
// 
// 	public static final String PLUGIN_ID = "org.wso2.tools.eclipse.platform.core";
// 
// 	private static Activator plugin;
// 
// 	public Activator() {
// 	}
// 
// 	public void start(BundleContext context) throws Exception {
// 		super.start(context);
// 		plugin = this;
// 	}
// 
// 	public void stop(BundleContext context) throws Exception {
// 		plugin = null;
// 		super.stop(context);
// 	}
// 
// 	public static Activator getDefault() {
// 		return plugin;
// 	}
// 
// }
// 
// Path: plugins/org.wso2.developerstudio.eclipse.platform.core/src/org/wso2/developerstudio/eclipse/platform/core/interfaces/IMediaTypeResolver.java
// public abstract interface IMediaTypeResolver {
// 
// }


import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.Platform;
import org.wso2.developerstudio.eclipse.logging.core.IDeveloperStudioLog;
import org.wso2.developerstudio.eclipse.logging.core.Logger;
import org.wso2.developerstudio.eclipse.platform.core.Activator;
import org.wso2.developerstudio.eclipse.platform.core.interfaces.IMediaTypeResolver;
import org.wso2.developerstudio.eclipse.platform.core.interfaces.IMediaTypeResolverProvider;
import org.wso2.developerstudio.eclipse.platform.core.internal.impl.MediaTypeResolverProviderImpl;
/*
 * Copyright (c) 2010-2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
 * 
 * Licensed 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.wso2.developerstudio.eclipse.platform.core.utils;



public class CSMediaUtils {
	private static IDeveloperStudioLog log = Logger.getLog(Activator.PLUGIN_ID);

	private static String MEDIA_TYPE_EXTENSION = "org.wso2.developerstudio.eclipse.platform.core.mediatype";
	private static List<IMediaTypeResolverProvider> mediaTypeResolverList;

	public static IMediaTypeResolverProvider[] getMediaTypeResolver() {
		return mediaTypeResolverList.toArray(new IMediaTypeResolverProvider[] {});
	}

	static {
		mediaTypeResolverList = new ArrayList<IMediaTypeResolverProvider>();
		IConfigurationElement[] config =
		                                 Platform.getExtensionRegistry()
		                                         .getConfigurationElementsFor(MEDIA_TYPE_EXTENSION);
		for (IConfigurationElement e : config) {
			try {
				MediaTypeResolverProviderImpl providers = new MediaTypeResolverProviderImpl();
				providers.setId(e.getAttribute("id"));
				providers.setMediaType(e.getAttribute("mediaType"));
				String extensions = e.getAttribute("extensions");
				if (extensions != null && !extensions.trim().equals("")) {
					providers.addExtensions(extensions.split(","));
				}
// Path: plugins/org.wso2.developerstudio.eclipse.logging/src/org/wso2/developerstudio/eclipse/logging/core/IDeveloperStudioLog.java
// public interface IDeveloperStudioLog {
// 
// 	public void setPluginId(String pluginId);
// 
// 	public String getPluginId();
// 
// 	public void setClassObj(Class<Object> classObj);
// 
// 	public Class<Object> getClassObj();
// 
// 	public void info(String message);
// 
// 	public void info(String message, Exception e);
// 
// 	public void warn(String message);
// 
// 	public void warn(String message, Exception e);
// 
// 	public void error(String message);
// 
// 	public void error(Exception e);
// 	
// 	public void error(String message, Exception e);
// 
// 	public void error(Throwable e);
// 
// 	public void error(String message, Throwable e);
// 
// 	public void info(Throwable e);
// 
// 	public void info(String message, Throwable e);
// 
// 	public void warn(Throwable e);
// 
// 	public void warn(String message, Throwable e);
// 
// }
// 
// Path: plugins/org.wso2.developerstudio.eclipse.platform.core/src/org/wso2/developerstudio/eclipse/platform/core/Activator.java
// public class Activator extends AbstractUIPlugin {
// 
// 	public static final String PLUGIN_ID = "org.wso2.tools.eclipse.platform.core";
// 
// 	private static Activator plugin;
// 
// 	public Activator() {
// 	}
// 
// 	public void start(BundleContext context) throws Exception {
// 		super.start(context);
// 		plugin = this;
// 	}
// 
// 	public void stop(BundleContext context) throws Exception {
// 		plugin = null;
// 		super.stop(context);
// 	}
// 
// 	public static Activator getDefault() {
// 		return plugin;
// 	}
// 
// }
// 
// Path: plugins/org.wso2.developerstudio.eclipse.platform.core/src/org/wso2/developerstudio/eclipse/platform/core/interfaces/IMediaTypeResolver.java
// public abstract interface IMediaTypeResolver {
// 
// }


// Path: plugins/org.wso2.developerstudio.eclipse.platform.core/src/org/wso2/developerstudio/eclipse/platform/core/utils/CSMediaUtils.java
import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.Platform;
import org.wso2.developerstudio.eclipse.logging.core.IDeveloperStudioLog;
import org.wso2.developerstudio.eclipse.logging.core.Logger;
import org.wso2.developerstudio.eclipse.platform.core.Activator;
import org.wso2.developerstudio.eclipse.platform.core.interfaces.IMediaTypeResolver;
import org.wso2.developerstudio.eclipse.platform.core.interfaces.IMediaTypeResolverProvider;
import org.wso2.developerstudio.eclipse.platform.core.internal.impl.MediaTypeResolverProviderImpl;

/*
 * Copyright (c) 2010-2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
 * 
 * Licensed 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.wso2.developerstudio.eclipse.platform.core.utils;



public class CSMediaUtils {
	private static IDeveloperStudioLog log = Logger.getLog(Activator.PLUGIN_ID);

	private static String MEDIA_TYPE_EXTENSION = "org.wso2.developerstudio.eclipse.platform.core.mediatype";
	private static List<IMediaTypeResolverProvider> mediaTypeResolverList;

	public static IMediaTypeResolverProvider[] getMediaTypeResolver() {
		return mediaTypeResolverList.toArray(new IMediaTypeResolverProvider[] {});
	}

	static {
		mediaTypeResolverList = new ArrayList<IMediaTypeResolverProvider>();
		IConfigurationElement[] config =
		                                 Platform.getExtensionRegistry()
		                                         .getConfigurationElementsFor(MEDIA_TYPE_EXTENSION);
		for (IConfigurationElement e : config) {
			try {
				MediaTypeResolverProviderImpl providers = new MediaTypeResolverProviderImpl();
				providers.setId(e.getAttribute("id"));
				providers.setMediaType(e.getAttribute("mediaType"));
				String extensions = e.getAttribute("extensions");
				if (extensions != null && !extensions.trim().equals("")) {
					providers.addExtensions(extensions.split(","));
				}
				providers.setMediaTypeResolver((IMediaTypeResolver) e.createExecutableExtension("class"));