From 74fab1c53fd3850bf0fd075c93622f14ad8dbe30 Mon Sep 17 00:00:00 2001 From: ulrich Date: Wed, 06 Jan 2021 23:03:51 +0000 Subject: [PATCH] null pruefung hinzugefuegt --- src/java/de/uhilger/filecms/api/Api.java | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/src/java/de/uhilger/filecms/api/Api.java b/src/java/de/uhilger/filecms/api/Api.java index c29311b..b26537e 100644 --- a/src/java/de/uhilger/filecms/api/Api.java +++ b/src/java/de/uhilger/filecms/api/Api.java @@ -22,6 +22,7 @@ import de.uhilger.filecms.data.FileRef; import de.uhilger.filecms.web.Initialiser; +import de.uhilger.transit.Access; import de.uhilger.transit.web.RequestKontext; import de.uhilger.transit.web.WebKontext; import java.io.File; @@ -45,13 +46,18 @@ public static final String WBX_DATA_PATH = "daten/"; public static final String PUB_DIR_PATH = "www/"; public static final String HOME_DIR_PATH = "home/"; + public static final String DAV_DIR_PATH = "dav/"; + public static final String PUB_DIR_NAME = "Oeffentlich"; //public static final String HOME_DIR_NAME = "Persoenlicher Ordner"; public static final String HOME_DIR_NAME = "Persoenlich"; + public static final String DAV_DIR_NAME = "Austausch"; + public static final String WBX_ADMIN_ROLE = "wbxAdmin"; public static final String WBX_BASE = "$basis"; public static final String WBX_DATA = "$daten"; + public static final String DAV_DATA = "$dav"; /** * Einen relativen Pfad in einen absoluten Pfad der WebBox @@ -76,6 +82,9 @@ targetDir = new File(getBase().getAbsolutePath(), targetPath); } else if(relPath.startsWith(HOME_DIR_NAME)) { targetPath = HOME_DIR_PATH + getUserName() + relPath.substring(HOME_DIR_NAME.length()); + targetDir = new File(getBase().getAbsolutePath(), targetPath); + } else if(relPath.startsWith(DAV_DIR_NAME)) { + targetPath = DAV_DIR_PATH + /* getUserName() +*/ relPath.substring(DAV_DIR_NAME.length()); targetDir = new File(getBase().getAbsolutePath(), targetPath); } else if(getRequest().isUserInRole(WBX_ADMIN_ROLE)) { logger.fine("in admin role"); @@ -182,11 +191,13 @@ /* ------------- Implementierung WebKontext ------------- */ @Override + @Access(type = Access.Type.RESTRICT) public ServletContext getServletContext() { return ctx; } @Override + @Access(type = Access.Type.RESTRICT) public void setServletContext(ServletContext servletContext) { this.ctx = servletContext; } @@ -194,11 +205,13 @@ /* ------------- Implementierung RequestKontext ------------- */ @Override + @Access(type = Access.Type.RESTRICT) public HttpServletRequest getRequest() { return request; } @Override + @Access(type = Access.Type.RESTRICT) public void setRequest(HttpServletRequest r) { this.request = r; } -- Gitblit v1.9.3