String localpsth="d:\\333\444";
(new File(localpath)).mkdirs();
public void copyFile(File source,File dest) throws IOException{
InputStream input=null;
OutputStream output=null;
try{
input=new FileInputStream(source);
output=new FileOutputStream(dest);
byte[] buf=new byte[1024];
int bytesRead;
while((bytesRead=input.read(buf))!=-1){
output.write(buf,0,bytesRead);
}
}finally{
input.close();
output.close();
}
}
public boolean deleteFile(String sPath) {
boolean flag = false;
File file = new File(sPath);
// 路径为文件且不为空则进行删除
if (file.isFile() && file.exists()) {
file.delete();
flag = true;
}
return flag;
}