| | |
| | | |
| | | 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; |
| | |
| | | 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 |
| | |
| | | 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"); |
| | |
| | | /* ------------- 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; |
| | | } |
| | |
| | | /* ------------- 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; |
| | | } |