@Test public void testExtractCRSUsingMissingFile() { System.out.println("testExtractCRSUsingMissingFile"); File file = new File(FileUtils.getTempDirectory(), "I_do_not_exist"); try { GMLUtil.determineCollectionCRS(file); } catch (IOException ex) { assertThat(ex, instanceOf(IOException.class)); assertThat(ex.getCause(), instanceOf(FileNotFoundException.class)); } }
public static CoordinateReferenceSystem determineCollectionCRS(File file) throws IOException { InputStream inputStream = null; CoordinateReferenceSystem crs = null; try { inputStream = new BufferedInputStream(new FileInputStream(file)); crs = determineCollectionCRS(inputStream); } catch (FileNotFoundException ex) { throw new IOException(MSG_ERR_DETERMINE_CRS, ex); } finally { IOUtils.closeQuietly(inputStream); } return crs; }
GMLUtil { public static CoordinateReferenceSystem determineCollectionCRS(File file) throws IOException { InputStream inputStream = null; CoordinateReferenceSystem crs = null; try { inputStream = new BufferedInputStream(new FileInputStream(file)); crs = determineCollectionCRS(inputStream); } catch (FileNotFoundException ex) { throw new IOException(MSG_ERR_DETERMINE_CRS, ex); } finally { IOUtils.closeQuietly(inputStream); } return crs; } }
GMLUtil { public static CoordinateReferenceSystem determineCollectionCRS(File file) throws IOException { InputStream inputStream = null; CoordinateReferenceSystem crs = null; try { inputStream = new BufferedInputStream(new FileInputStream(file)); crs = determineCollectionCRS(inputStream); } catch (FileNotFoundException ex) { throw new IOException(MSG_ERR_DETERMINE_CRS, ex); } finally { IOUtils.closeQuietly(inputStream); } return crs; }  }
GMLUtil { public static CoordinateReferenceSystem determineCollectionCRS(File file) throws IOException { InputStream inputStream = null; CoordinateReferenceSystem crs = null; try { inputStream = new BufferedInputStream(new FileInputStream(file)); crs = determineCollectionCRS(inputStream); } catch (FileNotFoundException ex) { throw new IOException(MSG_ERR_DETERMINE_CRS, ex); } finally { IOUtils.closeQuietly(inputStream); } return crs; }  static ReferencedEnvelope determineCollectionEnvelope(File file); static ReferencedEnvelope determineCollectionEnvelope(File file, CoordinateReferenceSystem crs); static ReferencedEnvelope determineCollectionEnvelope(InputStream inputStream, CoordinateReferenceSystem crs); static CoordinateReferenceSystem determineCollectionCRS(File file); static CoordinateReferenceSystem determineCollectionCRS(InputStream inputStream); static QName extractFeatureTypeSchema(File file); static QName extractFeatureTypeSchema(InputStream inputStream); static Configuration generateGMLConfiguration(File file); static Configuration generateGMLConfiguration(InputStream inputStream); }
GMLUtil { public static CoordinateReferenceSystem determineCollectionCRS(File file) throws IOException { InputStream inputStream = null; CoordinateReferenceSystem crs = null; try { inputStream = new BufferedInputStream(new FileInputStream(file)); crs = determineCollectionCRS(inputStream); } catch (FileNotFoundException ex) { throw new IOException(MSG_ERR_DETERMINE_CRS, ex); } finally { IOUtils.closeQuietly(inputStream); } return crs; }  static ReferencedEnvelope determineCollectionEnvelope(File file); static ReferencedEnvelope determineCollectionEnvelope(File file, CoordinateReferenceSystem crs); static ReferencedEnvelope determineCollectionEnvelope(InputStream inputStream, CoordinateReferenceSystem crs); static CoordinateReferenceSystem determineCollectionCRS(File file); static CoordinateReferenceSystem determineCollectionCRS(InputStream inputStream); static QName extractFeatureTypeSchema(File file); static QName extractFeatureTypeSchema(InputStream inputStream); static Configuration generateGMLConfiguration(File file); static Configuration generateGMLConfiguration(InputStream inputStream);  }