@Override public boolean isThisType(String filename, boolean open) { if (!open) return super.isThisType(filename, open); // no file system access Location baseFile = new Location(filename).getAbsoluteFile(); Location wellDir = baseFile.getParentFile(); String wellName = wellDir.getName(); if (checkSuffix(filename, "txt")) { String name = baseFile.getName(); return wellName.equals("results") || wellName.equals("Batchresults") || name.equals("Nugenesistemplate.txt") || name.startsWith("mode"); } Location experiment = null; try { experiment = wellDir.getParentFile().getParentFile(); } catch (NullPointerException e) { } if (experiment == null) return false; boolean validName = wellName.startsWith("Well") || wellName.equals("results") || (wellName.length() == 1 && wellName.replaceAll("\\d", "").length() == 0); return validName && super.isThisType(filename, open); }
@Override public boolean isThisType(String filename, boolean open) { if (!open) return super.isThisType(filename, open); // no file system access Location baseFile = new Location(filename).getAbsoluteFile(); Location wellDir = baseFile.getParentFile(); String wellName = wellDir.getName(); if (checkSuffix(filename, "txt")) { String name = baseFile.getName(); return wellName.equals("results") || wellName.equals("Batchresults") || name.equals("Nugenesistemplate.txt") || name.startsWith("mode"); } Location experiment = null; try { experiment = wellDir.getParentFile().getParentFile(); } catch (NullPointerException e) { } if (experiment == null) return false; boolean validName = wellName.startsWith("Well") || wellName.equals("results") || (wellName.length() == 1 && wellName.replaceAll("\\d", "").length() == 0); return validName && super.isThisType(filename, open); }
super.initFile(id); if (checkSuffix(id, "txt")) { String path = new Location(well, file).getAbsolutePath(); if (isThisType(path) && checkSuffix(path, new String[] {"tif", "tiff"}))
super.initFile(id); if (checkSuffix(id, "txt")) { String path = new Location(well, file).getAbsolutePath(); if (isThisType(path) && checkSuffix(path, new String[] {"tif", "tiff"}))