Tips&Tricks | I trucchi del mestiere |
![]() |
Come creare una directory |
StringTokenizer tokenDirectory = new StringTokenizer(percorsoCompleto, "\\"); StringBuffer stringaSottoDirectory = new StringBuffer(""); while(tokenDirectory.hasMoreElements()) { stringaSottoDirectory.append(tokenDirectory.nextToken()).append("\\"); File sottoDirectory = new File(stringaSottoDirectory.toString()); if(!sottoDirectory.exists()) { sottoDirectory.mkdir(); } } |