I am making a small project there is a one module, which is KYC update and In this module i am save AadharCard,PAN Card and Other documents in Folder.So I am using java IO and try to create directory which name is Document and i want to create a sub-directory with user name and for create unique a also append username,id concat.I write a code but the sub-directory didn't crate. My code is
String uploadPath = context.getRealPath("") + "assets" + File.separator + "Document" + File.separator
+ userPojo.getFirstName();
File file = new File(uploadPath);
try {
if (!file.exists()) {
file.mkdirs();
logger.debug("Make Dir");
}
and I also try this
File file = new File(dir, userPojo.getUserName());
if (!file.exists()) {
file.mkdirs();
logger.debug("Make Dir");
}