]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.spreadsheet.fileimport/src/org/simantics/spreadsheet/fileimport/ExcelFileImport.java
Some fixes for FileImportService to throw exceptions forward
[simantics/platform.git] / bundles / org.simantics.spreadsheet.fileimport / src / org / simantics / spreadsheet / fileimport / ExcelFileImport.java
index a3029021d8a780d92fe4c7afe2d8d3e2fedd5e9f..6719f5913fd6c288a741b6c0359d69d0eb47444b 100644 (file)
@@ -1,30 +1,30 @@
-package org.simantics.spreadsheet.fileimport;\r
-\r
-import java.nio.file.Path;\r
-import java.util.HashMap;\r
-import java.util.Map;\r
-import java.util.Optional;\r
-\r
-import org.simantics.db.Resource;\r
-import org.simantics.fileimport.SimanticsResourceFileImport;\r
-\r
-public class ExcelFileImport extends SimanticsResourceFileImport {\r
-\r
-    private static final Map<String, String> ALLOWED_EXTENSIONS = new HashMap<>(2);\r
-    \r
-    static {\r
-        ALLOWED_EXTENSIONS.put("*.xls", "Excel file *.xls");\r
-        ALLOWED_EXTENSIONS.put("*.xlsx", "Excel file *.xlsx");\r
-    }\r
-    \r
-    @Override\r
-    public Optional<Resource> perform(Resource parent, Path file) {\r
-        return Optional.empty();\r
-    }\r
-\r
-    @Override\r
-    public Map<String, String> allowedExtensionsWithFilters() {\r
-        return ALLOWED_EXTENSIONS;\r
-    }\r
-\r
-}\r
+package org.simantics.spreadsheet.fileimport;
+
+import java.nio.file.Path;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Optional;
+
+import org.simantics.db.Resource;
+import org.simantics.fileimport.SimanticsResourceFileImport;
+
+public class ExcelFileImport extends SimanticsResourceFileImport {
+
+    private static final Map<String, String> ALLOWED_EXTENSIONS = new HashMap<>(2);
+    
+    static {
+        ALLOWED_EXTENSIONS.put("*.xls", "Excel file *.xls");
+        ALLOWED_EXTENSIONS.put("*.xlsx", "Excel file *.xlsx");
+    }
+    
+    @Override
+    public Optional<Resource> perform(Resource parent, Path file) throws Exception {
+        throw new UnsupportedOperationException("Excel import is not yet supported");
+    }
+
+    @Override
+    public Map<String, String> allowedExtensionsWithFilters() {
+        return ALLOWED_EXTENSIONS;
+    }
+
+}