// Path: org.eclipse.a.wst.html.webresources.core/src/org/eclipse/wst/html/webresources/core/WebResourceType.java
// public enum WebResourceType {
// 
// 	css, js, img;
// 
// 	public static WebResourceType get(String value) {
// 		WebResourceType[] types = WebResourceType.values();
// 		WebResourceType type;
// 		for (int i = 0; i < types.length; i++) {
// 			type = types[i];
// 			if (type.name().equalsIgnoreCase(value)) {
// 				return type;
// 			}
// 		}
// 		return null;
// 	}
// 	 
// }


import java.io.File;
import java.util.ArrayList;
import java.util.Collection;
import org.eclipse.core.resources.IResource;
import org.eclipse.wst.html.webresources.core.WebResourceType;

/**
 *  Copyright (c) 2013-2014 Angelo ZERR.
 *  All rights reserved. This program and the accompanying materials
 *  are made available under the terms of the Eclipse Public License v1.0
 *  which accompanies this distribution, and is available at
 *  http://www.eclipse.org/legal/epl-v10.html
 *
 *  Contributors:
 *  Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
 */
package org.eclipse.wst.html.webresources.core.utils;



/**
 * Helper for {@link IResource}.
 */
public class ResourceHelper {

	private final static Collection<String> IMG_EXTENSIONS;

	static {
		IMG_EXTENSIONS = new ArrayList<String>();
		IMG_EXTENSIONS.add("bmp");
		IMG_EXTENSIONS.add("gif");
		IMG_EXTENSIONS.add("jif");
		IMG_EXTENSIONS.add("jfif");
		IMG_EXTENSIONS.add("jpg");
		IMG_EXTENSIONS.add("jpeg");
		IMG_EXTENSIONS.add("png");
		IMG_EXTENSIONS.add("tif");
		IMG_EXTENSIONS.add("tiff");
		IMG_EXTENSIONS.add("wbmp");
	}

	private final static Collection<String> CSS_EXTENSIONS;

	static {
		CSS_EXTENSIONS = new ArrayList<String>();
		CSS_EXTENSIONS.add("css");
		CSS_EXTENSIONS.add("scss");
	}

	private ResourceHelper() {}

	/**
	 * Returns the web resource type of the given resource and null otherwise.
	 * 
	 * @param resource
	 * @return the web resource type of the given resource and null otherwise.
	 */

// Path: org.eclipse.a.wst.html.webresources.core/src/org/eclipse/wst/html/webresources/core/WebResourceType.java
// public enum WebResourceType {
// 
// 	css, js, img;
// 
// 	public static WebResourceType get(String value) {
// 		WebResourceType[] types = WebResourceType.values();
// 		WebResourceType type;
// 		for (int i = 0; i < types.length; i++) {
// 			type = types[i];
// 			if (type.name().equalsIgnoreCase(value)) {
// 				return type;
// 			}
// 		}
// 		return null;
// 	}
// 	 
// }


// Path: org.eclipse.a.wst.html.webresources.core/src/org/eclipse/wst/html/webresources/core/utils/ResourceHelper.java
import java.io.File;
import java.util.ArrayList;
import java.util.Collection;
import org.eclipse.core.resources.IResource;
import org.eclipse.wst.html.webresources.core.WebResourceType;

/**
 *  Copyright (c) 2013-2014 Angelo ZERR.
 *  All rights reserved. This program and the accompanying materials
 *  are made available under the terms of the Eclipse Public License v1.0
 *  which accompanies this distribution, and is available at
 *  http://www.eclipse.org/legal/epl-v10.html
 *
 *  Contributors:
 *  Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
 */
package org.eclipse.wst.html.webresources.core.utils;



/**
 * Helper for {@link IResource}.
 */
public class ResourceHelper {

	private final static Collection<String> IMG_EXTENSIONS;

	static {
		IMG_EXTENSIONS = new ArrayList<String>();
		IMG_EXTENSIONS.add("bmp");
		IMG_EXTENSIONS.add("gif");
		IMG_EXTENSIONS.add("jif");
		IMG_EXTENSIONS.add("jfif");
		IMG_EXTENSIONS.add("jpg");
		IMG_EXTENSIONS.add("jpeg");
		IMG_EXTENSIONS.add("png");
		IMG_EXTENSIONS.add("tif");
		IMG_EXTENSIONS.add("tiff");
		IMG_EXTENSIONS.add("wbmp");
	}

	private final static Collection<String> CSS_EXTENSIONS;

	static {
		CSS_EXTENSIONS = new ArrayList<String>();
		CSS_EXTENSIONS.add("css");
		CSS_EXTENSIONS.add("scss");
	}

	private ResourceHelper() {}

	/**
	 * Returns the web resource type of the given resource and null otherwise.
	 * 
	 * @param resource
	 * @return the web resource type of the given resource and null otherwise.
	 */

	public static WebResourceType getWebResourceType(IResource resource) {
