Import image file via Java API
Posted: Mon Jan 04, 2016 2:40 pm
Hi,
I try to import imag files to the omero server via the Java API.
Unfortunately I can't get an instance of an importer to start the uploading procress.
How can I got an importer?
Thanks for your help.
I try to import imag files to the omero server via the Java API.
Unfortunately I can't get an instance of an importer to start the uploading procress.
- Code: Select all
File file = new File(“Path to my image file”);
FileObject fileObject = new FileObject(file);
ImportableFile importFile = new ImportableFile(fileObject, false);
List<ImportableFile> fileList = new ArrayList<>();
fileList.add(importFile);
ImportableObject importObject = new ImportableObject(fileList, false);
boolean exists = ImporterFactory.doesImporterExist(); <-- always FALSE
//crashes with NullPointerException
Importer importer = ImporterFactory.getImporter(user.getGroupId(), true, 0);
How can I got an importer?
Thanks for your help.