* @throws JAXBException
*/
public static Build copyDefaultBuildModelAndLoad(String destination) throws IOException, JAXBException {
- InputStream source = RtMetaPlugin.class.getResourceAsStream("resources" + File.separator + IModelConstants.FILE_NAME_BUILD_META_XML);
- Build model = copyDefaultModelAndLoad(Build.class, source, destination);
- if (source != null) {
- source.close();
+ Build model = null;
+ InputStream source = null;
+ try {
+ source = RtMetaPlugin.class.getResourceAsStream("resources" + File.separator + IModelConstants.FILE_NAME_BUILD_META_XML);
+ model = copyDefaultModelAndLoad(Build.class, source, destination);
+ } catch (Exception e) {
+ throw e;
+ } finally {
+ if (source != null) {
+ try {
+ source.close();
+ } catch (IOException e) {
+ // Do nothing
+ }
+ }
}
return model;
}
* @throws JAXBException
*/
public static Flash copyDefaultFlashModelAndLoad(String destination) throws IOException, JAXBException {
- InputStream source = RtMetaPlugin.class.getResourceAsStream("resources" + File.separator + IModelConstants.FILE_NAME_FLASH_META_XML);
- Flash model = copyDefaultModelAndLoad(Flash.class, source, destination);
- if (source != null) {
- source.close();
+ Flash model = null;
+ InputStream source = null;
+ try {
+ source = RtMetaPlugin.class.getResourceAsStream("resources" + File.separator + IModelConstants.FILE_NAME_FLASH_META_XML);
+ model = copyDefaultModelAndLoad(Flash.class, source, destination);
+ } catch (Exception e) {
+ throw e;
+ } finally {
+ if (source != null) {
+ try {
+ source.close();
+ } catch (IOException e) {
+ // Do nothing
+ }
+ }
}
return model;
}
* @throws JAXBException
*/
public static Debugs copyDefaultDebugModelAndLoad(String destination) throws IOException, JAXBException {
- InputStream source = RtMetaPlugin.class.getResourceAsStream("resources" + File.separator + IModelConstants.FILE_NAME_DEBUG_META_XML);
- Debugs model = copyDefaultModelAndLoad(Debugs.class, source, destination);
- if (source != null) {
- source.close();
+ Debugs model = null;
+ InputStream source = null;
+ try {
+ source = RtMetaPlugin.class.getResourceAsStream("resources" + File.separator + IModelConstants.FILE_NAME_DEBUG_META_XML);
+ model = copyDefaultModelAndLoad(Debugs.class, source, destination);
+ } catch (Exception e) {
+ throw e;
+ } finally {
+ if (source != null) {
+ try {
+ source.close();
+ } catch (IOException e) {
+ // Do nothing
+ }
+ }
}
return model;
}
public static void validateBuildFile(InputStream xmlFileStream)
throws FileNotFoundException, ParserConfigurationException, SAXException, IOException {
- InputStream xsdFileStream = RtMetaPlugin.class.getResourceAsStream("resources/buildSpec.xsd"); //$NON-NLS-1$
- validate(xmlFileStream, xsdFileStream);
- if (xsdFileStream != null) {
- xsdFileStream.close();
+ InputStream xsdFileStream = null;
+ try {
+ xsdFileStream = RtMetaPlugin.class.getResourceAsStream("resources/buildSpec.xsd"); //$NON-NLS-1$
+ validate(xmlFileStream, xsdFileStream);
+ } catch (Exception e) {
+ throw e;
+ } finally {
+ if (xsdFileStream != null) {
+ try {
+ xsdFileStream.close();
+ } catch (IOException e) {
+ // Do nothing
+ }
+ }
}
}
public static void validateFlashFile(InputStream xmlFileStream)
throws FileNotFoundException, ParserConfigurationException, SAXException, IOException {
- InputStream xsdFileStream = RtMetaPlugin.class.getResourceAsStream("resources/flashSpec.xsd"); //$NON-NLS-1$
- validate(xmlFileStream, xsdFileStream);
- if (xsdFileStream != null) {
- xsdFileStream.close();
+ InputStream xsdFileStream = null;
+ try {
+ xsdFileStream = RtMetaPlugin.class.getResourceAsStream("resources/flashSpec.xsd"); //$NON-NLS-1$
+ validate(xmlFileStream, xsdFileStream);
+ } catch (Exception e) {
+ throw e;
+ } finally {
+ if (xsdFileStream != null) {
+ try {
+ xsdFileStream.close();
+ } catch (IOException e) {
+ // Do nothing
+ }
+ }
}
}
public static void validateDebugFile(InputStream xmlFileStream)
throws FileNotFoundException, ParserConfigurationException, SAXException, IOException {
- InputStream xsdFileStream = RtMetaPlugin.class.getResourceAsStream("resources/debugSpec.xsd"); //$NON-NLS-1$
- validate(xmlFileStream, xsdFileStream);
- if (xsdFileStream != null) {
- xsdFileStream.close();
+ InputStream xsdFileStream = null;
+ try {
+ xsdFileStream = RtMetaPlugin.class.getResourceAsStream("resources/debugSpec.xsd"); //$NON-NLS-1$
+ validate(xmlFileStream, xsdFileStream);
+ } catch (Exception e) {
+ throw e;
+ } finally {
+ if (xsdFileStream != null) {
+ try {
+ xsdFileStream.close();
+ } catch (IOException e) {
+ // Do nothing
+ }
+ }
}
}