From 9159275f8efe97da69e138ef3378931181447370 Mon Sep 17 00:00:00 2001 From: ulrich <not disclosed> Date: Sat, 18 Feb 2017 16:04:10 +0000 Subject: [PATCH] Textdatei speichern implementiert --- src/java/de/uhilger/filecms/api/FileMgr.java | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/src/java/de/uhilger/filecms/api/FileMgr.java b/src/java/de/uhilger/filecms/api/FileMgr.java index 31e1ac1..d39ab79 100644 --- a/src/java/de/uhilger/filecms/api/FileMgr.java +++ b/src/java/de/uhilger/filecms/api/FileMgr.java @@ -102,12 +102,13 @@ File saveDir = new File(userDir, relPath); File targetFile = new File(saveDir, fileName); if(!targetFile.exists()) { - targetFile.mkdirs(); + targetFile.getParentFile().mkdirs(); targetFile.createNewFile(); FileWriter w = new FileWriter(targetFile); w.write(contents); w.flush(); w.close(); + savedFile = new FileRef(targetFile.getAbsolutePath(), targetFile.isDirectory(), targetFile.isHidden(), targetFile.lastModified(), targetFile.length()); } } } catch (IOException ex) { -- Gitblit v1.9.3