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