/** * Resolves the path based on the relative to and the path. May return {@code null} if the service is not up. * * @param context the operation context. * @param relativeToPath the relative to path, may be {@code null}. * @param path the path to append to the relative to path or the absolute path if the relative to path is * {@code null}. * * @return the full path or {@code null} if the services were not started. */ public static String resolvePath(final OperationContext context, final String relativeToPath, final String path) { return INSTANCE.resolve(context, relativeToPath, path); }
switch (context.getProcessType()) { case DOMAIN_SERVER: { loggingConfig = FileResolver.resolvePath(context, "jboss.server.data.dir", PROPERTIES_FILE); break; loggingConfig = FileResolver.resolvePath(context, "jboss.server.config.dir", PROPERTIES_FILE);
switch (context.getProcessType()) { case DOMAIN_SERVER: { loggingConfig = FileResolver.resolvePath(context, "jboss.server.data.dir", PROPERTIES_FILE); break; loggingConfig = FileResolver.resolvePath(context, "jboss.server.config.dir", PROPERTIES_FILE); break;
/** * Resolves the path based on the relative to and the path. May return {@code null} if the service is not up. * * @param context the operation context. * @param relativeToPath the relative to path, may be {@code null}. * @param path the path to append to the relative to path or the absolute path if the relative to path is * {@code null}. * * @return the full path or {@code null} if the services were not started. */ public static String resolvePath(final OperationContext context, final String relativeToPath, final String path) { return INSTANCE.resolve(context, relativeToPath, path); }
switch (context.getProcessType()) { case DOMAIN_SERVER: { loggingConfig = FileResolver.resolvePath(context, "jboss.server.data.dir", PROPERTIES_FILE); break; loggingConfig = FileResolver.resolvePath(context, "jboss.server.config.dir", PROPERTIES_FILE); break;
/** * Resolves the path based on the relative to and the path. May return {@code null} if the service is not up. * * @param context the operation context. * @param relativeToPath the relative to path, may be {@code null}. * @param path the path to append to the relative to path or the absolute path if the relative to path is * {@code null}. * * @return the full path or {@code null} if the services were not started. */ public static String resolvePath(final OperationContext context, final String relativeToPath, final String path) { return INSTANCE.resolve(context, relativeToPath, path); }
@Override public String resolveValue(final OperationContext context, final ModelNode value) throws OperationFailedException { final ModelNode pathNode = PATH.resolveModelAttribute(context, value); final ModelNode relativeToNode = RELATIVE_TO.resolveModelAttribute(context, value); String path = pathNode.asString(); String result = path; if (relativeToNode.isDefined()) { result = resolve(context, relativeToNode.asString(), path); } if (result == null) { throw new IllegalStateException(LoggingLogger.ROOT_LOGGER.pathManagerServiceNotStarted()); } final Path file = Paths.get(result); if (Files.exists(file) && Files.isDirectory(file)) { throw LoggingLogger.ROOT_LOGGER.invalidLogFile(file.normalize().toString()); } return result; }
@Override public String resolveValue(final OperationContext context, final ModelNode value) throws OperationFailedException { final ModelNode pathNode = PATH.resolveModelAttribute(context, value); final ModelNode relativeToNode = RELATIVE_TO.resolveModelAttribute(context, value); String path = pathNode.asString(); String result = path; if (relativeToNode.isDefined()) { result = resolve(context, relativeToNode.asString(), path); } if (result == null) { throw new IllegalStateException(LoggingLogger.ROOT_LOGGER.pathManagerServiceNotStarted()); } final Path file = Paths.get(result); if (Files.exists(file) && Files.isDirectory(file)) { throw LoggingLogger.ROOT_LOGGER.invalidLogFile(file.normalize().toString()); } return result; }
@Override public String resolveValue(final OperationContext context, final ModelNode value) throws OperationFailedException { final ModelNode pathNode = PATH.resolveModelAttribute(context, value); final ModelNode relativeToNode = RELATIVE_TO.resolveModelAttribute(context, value); String path = pathNode.asString(); String result = path; if (relativeToNode.isDefined()) { result = resolve(context, relativeToNode.asString(), path); } if (result == null) { throw LoggingMessages.MESSAGES.pathManagerServiceNotStarted(); } return result; }