org.springframework.core.io.InputStreamSource#getInputStream ( )源码实例Demo

下面列出了org.springframework.core.io.InputStreamSource#getInputStream ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: spring-analysis-note   文件: MimeMessageHelper.java
/**
 * Create an Activation Framework DataSource for the given InputStreamSource.
 * @param inputStreamSource the InputStreamSource (typically a Spring Resource)
 * @param contentType the content type
 * @param name the name of the DataSource
 * @return the Activation Framework DataSource
 */
protected DataSource createDataSource(
	final InputStreamSource inputStreamSource, final String contentType, final String name) {

	return new DataSource() {
		@Override
		public InputStream getInputStream() throws IOException {
			return inputStreamSource.getInputStream();
		}
		@Override
		public OutputStream getOutputStream() {
			throw new UnsupportedOperationException("Read-only javax.activation.DataSource");
		}
		@Override
		public String getContentType() {
			return contentType;
		}
		@Override
		public String getName() {
			return name;
		}
	};
}
 
源代码2 项目: java-technology-stack   文件: MimeMessageHelper.java
/**
 * Create an Activation Framework DataSource for the given InputStreamSource.
 * @param inputStreamSource the InputStreamSource (typically a Spring Resource)
 * @param contentType the content type
 * @param name the name of the DataSource
 * @return the Activation Framework DataSource
 */
protected DataSource createDataSource(
	final InputStreamSource inputStreamSource, final String contentType, final String name) {

	return new DataSource() {
		@Override
		public InputStream getInputStream() throws IOException {
			return inputStreamSource.getInputStream();
		}
		@Override
		public OutputStream getOutputStream() {
			throw new UnsupportedOperationException("Read-only javax.activation.DataSource");
		}
		@Override
		public String getContentType() {
			return contentType;
		}
		@Override
		public String getName() {
			return name;
		}
	};
}
 
源代码3 项目: lams   文件: MimeMessageHelper.java
/**
 * Create an Activation Framework DataSource for the given InputStreamSource.
 * @param inputStreamSource the InputStreamSource (typically a Spring Resource)
 * @param contentType the content type
 * @param name the name of the DataSource
 * @return the Activation Framework DataSource
 */
protected DataSource createDataSource(
	final InputStreamSource inputStreamSource, final String contentType, final String name) {

	return new DataSource() {
		@Override
		public InputStream getInputStream() throws IOException {
			return inputStreamSource.getInputStream();
		}
		@Override
		public OutputStream getOutputStream() {
			throw new UnsupportedOperationException("Read-only javax.activation.DataSource");
		}
		@Override
		public String getContentType() {
			return contentType;
		}
		@Override
		public String getName() {
			return name;
		}
	};
}
 
源代码4 项目: spring4-understanding   文件: MimeMessageHelper.java
/**
 * Create an Activation Framework DataSource for the given InputStreamSource.
 * @param inputStreamSource the InputStreamSource (typically a Spring Resource)
 * @param contentType the content type
 * @param name the name of the DataSource
 * @return the Activation Framework DataSource
 */
protected DataSource createDataSource(
	final InputStreamSource inputStreamSource, final String contentType, final String name) {

	return new DataSource() {
		@Override
		public InputStream getInputStream() throws IOException {
			return inputStreamSource.getInputStream();
		}
		@Override
		public OutputStream getOutputStream() {
			throw new UnsupportedOperationException("Read-only javax.activation.DataSource");
		}
		@Override
		public String getContentType() {
			return contentType;
		}
		@Override
		public String getName() {
			return name;
		}
	};
}
 
源代码5 项目: cloudbreak   文件: IntegrationTestApp.java
private XmlSuite loadSuite(String suitePath, InputStreamSource resource) throws IOException {
    IFileParser<XmlSuite> parser = getParser(suitePath);
    try (InputStream inputStream = resource.getInputStream()) {
        XmlSuite xmlSuite = parser.parse(suitePath, inputStream, true);
        xmlSuite.setParallel(XmlSuite.ParallelMode.getValidParallel(parallel));
        xmlSuite.setThreadCount(threadCount);
        xmlSuite.setTimeOut(timeOut);
        LOG.info("Test are running in: {} type of parallel mode, thread count: {} and with test timeout: {}", parallel.toUpperCase(), threadCount, timeOut);
        return xmlSuite;
    }
}