]> gerrit.simantics Code Review - simantics/platform.git/blob
3963f6e7b1b6d0857b8d58d8e68fd67c682d4c47
[simantics/platform.git] /
1 package org.simantics.spreadsheet.fileimport;
2
3 import java.nio.file.Path;
4 import java.util.HashMap;
5 import java.util.Map;
6 import java.util.Optional;
7
8 import org.simantics.db.Resource;
9 import org.simantics.fileimport.SimanticsResourceFileImport;
10
11 public class ExcelFileImport extends SimanticsResourceFileImport {
12
13     private static final Map<String, String> ALLOWED_EXTENSIONS = new HashMap<>(2);
14     
15     static {
16         ALLOWED_EXTENSIONS.put("*.xls", "Excel file *.xls");
17         ALLOWED_EXTENSIONS.put("*.xlsx", "Excel file *.xlsx");
18     }
19     
20     @Override
21     public Optional<Resource> perform(Resource parent, Path file) {
22         return Optional.empty();
23     }
24
25     @Override
26     public Map<String, String> allowedExtensionsWithFilters() {
27         return ALLOWED_EXTENSIONS;
28     }
29
30 }