changeset 21478:2dad34a3d7b0

Hardcoding .sl mimetype for now. Should have an API so language implementations can declare their own supported mime types.
author Jaroslav Tulach <jaroslav.tulach@oracle.com>
date Mon, 25 May 2015 08:49:16 +0200
parents b1e712f66fe0
children 2405d3b983cc
files graal/com.oracle.truffle.api/src/com/oracle/truffle/api/vm/TruffleVM.java
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/vm/TruffleVM.java	Mon May 25 01:37:31 2015 +0200
+++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/vm/TruffleVM.java	Mon May 25 08:49:16 2015 +0200
@@ -147,7 +147,13 @@
         if (location.getScheme().equals("file")) {
             File file = new File(location);
             s = Source.fromFileName(file.getPath(), true);
-            mimeType = file.getName().endsWith(".c") ? "text/x-c" : Files.probeContentType(file.toPath());
+            if (file.getName().endsWith(".c")) {
+                mimeType = "text/x-c";
+            } else if (file.getName().endsWith(".sl")) {
+                mimeType = "application/x-sl";
+            } else {
+                mimeType = Files.probeContentType(file.toPath());
+            }
         } else {
             URL url = location.toURL();
             s = Source.fromURL(url, location.toString());