Package de.willuhn.io
Class FileCopy
- java.lang.Object
-
- de.willuhn.io.FileCopy
-
public class FileCopy extends java.lang.ObjectZum Dateien kopieren.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFileCopy.FileExistsExceptionWird geworfen, wenn eine Datei ueberschrieben werden soll, die bereits existiert.
-
Constructor Summary
Constructors Constructor Description FileCopy()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidcopy(java.io.File from, java.io.File to, boolean force)Kopiert die Quell-Datei zur Ziel-Datei.
-
-
-
Method Detail
-
copy
public static void copy(java.io.File from, java.io.File to, boolean force) throws java.io.IOException, FileCopy.FileExistsExceptionKopiert die Quell-Datei zur Ziel-Datei. Wenn es sich beim Ziel um ein Verzeichnis handelt, wird die Quell- Datei in dieses Verzeichnis kopiert. Handelt es sich bei dem Ziel um eine Datei, wird sie gegen die Quelle ersetzt bzw. neu erstellt.- Parameters:
from- Quelle.to- Ziel.force- Ohne Warnung ueberschreiben, falls die Zieldatei bereits existiert.- Throws:
java.io.IOException- Wenn beim Kopieren ein Fehler auftratFileCopy.FileExistsException- wenn die Zieldatei existiert undforcefalse ist.
-
-