Apache config parser

A simple parser for Apache httpd config files

License

License

Categories

Categories

config Application Layer Libs Configuration
GroupId

GroupId

com.stackify
ArtifactId

ArtifactId

apache-config
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

Apache config parser
A simple parser for Apache httpd config files
Project URL

Project URL

https://github.com/stackify/apache-config
Project Organization

Project Organization

Stackify, LLC
Source Code Management

Source Code Management

https://github.com/stackify/apache-config

Download apache-config

How to add to project

<!-- https://jarcasting.com/artifacts/com.stackify/apache-config/ -->
<dependency>
    <groupId>com.stackify</groupId>
    <artifactId>apache-config</artifactId>
    <version>1.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.stackify/apache-config/
implementation 'com.stackify:apache-config:1.0.0'
// https://jarcasting.com/artifacts/com.stackify/apache-config/
implementation ("com.stackify:apache-config:1.0.0")
'com.stackify:apache-config:jar:1.0.0'
<dependency org="com.stackify" name="apache-config" rev="1.0.0">
  <artifact name="apache-config" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.stackify', module='apache-config', version='1.0.0')
)
libraryDependencies += "com.stackify" % "apache-config" % "1.0.0"
[com.stackify/apache-config "1.0.0"]

Dependencies

test (1)

Group / Artifact Type Version
junit : junit jar 4.11

Project Modules

There are no modules declared in this project.

apache-config

A simple config parser for Apache HTTP Server config files.

Usage

The parser builds a tree of apache configuration. So, for example, if you wanted to find all of the virtual hosts you could do the following.

InputStream inputStream = new FileInputStream(new File("/etc/httpd/conf/httpd.conf"));

ApacheConfigParser parser = new ApacheConfigParser();
ConfigNode config = parser.parse(inputStream);

for (ConfigNode child : config.getChildren()) {
	if (child.getName().equals("VirtualHost")) {
    	System.out.println(child.getContent());
    }
}

License

Copyright 2013 Stackify, LLC.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
com.stackify

Stackify

Stackify helps developers manage and troubleshoot application problems with integrated monitoring, metrics, errors & logs.

Versions

Version
1.0.0