* jcifs를 이용해 Windows 파일공유서버에서 파일 읽어와 콘솔에 뿌리기 예제
import java.io.FileReader; import java.io.IOException; import jcifs.smb.NtlmPasswordAuthentication; import jcifs.smb.SmbFile; import jcifs.smb.SmbFileInputStream; public class JCIFS_Test { public static void main(String[] args) throws Exception { NtlmPasswordAuthentication auth = new NtlmPasswordAuthentication( "smb://x.x.x.x/", "administrator", "xxxx"); SmbFile smbFile = new SmbFile("smb://x.x.x.x/some_path/some_file.txt", auth); SmbFileInputStream sfis = null; try { sfis = new SmbFileInputStream(smbFile); byte[] buff = new byte[1024]; int read; while ((read = sfis.read(buff)) > 0) { System.out.write(buff, 0, read); } } finally { close(sfis); } System.out.println("done"); } private static void close(SmbFileInputStream sfis) { if (sfis == null) return; try { sfis.close(); } catch (IOException e) { e.printStackTrace(); } } }