@Test public void testCreateExporterForUnsupportedFormat() { try { FormatExporterFactory.create("really_weired_format.dbl"); fail("IOException expected"); } catch (IOException expected) { } }
public static FormatExporter create(String fileName) throws IOException { if (SmosUtils.isBrowseFormat(fileName)) { return new BrowseFormatExporter(); } else if (SmosUtils.isL1cType(fileName)) { return new L1CFormatExporter(); } else if (SmosUtils.isOsUserFormat(fileName) || SmosUtils.isSmUserFormat(fileName)) { return new L2FormatExporter(); } throw new IOException("Unsupported export for file:" + fileName); }
FormatExporterFactory { public static FormatExporter create(String fileName) throws IOException { if (SmosUtils.isBrowseFormat(fileName)) { return new BrowseFormatExporter(); } else if (SmosUtils.isL1cType(fileName)) { return new L1CFormatExporter(); } else if (SmosUtils.isOsUserFormat(fileName) || SmosUtils.isSmUserFormat(fileName)) { return new L2FormatExporter(); } throw new IOException("Unsupported export for file:" + fileName); } }
FormatExporterFactory { public static FormatExporter create(String fileName) throws IOException { if (SmosUtils.isBrowseFormat(fileName)) { return new BrowseFormatExporter(); } else if (SmosUtils.isL1cType(fileName)) { return new L1CFormatExporter(); } else if (SmosUtils.isOsUserFormat(fileName) || SmosUtils.isSmUserFormat(fileName)) { return new L2FormatExporter(); } throw new IOException("Unsupported export for file:" + fileName); }  }
FormatExporterFactory { public static FormatExporter create(String fileName) throws IOException { if (SmosUtils.isBrowseFormat(fileName)) { return new BrowseFormatExporter(); } else if (SmosUtils.isL1cType(fileName)) { return new L1CFormatExporter(); } else if (SmosUtils.isOsUserFormat(fileName) || SmosUtils.isSmUserFormat(fileName)) { return new L2FormatExporter(); } throw new IOException("Unsupported export for file:" + fileName); }  static FormatExporter create(String fileName); }
FormatExporterFactory { public static FormatExporter create(String fileName) throws IOException { if (SmosUtils.isBrowseFormat(fileName)) { return new BrowseFormatExporter(); } else if (SmosUtils.isL1cType(fileName)) { return new L1CFormatExporter(); } else if (SmosUtils.isOsUserFormat(fileName) || SmosUtils.isSmUserFormat(fileName)) { return new L2FormatExporter(); } throw new IOException("Unsupported export for file:" + fileName); }  static FormatExporter create(String fileName);  }