myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lof...@apache.org
Subject svn commit: r1697889 - in /myfaces/tobago/branches/tobago-3.0.x/tobago-core/src: main/java/org/apache/myfaces/tobago/internal/util/MimeTypeUtils.java test/java/org/apache/myfaces/tobago/internal/util/MimeTypeUtilsUnitTest.java
Date Wed, 26 Aug 2015 11:37:04 GMT
Author: lofwyr
Date: Wed Aug 26 11:37:04 2015
New Revision: 1697889

URL: http://svn.apache.org/r1697889
Log:
TOBAGO-1368: Create a new theme which uses Bootstrap - Mime Type support for woff2 fonts

Modified:
    myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/util/MimeTypeUtils.java
    myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/test/java/org/apache/myfaces/tobago/internal/util/MimeTypeUtilsUnitTest.java

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/util/MimeTypeUtils.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/util/MimeTypeUtils.java?rev=1697889&r1=1697888&r2=1697889&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/util/MimeTypeUtils.java
(original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/util/MimeTypeUtils.java
Wed Aug 26 11:37:04 2015
@@ -77,6 +77,10 @@ public final class MimeTypeUtils {
       if (file.endsWith("html")) {
         return "text/html";
       }
+    } else if (file.charAt(length - 6) == '.') {
+      if (file.endsWith("woff2")) {
+        return "application/font-woff2";
+      }
     }
 
     final int index = file.lastIndexOf('.');

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/test/java/org/apache/myfaces/tobago/internal/util/MimeTypeUtilsUnitTest.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/test/java/org/apache/myfaces/tobago/internal/util/MimeTypeUtilsUnitTest.java?rev=1697889&r1=1697888&r2=1697889&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/test/java/org/apache/myfaces/tobago/internal/util/MimeTypeUtilsUnitTest.java
(original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/test/java/org/apache/myfaces/tobago/internal/util/MimeTypeUtilsUnitTest.java
Wed Aug 26 11:37:04 2015
@@ -35,6 +35,7 @@ public class MimeTypeUtilsUnitTest exten
   public static final String HTM = "http:///localhost:8080/demo/demo.htm";
   public static final String MAP = "http:///localhost:8080/demo/demo.map";
   public static final String WOFF = "http:///localhost:8080/demo/demo.woff";
+  public static final String WOFF2 = "http:///localhost:8080/demo/demo.woff2";
   public static final String TTF = "http:///localhost:8080/demo/demo.ttf";
   public static final String SVG = "http:///localhost:8080/demo/demo.svg";
   public static final String ODT = "http:///localhost:8080/demo/demo.odt";
@@ -59,6 +60,7 @@ public class MimeTypeUtilsUnitTest exten
     Assert.assertEquals("text/html", MimeTypeUtils.getMimeTypeForFile(HTM));
     Assert.assertEquals("application/json", MimeTypeUtils.getMimeTypeForFile(MAP));
     Assert.assertEquals("application/font-woff", MimeTypeUtils.getMimeTypeForFile(WOFF));
+    Assert.assertEquals("application/font-woff2", MimeTypeUtils.getMimeTypeForFile(WOFF2));
     Assert.assertEquals("application/x-font-ttf", MimeTypeUtils.getMimeTypeForFile(TTF));
     Assert.assertEquals("image/svg+xml", MimeTypeUtils.getMimeTypeForFile(SVG));
   }



Mime
View raw message