1 package org.simantics.fileimport;
\r
3 import java.nio.file.Path;
\r
4 import java.util.Map;
\r
5 import java.util.Optional;
\r
8 * Base interface for performing file imports.
\r
10 * Usually with Simantics products every file that will be imported will become
\r
11 * a resource in the Simantics database. For these cases see {@link SimanticsResourceFileImport}
\r
13 * @author Jani Simomaa
\r
16 public interface IGenericFileImport {
\r
19 * Performs the import for the given file
\r
21 * @param file Path to file to import
\r
22 * @return Optional string which will be the identifier of the imported file which can later be used for removing the imported entity
\r
25 Optional<String> perform(Path file) throws Exception;
\r
30 * @param identifier String identifier which can be used to remove the imported entity
\r
32 void remove(String identifier) throws Exception;
\r
35 * Returns a key-value map for file extensions this importer can handle
\r
37 * @return Map<String, String> allowed extensions this service can handle. Key is the extension e.g. <code>.sharedLibrary</code> and the value is the description of the extension
\r
39 Map<String, String> allowedExtensionsWithFilters();
\r