import org.codehaus.plexus.util.FileUtils; public class FileCopyExample { public static void main(String[] args) { String sourceFilePath = "path/to/source/file.txt"; String destinationFilePath = "path/to/destination/file.txt"; try { FileUtils.copyFile(sourceFilePath, destinationFilePath); System.out.println("File copied successfully!"); } catch (IOException e) { e.printStackTrace(); } } } <dependency> <groupId>org.codehaus.plexus</groupId> <artifactId>plexus-io</artifactId> <version>2.0.10</version> </dependency>


上一篇:
下一篇:
切换中文