URL url = new URL(taxVerifyCodeImageUrl);//taxVerifyCodeImageUrl是网址变量
//打开网络输入流
DataInputStream dis = new DataInputStream(url.openStream());
String relativeVerifyPath = "VerifyImages/"+DateTimeUtil.getCurrentDate()+"/"+custId+"/";
//构造图片保存目录
String VerifyParentDir = contextPath + relativeVerifyPath;
logger.info("验证码保存目录:" + VerifyParentDir);
String s = UUID.randomUUID().toString();
//去掉“-”符号
String a = s.substring(0,8)+s.substring(9,13)+s.substring(14,18)+s.substring(19,23)+s.substring(24);
String newImageName= "VerifyParentDir/a.jpg";//主要是这句,怎么把路径变量和随机生成的uuid(文件名)组合起来变成保存文件的路径???
//建立一个新的文件
FileOutputStream fos = new FileOutputStream(new File(newImageName));
byte[] buffer = new byte[1024];
int length;
//开始填充数据
while((length = dis.read(buffer))>0){
fos.write(buffer,0,length);
}
求各位大神指导