@Override public void start(StartContext startContext) { String relativeToPath = AbsolutePathService.isAbsoluteUnixOrWindowsPath(path) ? null : relativeTo; String dirPath = pathManager.get().resolveRelativePathEntry(path, relativeToPath); File dir = new File(dirPath); MicroProfileConfigLogger.ROOT_LOGGER.loadConfigSourceFromDir(dir.getAbsolutePath()); configSource = new DirConfigSource(dir, ordinal); }
String resolve(PathManager pathManager, String path, String relativeToPath) { // discard the relativeToPath if the path is absolute and must not be resolved according // to the default relativeToPath value String relativeTo = AbsolutePathService.isAbsoluteUnixOrWindowsPath(path) ? null : relativeToPath; return pathManager.resolveRelativePathEntry(path, relativeTo); }
String resolve(PathManager pathManager, String path, String relativeToPath) { // discard the relativeToPath if the path is absolute and must not be resolved according // to the default relativeToPath value String relativeTo = AbsolutePathService.isAbsoluteUnixOrWindowsPath(path) ? null : relativeToPath; return pathManager.resolveRelativePathEntry(path, relativeTo); }
@Override public void start(StartContext startContext) { String relativeToPath = AbsolutePathService.isAbsoluteUnixOrWindowsPath(path) ? null : relativeTo; String dirPath = pathManager.get().resolveRelativePathEntry(path, relativeToPath); File dir = new File(dirPath); MicroProfileConfigLogger.ROOT_LOGGER.loadConfigSourceFromDir(dir.getAbsolutePath()); configSource = new DirConfigSource(dir, ordinal); }
private static String resolvePath(OperationContext context, PathManager pathManager, PathElement pathElement) throws OperationFailedException { Resource serverResource = context.readResource(EMPTY_ADDRESS); // if the path resource does not exist, resolve its attributes against an empty ModelNode to get its default values final ModelNode model = serverResource.hasChild(pathElement) ? serverResource.getChild(pathElement).getModel() : new ModelNode(); final String path = PathDefinition.PATHS.get(pathElement.getValue()).resolveModelAttribute(context, model).asString(); final String relativeToPath = PathDefinition.RELATIVE_TO.resolveModelAttribute(context, model).asString(); final String relativeTo = AbsolutePathService.isAbsoluteUnixOrWindowsPath(path) ? null : relativeToPath; return pathManager.resolveRelativePathEntry(path, relativeTo); }
private static String resolvePath(OperationContext context, PathManager pathManager, PathElement pathElement) throws OperationFailedException { Resource serverResource = context.readResource(EMPTY_ADDRESS); // if the path resource does not exist, resolve its attributes against an empty ModelNode to get its default values final ModelNode model = serverResource.hasChild(pathElement) ? serverResource.getChild(pathElement).getModel() : new ModelNode(); final String path = PathDefinition.PATHS.get(pathElement.getValue()).resolveModelAttribute(context, model).asString(); final String relativeToPath = PathDefinition.RELATIVE_TO.resolveModelAttribute(context, model).asString(); final String relativeTo = AbsolutePathService.isAbsoluteUnixOrWindowsPath(path) ? null : relativeToPath; return pathManager.resolveRelativePathEntry(path, relativeTo); }
&& AbsolutePathService.isAbsoluteUnixOrWindowsPath(path.asString())) { result = pathManager.resolveRelativePathEntry(path.asString(), null); } else if (relativeTo.isDefined()) {
&& AbsolutePathService.isAbsoluteUnixOrWindowsPath(path.asString())) { result = pathManager.resolveRelativePathEntry(path.asString(), null); } else if (relativeTo.isDefined()) {