for (int i=0; i<ignore.length;i++){ if (srcDir.getName().endsWith(ignore[i])) { return;
}
}
if (srcDir.isDirectory()) { if (!dstDir.exists()) { if (!dstDir.mkdir()) { thrownew java.io.IOException("could not create folder " + dstDir);
}
}
String[] files = srcDir.list(); for (int i=0; i< files.length; i++) {
copyDirectory(new File(srcDir, files[i]), new File(dstDir, files[i]), ignore);
}
} else { // This method is implemented in e1071 Copying a File
copyFile(srcDir, dstDir);
}
}
/** *Copiessrcfiletodstfile.Ifthedstfiledoesnotexist,itiscreated *@paramsrcthesourcefile *@paramdstthedestinationfile *@throwsjava.io.IOExceptionthrowsjava.io.IOExceptionifsomethingfails
*/ publicstaticvoid copyFile(File src, File dst) throws java.io.IOException {
InputStream in = null;
OutputStream out = null; try {
in = new FileInputStream(src); try {
out = new FileOutputStream(dst);
// Transfer bytes from in to out byte[] buf = newbyte[1024]; int len; while ((len = in.read(buf)) > 0) {
out.write(buf, 0, len);
}
} finally { if (out != null)
out.close();
}
} finally { if (in != null)
in.close();
}
}
publicstaticboolean cleanDir(File dir)
{ if (dir.isDirectory())
{
String[] children = dir.list(); for (int i=0; i<children.length; i++)
{ boolean success = cleanDir(new File(dir, children[i])); if (!success)
{ returnfalse;
}
}
}
// The directory is now empty so delete it return dir.delete();
}
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.11 Sekunden
(vorverarbeitet am 2026-09-28)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.