import org.kie.api.io.KieResources; import org.kie.commons.io.IOService; import org.kie.commons.io.impl.IOServiceDotFileImpl; import org.kie.commons.java.nio.file.StandardCopyOption; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; public class FileCopyExample { public static void main(String[] args) { String sourceFile = "path/to/source/file.txt"; String targetFile = "path/to/target/file.txt"; IOService ioService = new IOServiceDotFileImpl(); Path sourcePath = Paths.get(sourceFile); Path targetPath = Paths.get(targetFile); try { ioService.copy(sourcePath, targetPath, StandardCopyOption.REPLACE_EXISTING); } catch (Exception e) { e.printStackTrace(); } } }


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