use of org.knime.core.data.uri.URIContent in project GenericKnimeNodes by genericworkflownodes.
the class MimeFileImporterNodeModel method execute.
@Override
protected PortObject[] execute(PortObject[] inObjects, ExecutionContext exec) throws Exception {
File file = new File(convertToURL(m_filename).toURI());
if (!file.exists()) {
throw new Exception("File does not exist: " + file.getAbsolutePath());
}
List<URIContent> uris = new ArrayList<URIContent>();
uris.add(new URIContent(file.toURI(), (m_file_extension.isActive() ? m_file_extension.getStringValue() : MIMETypeHelper.getMIMEtypeExtension(file.getAbsolutePath()))));
data = Helper.readFileSummary(file, 50);
return new PortObject[] { new URIPortObject(uris) };
}
Aggregations