/**
 * Copyright (C) 2009 - present by OpenGamma Inc. and the OpenGamma group of companies
 *
 * Please see distribution for license.
 */
package com.opengamma.web.bundle;

import org.apache.commons.lang.StringUtils;

/**
 * The type of a bundle, either CSS or Javascript.
 */
public enum BundleType {

  /**
   * The Javascript type.
   */
  JS("js"),
  /**
   * The CSS type.
   */
  CSS("css");

  /**
   * The file suffix.
   */
  private final String _suffix;

  /**
   * Creates an instance.
   * 
   * @param suffix  the file suffix, not null
   */
  BundleType(String suffix) {
    _suffix = suffix;
  }

  //-------------------------------------------------------------------------
  /**
   * Gets the file suffix used by the type of file.
   * 
   * @return the file suffix, not null
   */
  public String getSuffix() {
    return _suffix;
  }

  /**
   * Lookup the type using the file suffix.
   * 
   * @param fileName  the file name including the suffix, null returns null
   * @return the bundle type, null if unable to determine
   */
  public static BundleType getType(String fileName) {
    if (StringUtils.isNotBlank(fileName)) {
      if (fileName.endsWith("." + JS.getSuffix())) {
        return JS;
      } else if (fileName.endsWith("." + CSS.getSuffix())) {
        return CSS;
      }
    }
    return null;
  }

}

@@ -238,16 +238,28 @@
 a bundle
+ or fragment
 , either
@@ -262,16 +262,22 @@
 ther CSS
+, SCSS
  or Java
@@ -407,16 +407,63 @@
 S(%22css%22)
+,%0A  /**%0A   * The SCSS type%0A   */%0A  SCSS(%22scss%22)
 ;%0A%0A  /**
@@ -1140,24 +1140,30 @@
 ype getType(
+final 
 String fileN
@@ -1168,16 +1168,20 @@
 eName) %7B
+    
 %0A    if 
@@ -1228,32 +1228,46 @@
    if (fileName.
+toLowerCase().
 endsWith(%22.%22 + J
@@ -1329,16 +1329,30 @@
 ileName.
+toLowerCase().
 endsWith
@@ -1398,16 +1398,113 @@
 rn CSS;%0A
+      %7D else if (fileName.toLowerCase().endsWith(%22.%22 + SCSS.getSuffix())) %7B%0A        return SCSS;%0A
       %7D%0A

Add scss type to Bundle type