java文件操作报错:java.io.FileNotFoundException:D..(拒绝访问)

  	import java.io.*;
    
    /**
 	 * @Description: 复制文件,从一个输入流中读取数据,然后通过输出流写入目标位置,一边读一边写
 	 * @ClassName: CopyFile
 	 * @Version: V1.0
 	 */
    public class CopyFile {
    	private static void copy(String src, String target) {
    		File srcFile = new File(src);
    		File targetFile = new File(target);
    		
    		InputStream in = null;
    		OutputStream out = null;
    		try {
    			in = new FileInputStream(srcFile);
    			out = new FileOutputStream(targetFile);
    
    			byte[] b = new byte[1024];
    			int len = -1;
    			while ((len = in.read(b)) != -1) {
    				out.write(b, 0, len);
    			}
    		} catch (FileNotFoundException e) {
    			e.printStackTrace();
    		} catch (IOException e) {
    			e.printStackTrace();
    		} finally {
    			try {
    				if (in != null)
    					in.close();
    			} catch (IOException e) {
    				e.printStackTrace();
    			}
    			try {
    	

版权声明:本文为Ajekseg原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。