All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.onetwo.common.spring.io.SmbInputStreamSource Maven / Gradle / Ivy

package org.onetwo.common.spring.io;

import java.io.IOException;
import java.io.InputStream;

import org.onetwo.common.file.FileUtils;
import org.springframework.core.io.InputStreamSource;

public class SmbInputStreamSource implements InputStreamSource {
	
	private InputStream inputStream;
	
	public SmbInputStreamSource(String smbPath){
		if(!FileUtils.isSmbPath(smbPath)){
			throw new IllegalArgumentException("It's not a smb path: " + smbPath);
		}
		inputStream = FileUtils.newInputStream(smbPath);
	}

	@Override
	public InputStream getInputStream() throws IOException {
		return inputStream;
	}
	
	

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy