package com.project.remoteUrl;
import java.io.File;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.FileInputStream;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import jcifs.smb.SmbFile;
import jcifs.smb.SmbFileOutputStream;
public class RemoteUrl {
//注意jcifs-1.3.15.jar 需要 远程计算机在局域网内,并且开启共享磁盘权限
/*
* Description: 从本地上传文件到共享目录
* @param remoteUrl 共享文件目录
* @param localFilePath 本地文件绝对路径
*/
public void smbPut(String remoteUrl,String localFilePath){
InputStream in = null;
OutputStream out = null;
try{
//创建file类 传入本地文件路径
File localFile = new File(localFilePath);
//获得本地文件的名字
String fileName = localFile.getName();
//将本地文件的名字和远程目录的名字拼接在一起