public void copyFile(String fromPath, String toPath) {
        try {
            int bytesum = 0;
            int byteread = 0;
            File oldfile = new File(fromPath);            if (oldfile.exists()) {                 InputStream inStream = new FileInputStream(fromPath); 
                FileOutputStream fs = new FileOutputStream(toPath);//这句报错,说toPath拒绝访问,为啥?
                byte[] buffer = new byte[1444];                while ((byteread = inStream.read(buffer)) != -1) {
                    bytesum += byteread;
                    System.out.println(bytesum);
                    fs.write(buffer, 0, byteread);
                }                inStream.close();
                fs.close();
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
顺便说一下,toPath是File生成的文件夹,所在路径是
D:\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp2\wtpwebapps\PPP\pqal

    public static void createFolder(String folderPath) {
        try {
            File fp = new File(folderPath);            if (!fp.isDirectory()) {
                fp.mkdirs();
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
我看了一下toPath,发现属性是只读的,可是我把只读的勾去掉,过一会再看,还是只读的!高手看看,是我生成文件夹的方式不对,还是不应该生成在eclipse的workspace里???