java - Create a folder from text contents -
i think challenging , interesting too. have att.txt contents /enumeration/unassigned.gif,/enumeration/unassigned2.gif,/workflow/close.gif, /workflow/defer.gif,/workitemtype/bug.gif,/workitemtype/enhancement.gif.now, need create new folder called attachment inside need sub folders enumeration contains enumeration gif, workflow folder contains workflow gif , same workitem.how can create in java. please me struggling here lot.
see if helps. didn't got here below code create subdirectories you.
public class main { public static void main(string[] args) throws java.lang.exception { java.io.bufferedreader br = new java.io.bufferedreader( new filereader("att.txt")); string scurrentline=""; while ((scurrentline = br.readline()) != null) { scurrentline= scurrentline.replaceall("gif", "txt"); string[] s = scurrentline.split(","); for(int i=0;i<s.length;i++){ new file("attachment/"+s[i]).mkdirs(); system.out.println("folder created"); } } } }
Comments
Post a Comment