| | |
| | | public static final String FILE_BASE = "filebase"; |
| | | public static final String DATENABLAGE = "datenAblage"; |
| | | public static final String WBX_FILE_BASE = "wbxFileBase"; |
| | | public static final String WBX_DATA_DIR = "wbx.data"; |
| | | public static final String WBX_DEPTH = "tiefe"; |
| | | public static final String WBX_DATA_FOLDER = "datenOrdner"; |
| | | |
| | | /** |
| | | * Die Dateiablage wird entweder auf einen absoluten Pfad gesetzt, |
| | |
| | | |
| | | //File wbxDaten = getDataDir(ctx, 2, "data/"); |
| | | |
| | | WbxUtils wu = new WbxUtils(); |
| | | Object o = wu.getJNDIParameter(WBX_FILE_BASE, WbxUtils.EMPTY_STRING); |
| | | //WbxUtils wu = new WbxUtils(); |
| | | //Object o = wu.getJNDIParameter(WBX_FILE_BASE, WbxUtils.EMPTY_STRING); |
| | | String dir = System.getProperty(WBX_DATA_DIR); |
| | | try { |
| | | if(o instanceof String) { |
| | | String pfad = o.toString(); |
| | | if(pfad.trim().length() > 0) { |
| | | ctx.setAttribute(FILE_BASE, pfad); |
| | | logger.log(Level.INFO, "Daten-Ordner aus wbxFileBase: {0}", pfad); |
| | | if(dir != null) { |
| | | //String pfad = o.toString(); |
| | | if(dir.trim().length() > 0) { |
| | | ctx.setAttribute(FILE_BASE, dir); |
| | | logger.log(Level.INFO, "Daten-Ordner aus wbx.data: {0}", dir); |
| | | } else { |
| | | ctx.setAttribute(FILE_BASE, getDataDir(ctx, 2, "data/").getAbsolutePath()); |
| | | ctx.setAttribute(FILE_BASE, getDefaultDataDir(ctx).getAbsolutePath()); |
| | | } |
| | | } else { |
| | | ctx.setAttribute(FILE_BASE, getDataDir(ctx, 2, "data/").getAbsolutePath()); |
| | | ctx.setAttribute(FILE_BASE, getDefaultDataDir(ctx).getAbsolutePath()); |
| | | } |
| | | } catch(Exception ex) { |
| | | ctx.setAttribute(FILE_BASE, getDataDir(ctx, 2, "data/").getAbsolutePath()); |
| | | ctx.setAttribute(FILE_BASE, getDefaultDataDir(ctx).getAbsolutePath()); |
| | | } |
| | | } |
| | | |
| | | private File getDefaultDataDir(ServletContext ctx) { |
| | | String tiefe = ctx.getInitParameter(WBX_DEPTH); |
| | | String ordnerName = ctx.getInitParameter(WBX_DATA_FOLDER); |
| | | return getDataDir(ctx, Integer.parseInt(tiefe), ordnerName); |
| | | } |
| | | |
| | | /** |
| | | * Daten-Ordner relativ zum Ablageort des file-cms finden. |
| | | * |