I am currently creating a directory based on file names and then moving files to new directories. At the moment, I am creating new directories using the following code:
String filename = filesInFolder.get(i).toString();
File fullPathFile = new File(filename.replaceAll("(\\w+)_(\\d+).*", "$1/$2/$0"));
fullPathFile.getParentFile().mkdirs();
Then I try to use InputStreamand OutputStreamto move files to new directories, the code seems to be fine, but when I create new directories, all folders matter read-only, so I can not move files to known directories
So, is there a way to set folders read-writewhen creating them?
source
share