@Override public boolean isThisType(String name, boolean open) { if (checkSuffix(name, "companion.ome")) { // force the reader to pick up binary-only companion files return true; } metaFile = new Location(name).getAbsolutePath(); boolean valid = super.isThisType(name, open); if (metadataFile != null) { // this is a binary-only file // overwrite XML with what is in the companion OME-XML file String dir = new File(metaFile).getParent(); Location path = new Location(dir, metadataFile); LOGGER.debug("Checking metadata file {}", path); if (!path.exists()) return false; metadataFile = path.getAbsolutePath(); try { String xml = readMetadataFile(); service.createOMEXMLMetadata(xml); } catch (ServiceException se) { LOGGER.debug("OME-XML parsing failed", se); return false; } catch (IOException | NullPointerException e) { return false; } } return valid; }
@Override public boolean isThisType(String name, boolean open) { if (checkSuffix(name, "companion.ome")) { // force the reader to pick up binary-only companion files return true; } metaFile = new Location(name).getAbsolutePath(); boolean valid = super.isThisType(name, open); if (metadataFile != null) { // this is a binary-only file // overwrite XML with what is in the companion OME-XML file String dir = new File(metaFile).getParent(); Location path = new Location(dir, metadataFile); LOGGER.debug("Checking metadata file {}", path); if (!path.exists()) return false; metadataFile = path.getAbsolutePath(); try { String xml = readMetadataFile(); service.createOMEXMLMetadata(xml); } catch (ServiceException se) { LOGGER.debug("OME-XML parsing failed", se); return false; } catch (IOException | NullPointerException e) { return false; } } return valid; }
if (path.exists()) { metadataFile = path.getAbsolutePath(); xml = readMetadataFile();
if (path.exists()) { metadataFile = path.getAbsolutePath(); xml = readMetadataFile();