diff --git a/src/main/java/cmd/commands/mkf/MakeFile.java b/src/main/java/cmd/commands/mkf/MakeFile.java new file mode 100644 index 0000000..6314318 --- /dev/null +++ b/src/main/java/cmd/commands/mkf/MakeFile.java @@ -0,0 +1,28 @@ +package cmd.commands.mkf; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import picocli.CommandLine.Parameters; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; + +public class MakeFile implements Runnable { + + private static final Logger LOG = LoggerFactory.getLogger(MakeFile.class); + + @Parameters(index = "0", description = "path of the file to copy") + private File file; + + + @Override + public void run() { + + try { + Files.createFile(file.toPath()); + } catch (IOException e) { + LOG.info("Datei existiert bereits."); + } + } +}