public static Binding doBind(Binder binder, File file, Origin origin) { final FileInputStream fis; try { fis = new FileInputStream( file ); } catch ( FileNotFoundException e ) { throw new MappingNotFoundException( e, origin ); } return InputStreamXmlSource.doBind( binder, fis, origin, true ); } }
@Override public Binding doBind(Binder binder) { return doBind( binder, inputStream, getOrigin(), autoClose ); }
@Override public Binding doBind(Binder binder) { final InputStream stream; try { stream = jarFile.getInputStream( jarFileEntry ); } catch (IOException e) { throw new MappingException( String.format( "Unable to open InputStream for jar file entry [%s : %s]", jarFile.getName(), jarFileEntry.getName() ), e, getOrigin() ); } return InputStreamXmlSource.doBind( binder, stream, getOrigin(), true ); } }
public Binding bind(InputStream xmlInputStream) { LOG.tracef( "reading mappings from InputStream" ); final Origin origin = new Origin( SourceType.INPUT_STREAM, null ); return new InputStreamXmlSource( origin, xmlInputStream, false ).doBind( getMappingBinder() ); }
@Override public Binding doBind(Binder binder) { try { InputStream stream = url.openStream(); return InputStreamXmlSource.doBind( binder, stream, getOrigin(), true ); } catch (UnknownHostException e) { throw new MappingNotFoundException( "Invalid URL", e, getOrigin() ); } catch (IOException e) { throw new MappingException( "Unable to open URL InputStream", e, getOrigin() ); } } }
public Binding bind(InputStreamAccess xmlInputStreamAccess) { LOG.tracef( "reading mappings from InputStreamAccess : %s", xmlInputStreamAccess.getStreamName() ); final Origin origin = new Origin( SourceType.INPUT_STREAM, xmlInputStreamAccess.getStreamName() ); InputStream xmlInputStream = xmlInputStreamAccess.accessInputStream(); try { return new InputStreamXmlSource( origin, xmlInputStream, false ).doBind( mappingBinder ); } finally { try { xmlInputStream.close(); } catch (IOException e) { LOG.debugf( "Unable to close InputStream obtained from InputStreamAccess : " + xmlInputStreamAccess.getStreamName() ); } } }
public static Binding doBind(Binder binder, File file, Origin origin) { final FileInputStream fis; try { fis = new FileInputStream( file ); } catch ( FileNotFoundException e ) { throw new MappingNotFoundException( e, origin ); } return InputStreamXmlSource.doBind( binder, fis, origin, true ); } }
@Override public Binding doBind(Binder binder) { return doBind( binder, inputStream, getOrigin(), autoClose ); }
@Override public Binding doBind(Binder binder) { final InputStream stream; try { stream = jarFile.getInputStream( jarFileEntry ); } catch (IOException e) { throw new MappingException( String.format( "Unable to open InputStream for jar file entry [%s : %s]", jarFile.getName(), jarFileEntry.getName() ), e, getOrigin() ); } return InputStreamXmlSource.doBind( binder, stream, getOrigin(), true ); } }
public Binding bind(InputStream xmlInputStream) { LOG.tracef( "reading mappings from InputStream" ); final Origin origin = new Origin( SourceType.INPUT_STREAM, null ); return new InputStreamXmlSource( origin, xmlInputStream, false ).doBind( getMappingBinder() ); }
@Override public Binding doBind(Binder binder) { try { InputStream stream = url.openStream(); return InputStreamXmlSource.doBind( binder, stream, getOrigin(), true ); } catch (UnknownHostException e) { throw new MappingNotFoundException( "Invalid URL", e, getOrigin() ); } catch (IOException e) { throw new MappingException( "Unable to open URL InputStream", e, getOrigin() ); } } }
public Binding bind(InputStreamAccess xmlInputStreamAccess) { LOG.tracef( "reading mappings from InputStreamAccess : %s", xmlInputStreamAccess.getStreamName() ); final Origin origin = new Origin( SourceType.INPUT_STREAM, xmlInputStreamAccess.getStreamName() ); InputStream xmlInputStream = xmlInputStreamAccess.accessInputStream(); try { return new InputStreamXmlSource( origin, xmlInputStream, false ).doBind( mappingBinder ); } finally { try { xmlInputStream.close(); } catch (IOException e) { LOG.debugf( "Unable to close InputStream obtained from InputStreamAccess : " + xmlInputStreamAccess.getStreamName() ); } } }