├── src
├── media
│ ├── logo.png
│ ├── commons-logo-component.xcf
│ └── commons-logo-component-100.xcf
├── site
│ └── resources
│ │ ├── images
│ │ └── logo.png
│ │ ├── download_configuration.cgi
│ │ ├── profile.japicmp
│ │ └── profile.jacoco
├── test
│ ├── resources
│ │ ├── testEncoding.xml
│ │ ├── testChildNamespace.xml
│ │ ├── testRootNamespace.xml
│ │ ├── org
│ │ │ └── apache
│ │ │ │ └── commons
│ │ │ │ └── configuration2
│ │ │ │ └── test.jar
│ │ ├── test.yaml
│ │ ├── test.json
│ │ ├── config
│ │ │ ├── deep
│ │ │ │ ├── test.properties
│ │ │ │ ├── deepinclude.properties
│ │ │ │ ├── deeptest.properties
│ │ │ │ ├── deeptestinvalid.properties
│ │ │ │ ├── testEqualDeep.properties
│ │ │ │ └── testFileFromClasspath.xml
│ │ │ ├── testMultiInclude.properties
│ │ │ └── test.properties
│ │ ├── includeoptional-target.properties
│ │ ├── testConfigurationFactoryBean.file
│ │ ├── configB.xml
│ │ ├── include-interpol.properties
│ │ ├── resolver.dtd
│ │ ├── configA.xml
│ │ ├── include-include-not-found.properties
│ │ ├── include.properties
│ │ ├── include-not-found.properties
│ │ ├── test.ini
│ │ ├── include-cyclical-root.properties
│ │ ├── include-load-exception.properties
│ │ ├── include-cyclical-back-to-root.properties
│ │ ├── include-cyclical-step.properties
│ │ ├── include-cyclical-reference.properties
│ │ ├── include-include-cyclical-reference.properties
│ │ ├── includeoptional.properties
│ │ ├── test-configuration-848.json
│ │ ├── jndi.properties
│ │ ├── testEqualDigester.xml
│ │ ├── testSequenceDigester.xml
│ │ ├── testResolver.xml
│ │ ├── testDigesterConfigurationWithProps.xml
│ │ ├── testDigesterConfigurationOverwrite.properties
│ │ ├── testEqual.properties
│ │ ├── testDigesterConfigurationReverseOrder.xml
│ │ ├── testDigesterConfigurationBasePath.xml
│ │ ├── threesome.properties
│ │ ├── testDigesterConfigurationInclude2.properties
│ │ ├── testCCSystemProperties.xml
│ │ ├── testCCEnvProperties.xml
│ │ ├── testDigesterConfigurationSysProps.xml
│ │ ├── testDigesterConfiguration.xml
│ │ ├── testDigesterConfigurationNamespaceAware.xml
│ │ ├── testSequence.properties
│ │ ├── testMultiConfiguration_1004.xml
│ │ ├── testDtd.xml
│ │ ├── test.properties.xml
│ │ ├── testInterpolation.properties
│ │ ├── sample_1001.xml
│ │ ├── testCCReloadingNested.xml
│ │ ├── testDigesterBadXML.xml
│ │ ├── testDtdPublic.xml
│ │ ├── testDigesterCreateObject.xml
│ │ ├── testFactoryPropertiesInclude.xml
│ │ ├── catalog.xml
│ │ ├── test_invalid_date.plist.xml
│ │ ├── testCCReloading.xml
│ │ ├── testDigesterOptionalConfigurationEx.xml
│ │ ├── testCCFileSystem.xml
│ │ ├── catalog2.xml
│ │ ├── testCCEntityResolver.xml
│ │ ├── testInterpolation.xml
│ │ ├── sample.xml
│ │ ├── testMultiConfiguration_2001.xml
│ │ ├── testCCCustomProvider.xml
│ │ ├── testMultiConfiguration_1002.xml
│ │ ├── testMultiConfiguration_1003.xml
│ │ ├── testConfigurationXMLDocument.xml
│ │ ├── test2.plist.xml
│ │ ├── testCCCombinedChildBuilder.xml
│ │ ├── testDigesterConfiguration3.xml
│ │ ├── log4j-test.xml
│ │ ├── testCCFileSystemSubConfig.xml
│ │ ├── testCCResultClass.xml
│ │ ├── testDigesterConfiguration2.xml
│ │ ├── testMultiConfiguration_3002.xml
│ │ ├── testCCMultiTenentReloading.xml
│ │ ├── testMultiConfiguration_2002.xml
│ │ ├── testInterpolationBuilder.xml
│ │ ├── testMultiConfiguration_1001.xml
│ │ ├── 01
│ │ │ └── testMultiConfiguration_1001.xml
│ │ ├── testValidateValid.xml
│ │ ├── testValidation.xml
│ │ ├── testDigesterOptionalConfiguration.xml
│ │ ├── testSystemProperties.xml
│ │ ├── testCCLookup.xml
│ │ ├── testValidation2.xml
│ │ ├── testMultiConfiguration_3001.xml
│ │ ├── testHierarchicalXMLConfiguration2.xml
│ │ ├── test2.properties
│ │ ├── testValidateInvalid.xml
│ │ ├── testDigesterConfigurationInclude1.xml
│ │ ├── test.plist
│ │ ├── sample.xsd
│ │ └── testClasspath.properties
│ └── java
│ │ └── org
│ │ └── apache
│ │ └── commons
│ │ └── configuration2
│ │ ├── EnumFixture.java
│ │ ├── event
│ │ ├── TestXMLConfigurationEvents.java
│ │ ├── TestMapConfigurationEvents.java
│ │ ├── TestPropertiesConfigurationEvents.java
│ │ ├── TestSubsetConfigurationEvents.java
│ │ └── TestEventType.java
│ │ ├── interpol
│ │ └── TestDummyLookup.java
│ │ ├── tree
│ │ └── TestTreeData.java
│ │ ├── reloading
│ │ ├── RandomReloadingDetector.java
│ │ └── AlwaysReloadingDetector.java
│ │ ├── TestPatternSubtreeConfigurationWrapper.java
│ │ ├── beanutils
│ │ ├── BeanCreationTestCtorBean.java
│ │ ├── TestConfigurationDynaBeanXMLConfig.java
│ │ └── BeanCreationTestBean.java
│ │ ├── TestNonStringProperties.java
│ │ └── TestEqualsProperty.java
├── conf
│ ├── cpd-exclusions.txt
│ └── HEADER.txt
└── main
│ ├── java
│ └── org
│ │ └── apache
│ │ └── commons
│ │ └── configuration2
│ │ ├── resolver
│ │ ├── package-info.java
│ │ └── EntityResolverSupport.java
│ │ ├── spring
│ │ └── package-info.java
│ │ ├── tree
│ │ ├── package-info.java
│ │ ├── xpath
│ │ │ └── package-info.java
│ │ ├── NodeModelSupport.java
│ │ └── InMemoryNodeModelSupport.java
│ │ ├── plist
│ │ └── package-info.java
│ │ ├── interpol
│ │ ├── package-info.java
│ │ ├── StringLookupAdapter.java
│ │ └── DummyLookup.java
│ │ ├── event
│ │ └── package-info.java
│ │ ├── web
│ │ └── package-info.java
│ │ ├── reloading
│ │ ├── ManagedReloadingDetectorMBean.java
│ │ ├── package-info.java
│ │ └── ReloadingControllerSupport.java
│ │ ├── package-info.java
│ │ ├── io
│ │ ├── VerifiableOutputStream.java
│ │ └── package-info.java
│ │ ├── ex
│ │ └── package-info.java
│ │ ├── beanutils
│ │ └── package-info.java
│ │ ├── ConfigurationComparator.java
│ │ ├── FileBasedConfiguration.java
│ │ ├── ConfigurationConsumer.java
│ │ ├── sync
│ │ └── package-info.java
│ │ ├── builder
│ │ ├── fluent
│ │ │ ├── JndiBuilderParameters.java
│ │ │ ├── DatabaseBuilderParameters.java
│ │ │ ├── CombinedBuilderParameters.java
│ │ │ ├── FileBasedBuilderParameters.java
│ │ │ └── MultiFileBuilderParameters.java
│ │ └── combined
│ │ │ └── package-info.java
│ │ └── convert
│ │ └── package-info.java
│ ├── resources
│ └── properties.dtd
│ └── assembly
│ ├── src.xml
│ └── bin.xml
├── NOTICE.txt
├── .gitignore
├── SECURITY.md
├── CODE_OF_CONDUCT.md
├── .github
├── GH-ROBOTS.txt
├── dependabot.yml
└── workflows
│ ├── dependency-review.yml
│ └── maven.yml
└── .asf.yaml
/src/media/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/commons-configuration/HEAD/src/media/logo.png
--------------------------------------------------------------------------------
/src/site/resources/images/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/commons-configuration/HEAD/src/site/resources/images/logo.png
--------------------------------------------------------------------------------
/src/media/commons-logo-component.xcf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/commons-configuration/HEAD/src/media/commons-logo-component.xcf
--------------------------------------------------------------------------------
/src/test/resources/testEncoding.xml:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/commons-configuration/HEAD/src/test/resources/testEncoding.xml
--------------------------------------------------------------------------------
/src/media/commons-logo-component-100.xcf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/commons-configuration/HEAD/src/media/commons-logo-component-100.xcf
--------------------------------------------------------------------------------
/src/test/resources/testChildNamespace.xml:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/commons-configuration/HEAD/src/test/resources/testChildNamespace.xml
--------------------------------------------------------------------------------
/src/test/resources/testRootNamespace.xml:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/commons-configuration/HEAD/src/test/resources/testRootNamespace.xml
--------------------------------------------------------------------------------
/src/conf/cpd-exclusions.txt:
--------------------------------------------------------------------------------
1 | org.apache.commons.configuration2.web.JakartaServletRequestConfiguration,org.apache.commons.configuration2.web.ServletRequestConfiguration
2 |
--------------------------------------------------------------------------------
/src/test/resources/org/apache/commons/configuration2/test.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/commons-configuration/HEAD/src/test/resources/org/apache/commons/configuration2/test.jar
--------------------------------------------------------------------------------
/NOTICE.txt:
--------------------------------------------------------------------------------
1 | Apache Commons Configuration
2 | Copyright 2001-2025 The Apache Software Foundation
3 |
4 | This product includes software developed at
5 | The Apache Software Foundation (https://www.apache.org/).
6 |
--------------------------------------------------------------------------------
/src/site/resources/download_configuration.cgi:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | # Just call the standard mirrors.cgi script. It will use download.html
3 | # as the input template.
4 | exec /www/www.apache.org/dyn/mirrors/mirrors.cgi $*
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Maven build files
2 | target
3 | *.log
4 | maven-eclipse.xml
5 | build.properties
6 | site-content
7 | *~
8 |
9 | # IntelliJ IDEA files
10 | .idea
11 | .iws
12 | *.iml
13 | *.ipr
14 |
15 | # Eclipse files
16 | .settings
17 | .classpath
18 | .project
19 | .externalToolBuilders
20 | .checkstyle
21 |
22 | # NetBeans files
23 | nb-configuration.xml
24 | nbactions.xml
25 |
--------------------------------------------------------------------------------
/src/test/resources/test.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | key1:
3 | value1
4 |
5 | key2:
6 | key3: value23
7 |
8 | key4:
9 | key5:
10 | - col1
11 | - col2
12 |
13 | very:
14 | nested:
15 | properties:
16 | - nested1
17 | - nested2
18 | - nested3
19 |
20 | int1:
21 | 37
22 |
23 | martin:
24 | name: Martin D'vloper
25 | job: Developer
26 | skill: Elite
27 |
28 | key5:
29 | example: [ '', '', value]
--------------------------------------------------------------------------------
/src/test/resources/test.json:
--------------------------------------------------------------------------------
1 | {
2 | "key1": "value1",
3 | "key2": {
4 | "key3": "value23"
5 | },
6 | "key4": {
7 | "key5": [
8 | "col1",
9 | "col2"
10 | ]
11 | },
12 | "very": {
13 | "nested": {
14 | "properties": [
15 | "nested1",
16 | "nested2",
17 | "nested3"
18 | ]
19 | }
20 | },
21 | "int1": 37,
22 | "martin": {
23 | "name": "Martin D'vloper",
24 | "job": "Developer",
25 | "skill": "Elite"
26 | },
27 | "capitals": [
28 | {
29 | "country": "USA",
30 | "capital": "Washington"
31 | },
32 | {
33 | "country": "UK",
34 | "capital": "London"
35 | }
36 | ]
37 | }
38 |
--------------------------------------------------------------------------------
/src/conf/HEADER.txt:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * https://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
--------------------------------------------------------------------------------
/src/test/resources/config/deep/test.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one or more
2 | # contributor license agreements. See the NOTICE file distributed with
3 | # this work for additional information regarding copyright ownership.
4 | # The ASF licenses this file to You under the Apache License, Version 2.0
5 | # (the "License"); you may not use this file except in compliance with
6 | # the License. You may obtain a copy of the License at
7 | #
8 | # https://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 | somekey=somevalue
--------------------------------------------------------------------------------
/src/test/resources/config/deep/deepinclude.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one or more
2 | # contributor license agreements. See the NOTICE file distributed with
3 | # this work for additional information regarding copyright ownership.
4 | # The ASF licenses this file to You under the Apache License, Version 2.0
5 | # (the "License"); you may not use this file except in compliance with
6 | # the License. You may obtain a copy of the License at
7 | #
8 | # https://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 | deepinclude=true
16 |
--------------------------------------------------------------------------------
/src/test/resources/includeoptional-target.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one or more
2 | # contributor license agreements. See the NOTICE file distributed with
3 | # this work for additional information regarding copyright ownership.
4 | # The ASF licenses this file to You under the Apache License, Version 2.0
5 | # (the "License"); you may not use this file except in compliance with
6 | # the License. You may obtain a copy of the License at
7 | #
8 | # https://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 | includeoptional.loaded = true
16 |
--------------------------------------------------------------------------------
/src/test/resources/testConfigurationFactoryBean.file:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one or more
2 | # contributor license agreements. See the NOTICE file distributed with
3 | # this work for additional information regarding copyright ownership.
4 | # The ASF licenses this file to You under the Apache License, Version 2.0
5 | # (the "License"); you may not use this file except in compliance with
6 | # the License. You may obtain a copy of the License at
7 | #
8 | # https://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 | robin=hood
17 | java=duke
18 |
--------------------------------------------------------------------------------
/src/test/resources/configB.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 | test
19 |
--------------------------------------------------------------------------------
/src/test/resources/include-interpol.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one or more
2 | # contributor license agreements. See the NOTICE file distributed with
3 | # this work for additional information regarding copyright ownership.
4 | # The ASF licenses this file to You under the Apache License, Version 2.0
5 | # (the "License"); you may not use this file except in compliance with
6 | # the License. You may obtain a copy of the License at
7 | #
8 | # https://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 | include.interpol.loaded = true
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/src/test/resources/resolver.dtd:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/src/test/resources/config/deep/deeptest.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one or more
2 | # contributor license agreements. See the NOTICE file distributed with
3 | # this work for additional information regarding copyright ownership.
4 | # The ASF licenses this file to You under the Apache License, Version 2.0
5 | # (the "License"); you may not use this file except in compliance with
6 | # the License. You may obtain a copy of the License at
7 | #
8 | # https://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 | include=deepinclude.properties
16 |
17 | deeptest=true
18 |
--------------------------------------------------------------------------------
/SECURITY.md:
--------------------------------------------------------------------------------
1 |
17 | The Apache Commons security page is [https://commons.apache.org/security.html](https://commons.apache.org/security.html).
18 |
--------------------------------------------------------------------------------
/src/test/resources/configA.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/src/test/resources/include-include-not-found.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one or more
2 | # contributor license agreements. See the NOTICE file distributed with
3 | # this work for additional information regarding copyright ownership.
4 | # The ASF licenses this file to You under the Apache License, Version 2.0
5 | # (the "License"); you may not use this file except in compliance with
6 | # the License. You may obtain a copy of the License at
7 | #
8 | # https://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 | include = include-not-found.properties
16 | keyB = valueB
17 |
--------------------------------------------------------------------------------
/src/test/resources/include.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one or more
2 | # contributor license agreements. See the NOTICE file distributed with
3 | # this work for additional information regarding copyright ownership.
4 | # The ASF licenses this file to You under the Apache License, Version 2.0
5 | # (the "License"); you may not use this file except in compliance with
6 | # the License. You may obtain a copy of the License at
7 | #
8 | # https://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 | include.loaded = true
16 |
17 | packages = packageb, packagec
18 |
19 |
20 |
--------------------------------------------------------------------------------
/src/test/resources/include-not-found.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one or more
2 | # contributor license agreements. See the NOTICE file distributed with
3 | # this work for additional information regarding copyright ownership.
4 | # The ASF licenses this file to You under the Apache License, Version 2.0
5 | # (the "License"); you may not use this file except in compliance with
6 | # the License. You may obtain a copy of the License at
7 | #
8 | # https://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 | include = this-file-does-not-and-should-not-exist.txt
16 | keyA = valueA
17 |
--------------------------------------------------------------------------------
/src/test/resources/test.ini:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one or more
2 | # contributor license agreements. See the NOTICE file distributed with
3 | # this work for additional information regarding copyright ownership.
4 | # The ASF licenses this file to You under the Apache License, Version 2.0
5 | # (the "License"); you may not use this file except in compliance with
6 | # the License. You may obtain a copy of the License at
7 | #
8 | # https://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 | ; Test ini file to be included by a configuration definition
16 | [testini]
17 | loaded=yes
18 |
--------------------------------------------------------------------------------
/src/test/resources/include-cyclical-root.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one or more
2 | # contributor license agreements. See the NOTICE file distributed with
3 | # this work for additional information regarding copyright ownership.
4 | # The ASF licenses this file to You under the Apache License, Version 2.0
5 | # (the "License"); you may not use this file except in compliance with
6 | # the License. You may obtain a copy of the License at
7 | #
8 | # https://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 | include = src/test/resources/include-cyclical-step.properties
16 | keyA = valueA
17 |
--------------------------------------------------------------------------------
/src/test/resources/include-load-exception.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one or more
2 | # contributor license agreements. See the NOTICE file distributed with
3 | # this work for additional information regarding copyright ownership.
4 | # The ASF licenses this file to You under the Apache License, Version 2.0
5 | # (the "License"); you may not use this file except in compliance with
6 | # the License. You may obtain a copy of the License at
7 | #
8 | # https://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 | include = http://this-file-does-not-and-should-not-exist.txt
16 | keyA = valueA
17 |
--------------------------------------------------------------------------------
/src/test/resources/include-cyclical-back-to-root.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one or more
2 | # contributor license agreements. See the NOTICE file distributed with
3 | # this work for additional information regarding copyright ownership.
4 | # The ASF licenses this file to You under the Apache License, Version 2.0
5 | # (the "License"); you may not use this file except in compliance with
6 | # the License. You may obtain a copy of the License at
7 | #
8 | # https://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 | include = src/test/resources/include-cyclical-root.properties
16 | keyA = valueA
17 |
--------------------------------------------------------------------------------
/src/test/resources/include-cyclical-step.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one or more
2 | # contributor license agreements. See the NOTICE file distributed with
3 | # this work for additional information regarding copyright ownership.
4 | # The ASF licenses this file to You under the Apache License, Version 2.0
5 | # (the "License"); you may not use this file except in compliance with
6 | # the License. You may obtain a copy of the License at
7 | #
8 | # https://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 | include = src/test/resources/include-cyclical-back-to-root.properties
16 | keyA = valueA
17 |
--------------------------------------------------------------------------------
/src/test/resources/include-cyclical-reference.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one or more
2 | # contributor license agreements. See the NOTICE file distributed with
3 | # this work for additional information regarding copyright ownership.
4 | # The ASF licenses this file to You under the Apache License, Version 2.0
5 | # (the "License"); you may not use this file except in compliance with
6 | # the License. You may obtain a copy of the License at
7 | #
8 | # https://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 | include = src/test/resources/include-cyclical-reference.properties
16 | keyA = valueA
17 |
--------------------------------------------------------------------------------
/src/test/resources/config/testMultiInclude.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one or more
2 | # contributor license agreements. See the NOTICE file distributed with
3 | # this work for additional information regarding copyright ownership.
4 | # The ASF licenses this file to You under the Apache License, Version 2.0
5 | # (the "License"); you may not use this file except in compliance with
6 | # the License. You may obtain a copy of the License at
7 | #
8 | # https://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 | top = topValue
17 | include = ../include.properties
18 | include = ../testEqual.properties
19 |
--------------------------------------------------------------------------------
/src/test/resources/include-include-cyclical-reference.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one or more
2 | # contributor license agreements. See the NOTICE file distributed with
3 | # this work for additional information regarding copyright ownership.
4 | # The ASF licenses this file to You under the Apache License, Version 2.0
5 | # (the "License"); you may not use this file except in compliance with
6 | # the License. You may obtain a copy of the License at
7 | #
8 | # https://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 | include = src/test/resources/include-cyclical-reference.properties
16 | keyA = valueA
17 |
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 |
17 | The Apache code of conduct page is [https://www.apache.org/foundation/policies/conduct.html](https://www.apache.org/foundation/policies/conduct.html).
18 |
--------------------------------------------------------------------------------
/.github/GH-ROBOTS.txt:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one or more
2 | # contributor license agreements. See the NOTICE file distributed with
3 | # this work for additional information regarding copyright ownership.
4 | # The ASF licenses this file to You under the Apache License, Version 2.0
5 | # (the "License"); you may not use this file except in compliance with
6 | # the License. You may obtain a copy of the License at
7 | #
8 | # https://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 | # Keeps on creating FUD PRs in test code
17 | # Does not follow Apache disclosure policies
18 | User-agent: JLLeitschuh/security-research
19 | Disallow: *
20 |
--------------------------------------------------------------------------------
/src/test/resources/includeoptional.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one or more
2 | # contributor license agreements. See the NOTICE file distributed with
3 | # this work for additional information regarding copyright ownership.
4 | # The ASF licenses this file to You under the Apache License, Version 2.0
5 | # (the "License"); you may not use this file except in compliance with
6 | # the License. You may obtain a copy of the License at
7 | #
8 | # https://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 | includeoptional = this-file-does-not-and-should-not-exist.txt
16 | includeoptional = includeoptional-target.properties
17 |
--------------------------------------------------------------------------------
/src/test/resources/test-configuration-848.json:
--------------------------------------------------------------------------------
1 | {
2 | "key1": "value1",
3 | "key2": {
4 | "key3": "value23"
5 | },
6 | "key4": {
7 | "key5": [
8 | "col1",
9 | "col2"
10 | ]
11 | },
12 | "very": {
13 | "nested": {
14 | "properties": [
15 | "nested1",
16 | "nested2",
17 | "nested3"
18 | ]
19 | }
20 | },
21 | "int1": 37,
22 | "martin": {
23 | "name": "Martin D'vloper",
24 | "job": "Developer",
25 | "skill": "Elite"
26 | },
27 | "capitals": [
28 | {
29 | "country": "USA",
30 | "capital": "Washington"
31 | },
32 | {
33 | "country": "UK",
34 | "capital": "London"
35 | }
36 | ],
37 | "books": [
38 | {
39 | "details": {
40 | "title": "No Longer Human",
41 | "author": "Osamu Dazai"
42 | }
43 | },
44 | {
45 | "details": {
46 | "title": "White Nights",
47 | "author": "Fyodor Dostoevsky"
48 | }
49 | }
50 | ]
51 | }
52 |
--------------------------------------------------------------------------------
/src/test/resources/config/deep/deeptestinvalid.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one or more
2 | # contributor license agreements. See the NOTICE file distributed with
3 | # this work for additional information regarding copyright ownership.
4 | # The ASF licenses this file to You under the Apache License, Version 2.0
5 | # (the "License"); you may not use this file except in compliance with
6 | # the License. You may obtain a copy of the License at
7 | #
8 | # https://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 | # Tries to include a non existing file
17 | include=nonexisting.properties
18 |
19 | deeptestinvalid=true
20 |
--------------------------------------------------------------------------------
/src/test/resources/jndi.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one or more
2 | # contributor license agreements. See the NOTICE file distributed with
3 | # this work for additional information regarding copyright ownership.
4 | # The ASF licenses this file to You under the Apache License, Version 2.0
5 | # (the "License"); you may not use this file except in compliance with
6 | # the License. You may obtain a copy of the License at
7 | #
8 | # https://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 | java.naming.factory.initial=org.osjava.jndi.PropertiesFactory
16 | org.osjava.jndi.root=classpath://config
17 | org.osjava.jndi.delimiter=/
18 |
--------------------------------------------------------------------------------
/src/site/resources/profile.japicmp:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one or more
2 | # contributor license agreements. See the NOTICE file distributed with
3 | # this work for additional information regarding copyright ownership.
4 | # The ASF licenses this file to You under the Apache License, Version 2.0
5 | # (the "License"); you may not use this file except in compliance with
6 | # the License. You may obtain a copy of the License at
7 | #
8 | # https://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 | # -----------------------------------------------------------------------------
16 | #
17 | # Empty file used to automatically trigger japicmp profile from commons parent pom
--------------------------------------------------------------------------------
/src/site/resources/profile.jacoco:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one or more
2 | # contributor license agreements. See the NOTICE file distributed with
3 | # this work for additional information regarding copyright ownership.
4 | # The ASF licenses this file to You under the Apache License, Version 2.0
5 | # (the "License"); you may not use this file except in compliance with
6 | # the License. You may obtain a copy of the License at
7 | #
8 | # https://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 | # -----------------------------------------------------------------------------
16 | #
17 | # Empty file used to automatically trigger JaCoCo profile from commons parent pom
18 |
--------------------------------------------------------------------------------
/src/test/resources/testEqualDigester.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/src/test/resources/testSequenceDigester.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/commons/configuration2/EnumFixture.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * https://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.apache.commons.configuration2;
19 |
20 | public enum EnumFixture {
21 |
22 | JAVA, SMALLTALK, SCALA
23 | }
24 |
--------------------------------------------------------------------------------
/src/test/resources/testResolver.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/src/test/resources/config/test.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one or more
2 | # contributor license agreements. See the NOTICE file distributed with
3 | # this work for additional information regarding copyright ownership.
4 | # The ASF licenses this file to You under the Apache License, Version 2.0
5 | # (the "License"); you may not use this file except in compliance with
6 | # the License. You may obtain a copy of the License at
7 | #
8 | # https://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 | boolean=true
16 | overwrite=80
17 | key=jndivalue
18 | key2=jndivalue2
19 | jndi=only_jndi
20 | byte=10
21 | double=10.25
22 | float=20.25
23 | integer=10
24 | long=1000000
25 | short=1
--------------------------------------------------------------------------------
/src/test/resources/testDigesterConfigurationWithProps.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/commons/configuration2/resolver/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * https://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | /**
19 | *
20 | * A package containing EntityResolvers.
21 | *
22 | */
23 | package org.apache.commons.configuration2.resolver;
24 |
--------------------------------------------------------------------------------
/src/test/resources/testDigesterConfigurationOverwrite.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one or more
2 | # contributor license agreements. See the NOTICE file distributed with
3 | # this work for additional information regarding copyright ownership.
4 | # The ASF licenses this file to You under the Apache License, Version 2.0
5 | # (the "License"); you may not use this file except in compliance with
6 | # the License. You may obtain a copy of the License at
7 | #
8 | # https://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 | # Properties for Email configuration
17 |
18 | mail.account.user = masterOfPost
19 | mail.account.psswd = topsecret
20 |
21 | test.configuration = enhanced factory
22 |
--------------------------------------------------------------------------------
/src/test/resources/testEqual.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one or more
2 | # contributor license agreements. See the NOTICE file distributed with
3 | # this work for additional information regarding copyright ownership.
4 | # The ASF licenses this file to You under the Apache License, Version 2.0
5 | # (the "License"); you may not use this file except in compliance with
6 | # the License. You may obtain a copy of the License at
7 | #
8 | # https://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 | property.a = a
16 | property.b = b
17 | property.c = 100
18 |
19 | #
20 | # Value set twice
21 | property.a = aa
22 |
23 | clear.property = delete me
24 |
25 | existing.property = i exist
26 |
27 |
--------------------------------------------------------------------------------
/src/test/resources/testDigesterConfigurationReverseOrder.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/commons/configuration2/spring/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * https://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | /**
19 | *
20 | * A package containing integrations for the Spring Framework.
21 | *
22 | */
23 | package org.apache.commons.configuration2.spring;
24 |
--------------------------------------------------------------------------------
/src/test/resources/testDigesterConfigurationBasePath.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/src/test/resources/threesome.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one or more
2 | # contributor license agreements. See the NOTICE file distributed with
3 | # this work for additional information regarding copyright ownership.
4 | # The ASF licenses this file to You under the Apache License, Version 2.0
5 | # (the "License"); you may not use this file except in compliance with
6 | # the License. You may obtain a copy of the License at
7 | #
8 | # https://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 | test.threesome.one = aaa
16 | test.threesome.one = bbb, ccc
17 |
18 | test.threesome.two = aaa, bbb, ccc
19 |
20 | test.threesome.three = aaa
21 | test.threesome.three = bbb
22 | test.threesome.three = ccc
23 |
--------------------------------------------------------------------------------
/src/test/resources/config/deep/testEqualDeep.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one or more
2 | # contributor license agreements. See the NOTICE file distributed with
3 | # this work for additional information regarding copyright ownership.
4 | # The ASF licenses this file to You under the Apache License, Version 2.0
5 | # (the "License"); you may not use this file except in compliance with
6 | # the License. You may obtain a copy of the License at
7 | #
8 | # https://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 | property.a = a
16 | property.b = b
17 | property.c = 100
18 |
19 | #
20 | # Value set twice
21 | property.a = aa
22 |
23 | clear.property = delete me
24 |
25 | existing.property = i exist
26 |
27 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/commons/configuration2/tree/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * https://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | /**
19 | *
20 | * A package with helper and utility classes used by hierarchical configurations.
21 | *
22 | */
23 | package org.apache.commons.configuration2.tree;
24 |
--------------------------------------------------------------------------------
/.github/dependabot.yml:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one or more
2 | # contributor license agreements. See the NOTICE file distributed with
3 | # this work for additional information regarding copyright ownership.
4 | # The ASF licenses this file to You under the Apache License, Version 2.0
5 | # (the "License"); you may not use this file except in compliance with
6 | # the License. You may obtain a copy of the License at
7 | #
8 | # https://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 | version: 2
17 | updates:
18 | - package-ecosystem: "maven"
19 | directory: "/"
20 | schedule:
21 | interval: "quarterly"
22 | - package-ecosystem: "github-actions"
23 | directory: "/"
24 | schedule:
25 | interval: "quarterly"
26 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/commons/configuration2/plist/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * https://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | /**
19 | *
22 | */
23 | package org.apache.commons.configuration2.plist;
24 |
--------------------------------------------------------------------------------
/src/test/resources/testDigesterConfigurationInclude2.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one or more
2 | # contributor license agreements. See the NOTICE file distributed with
3 | # this work for additional information regarding copyright ownership.
4 | # The ASF licenses this file to You under the Apache License, Version 2.0
5 | # (the "License"); you may not use this file except in compliance with
6 | # the License. You may obtain a copy of the License at
7 | #
8 | # https://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 | # Properties for Email configuration
17 |
18 | host.smtp = smtp.mydomain.org
19 | host.pop = pop3.mydomain.org
20 | account.user = postmaster
21 | account.psswd = secret
22 | account.type = pop3
23 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/commons/configuration2/interpol/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * https://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | /**
19 | *
20 | * A package with helper classes used for interpolation (variable substitution).
21 | *
22 | */
23 | package org.apache.commons.configuration2.interpol;
24 |
--------------------------------------------------------------------------------
/src/test/resources/testCCSystemProperties.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/commons/configuration2/event/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * https://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | /**
19 | *
20 | * This package contains interfaces and classes for receiving notifications about changes at configurations.
21 | *
22 | */
23 | package org.apache.commons.configuration2.event;
24 |
--------------------------------------------------------------------------------
/src/test/resources/testCCEnvProperties.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/src/test/resources/testDigesterConfigurationSysProps.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/commons/configuration2/web/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * https://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | /**
19 | *
20 | * This package contains some implementations of the {@code Configuration} interface that are useful in web
21 | * environments.
22 | *
23 | */
24 | package org.apache.commons.configuration2.web;
25 |
--------------------------------------------------------------------------------
/src/test/resources/config/deep/testFileFromClasspath.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/src/test/resources/testDigesterConfiguration.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/src/test/resources/testDigesterConfigurationNamespaceAware.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/src/test/resources/testSequence.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one or more
2 | # contributor license agreements. See the NOTICE file distributed with
3 | # this work for additional information regarding copyright ownership.
4 | # The ASF licenses this file to You under the Apache License, Version 2.0
5 | # (the "License"); you may not use this file except in compliance with
6 | # the License. You may obtain a copy of the License at
7 | #
8 | # https://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 | prefix.Fa.postfix=value.Fa
16 | prefix.Po.postfix=value.Po
17 | prefix.Ru.postfix=value.Ru
18 | prefix.Se.postfix=value.Se
19 | prefix.As.postfix=value.As
20 | prefix.Gl.postfix=value.Gl
21 | prefix.Pu.postfix=value.Pu
22 | prefix.Te.postfix=value.Te
23 | prefix.Ve.postfix=value.Ve
24 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/commons/configuration2/tree/xpath/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * https://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | /**
19 | *
20 | * This package contains the {@code XPathExpressionEngine} class which enables XPATH support for querying configuration
21 | * properties.
22 | *
23 | */
24 | package org.apache.commons.configuration2.tree.xpath;
25 |
--------------------------------------------------------------------------------
/src/test/resources/testMultiConfiguration_1004.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
20 | ${colors.header4}
21 |
22 |
23 | OK-1,Cancel-2,Help-3
24 |
25 |
26 |
--------------------------------------------------------------------------------
/src/test/resources/testDtd.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
20 |
21 | value1
22 | value2
23 |
--------------------------------------------------------------------------------
/src/test/resources/test.properties.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
19 |
20 | Description of the property list
21 | value1
22 | value2
23 | value3
24 |
25 |
--------------------------------------------------------------------------------
/src/main/resources/properties.dtd:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/src/test/resources/testInterpolation.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one or more
2 | # contributor license agreements. See the NOTICE file distributed with
3 | # this work for additional information regarding copyright ownership.
4 | # The ASF licenses this file to You under the Apache License, Version 2.0
5 | # (the "License"); you may not use this file except in compliance with
6 | # the License. You may obtain a copy of the License at
7 | #
8 | # https://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 | # A test configuration file for testing variable substitution across multiple
17 | # configuration sources created by a DefaultConfigurationBuilder.
18 | # This properties configuration defines a property which is referenced by
19 | # another configuration source.
20 | myvar=abc
21 | testXmlFile=testInterpolation.xml
22 |
23 |
--------------------------------------------------------------------------------
/src/test/resources/sample_1001.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
21 |
22 | Jane Doe
23 |
24 |
--------------------------------------------------------------------------------
/src/test/resources/testCCReloadingNested.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
21 |
22 |
23 |
25 |
26 |
--------------------------------------------------------------------------------
/src/test/resources/testDigesterBadXML.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/commons/configuration2/reloading/ManagedReloadingDetectorMBean.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * https://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.apache.commons.configuration2.reloading;
19 |
20 | /**
21 | * MBean definition for managing configuration reload.
22 | */
23 | public interface ManagedReloadingDetectorMBean {
24 | /**
25 | * Management method to force configuration reload.
26 | */
27 | void refresh();
28 | }
29 |
--------------------------------------------------------------------------------
/src/test/resources/testDtdPublic.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
21 |
23 |
24 | value
25 |
26 |
--------------------------------------------------------------------------------
/src/test/resources/testDigesterCreateObject.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/src/test/resources/testFactoryPropertiesInclude.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/src/test/resources/catalog.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
20 |
22 |
24 |
25 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/commons/configuration2/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * https://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | /**
19 | *
20 | * The Configuration main package. It contains the definition of the {@code Configuration} interface and frequently used
21 | * implementations like {@code PropertiesConfiguration} (dealing with {@code .properties} files) or
22 | * {@code XMLConfiguration} that can load XML documents.
23 | *
24 | */
25 | package org.apache.commons.configuration2;
26 |
--------------------------------------------------------------------------------
/src/test/resources/test_invalid_date.plist.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
19 |
21 |
22 |
23 |
24 | string
25 | value1
26 |
27 | date
28 | not a valid date
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/commons/configuration2/io/VerifiableOutputStream.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * https://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 | package org.apache.commons.configuration2.io;
18 |
19 | import java.io.IOException;
20 | import java.io.OutputStream;
21 |
22 | /**
23 | * OutputStream that can be checked for errors after it is written to.
24 | *
25 | * @since 1.7
26 | */
27 | public abstract class VerifiableOutputStream extends OutputStream {
28 | public abstract void verify() throws IOException;
29 | }
30 |
--------------------------------------------------------------------------------
/src/test/resources/testCCReloading.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/src/test/resources/testDigesterOptionalConfigurationEx.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/.github/workflows/dependency-review.yml:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # https://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 |
18 | name: 'Dependency Review'
19 | on: [pull_request]
20 |
21 | permissions:
22 | contents: read
23 |
24 | jobs:
25 | dependency-review:
26 | runs-on: ubuntu-latest
27 | steps:
28 | - name: 'Checkout Repository'
29 | uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
30 | - name: 'Dependency Review PR'
31 | uses: actions/dependency-review-action@3c4e3dcb1aa7874d2c16be7d79418e9b7efd6261 # v4.8.2
32 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/commons/configuration2/ex/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * https://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | /**
19 | *
20 | * This package contains all exception classes used by this library.
21 | *
22 | *
23 | * Commons Configuration defines a small number of exception classes. Because these classes are referenced by
24 | * multiple other packages, they are located in their own package to avoid cyclic dependencies.
25 | *
26 | */
27 | package org.apache.commons.configuration2.ex;
28 |
--------------------------------------------------------------------------------
/src/test/resources/testCCFileSystem.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
21 |
22 |
23 |
24 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/src/test/resources/catalog2.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
20 |
22 |
24 |
26 |
--------------------------------------------------------------------------------
/src/test/resources/testCCEntityResolver.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
21 |
22 |
23 |
24 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/src/test/resources/testInterpolation.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
25 |
26 |
27 |
28 | ${myvar}-product
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/commons/configuration2/beanutils/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * https://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | /**
19 | *
20 | * In this package a {@code Configuration} implementation can be found that implements the {@code DynaBean} interface.
21 | * It allows to access or modify a configuration using the classes from the Commons Beanutils package. There are also
22 | * classes for declaring beans in configuration files, from which then instances can be created.
23 | *
24 | */
25 | package org.apache.commons.configuration2.beanutils;
26 |
--------------------------------------------------------------------------------
/src/test/resources/sample.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
21 |
22 | 555121211
23 | John Doe
24 | 1975-05-15
25 | Exempt
26 | 100000
27 |
28 |
--------------------------------------------------------------------------------
/src/test/resources/testMultiConfiguration_2001.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
21 |
22 | This will throw a schema exception
23 |
24 |
25 | OK-1,Cancel-2,Help-3
26 |
27 |
28 |
--------------------------------------------------------------------------------
/src/test/resources/testCCCustomProvider.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
20 |
21 |
22 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/src/test/resources/testMultiConfiguration_1002.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
20 | #2222222
21 | #000000
22 | #222222
23 |
24 | ${colors.header3}
25 |
26 | 25
27 |
28 | OK-2,Cancel-2,Help-2
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/src/test/resources/testMultiConfiguration_1003.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
20 | #333333
21 | #FFFFFF
22 | #333333
23 |
24 | ${colors.header3}
25 |
26 | 35
27 |
28 | OK-3,Cancel-3,Help-3
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/src/test/resources/testConfigurationXMLDocument.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/src/test/resources/test2.plist.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
19 |
20 |
21 |
22 | http://www.google.com/search?hl=en&client=safari&rls=en&q=RFC822MessageDatasPboardType&btnG=Search&aq=f&oq=&aqi=
23 |
24 |
25 | RFC822MessageDatasPboardType - Google Search
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/commons/configuration2/reloading/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * https://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | /**
19 | *
20 | * This package contains classes and interfaces related to the reloading mechanism.
21 | *
22 | *
23 | * Using these classes it is possible to monitor configuration sources for external changes. When a change is detected
24 | * notifications are sent out. In collaboration with a configuration builder reloading can happen transparently
25 | * in background.
26 | *
27 | */
28 | package org.apache.commons.configuration2.reloading;
29 |
--------------------------------------------------------------------------------
/src/test/resources/testCCCombinedChildBuilder.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
30 |
31 |
--------------------------------------------------------------------------------
/src/test/resources/testDigesterConfiguration3.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/commons/configuration2/event/TestXMLConfigurationEvents.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * https://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 | package org.apache.commons.configuration2.event;
18 |
19 | import org.apache.commons.configuration2.AbstractConfiguration;
20 | import org.apache.commons.configuration2.XMLConfiguration;
21 |
22 | /**
23 | * Test class for events generated by XMLConfiguration.
24 | */
25 | public class TestXMLConfigurationEvents extends TestHierarchicalConfigurationEvents {
26 | @Override
27 | protected AbstractConfiguration createConfiguration() {
28 | return new XMLConfiguration();
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/commons/configuration2/interpol/TestDummyLookup.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * https://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 | package org.apache.commons.configuration2.interpol;
18 |
19 | import static org.junit.jupiter.api.Assertions.assertNull;
20 |
21 | import org.junit.jupiter.api.Test;
22 |
23 | /**
24 | * Test class for {@code DummyLookup}.
25 | */
26 | public class TestDummyLookup {
27 | /**
28 | * Tests the lookup() method.
29 | */
30 | @Test
31 | void testLookup() {
32 | assertNull(DummyLookup.INSTANCE.lookup("someVariable"));
33 | assertNull(DummyLookup.INSTANCE.lookup(null));
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/commons/configuration2/ConfigurationComparator.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * https://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.apache.commons.configuration2;
19 |
20 | /**
21 | * Comparator for configurations interface.
22 | *
23 | * @since 1.0
24 | */
25 | public interface ConfigurationComparator {
26 | /**
27 | * Compare two configuration objects.
28 | *
29 | * @param a the first configuration
30 | * @param b the second configuration
31 | * @return true if the two configurations are identical according to the implemented rules
32 | */
33 | boolean compare(Configuration a, Configuration b);
34 | }
35 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/commons/configuration2/FileBasedConfiguration.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * https://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 | package org.apache.commons.configuration2;
18 |
19 | import org.apache.commons.configuration2.io.FileBased;
20 |
21 | /**
22 | *
23 | * An interface which combines the {@code FileBased} and {@code Configuration} interfaces.
24 | *
25 | *
26 | * This interface is used to parameterize {@code ConfigurationBuilder} implementations which produce configurations read
27 | * from a {@code FileHandler}.
28 | *
29 | *
30 | * @since 2.0
31 | */
32 | public interface FileBasedConfiguration extends FileBased, Configuration {
33 | }
34 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/commons/configuration2/tree/TestTreeData.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * https://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 | package org.apache.commons.configuration2.tree;
18 |
19 | /**
20 | * Test class for {@code TreeData}
21 | */
22 | public class TestTreeData extends AbstractImmutableNodeHandlerTest {
23 | /**
24 | * {@inheritDoc} This implementation creates a TreeData object initialized with the given root node.
25 | */
26 | @Override
27 | protected NodeHandler createHandler(final ImmutableNode root) {
28 | final InMemoryNodeModel model = new InMemoryNodeModel(root);
29 | return model.getTreeData();
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/test/resources/log4j-test.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/commons/configuration2/event/TestMapConfigurationEvents.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * https://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 | package org.apache.commons.configuration2.event;
18 |
19 | import java.util.HashMap;
20 |
21 | import org.apache.commons.configuration2.AbstractConfiguration;
22 | import org.apache.commons.configuration2.MapConfiguration;
23 |
24 | /**
25 | * Test class for the events generated by MapConfiguration.
26 | */
27 | public class TestMapConfigurationEvents extends AbstractTestConfigurationEvents {
28 | @Override
29 | protected AbstractConfiguration createConfiguration() {
30 | return new MapConfiguration(new HashMap<>());
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/test/resources/testCCFileSystemSubConfig.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
21 |
22 |
23 |
24 |
26 |
27 |
28 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/src/test/resources/testCCResultClass.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
21 |
22 |
23 |
24 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/src/test/resources/testDigesterConfiguration2.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/commons/configuration2/event/TestPropertiesConfigurationEvents.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * https://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 | package org.apache.commons.configuration2.event;
18 |
19 | import org.apache.commons.configuration2.AbstractConfiguration;
20 | import org.apache.commons.configuration2.PropertiesConfiguration;
21 |
22 | /**
23 | * Test class for the events generated by properties configurations. This class also tests reload events.
24 | */
25 | public class TestPropertiesConfigurationEvents extends AbstractTestConfigurationEvents {
26 | @Override
27 | protected AbstractConfiguration createConfiguration() {
28 | return new PropertiesConfiguration();
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/commons/configuration2/reloading/RandomReloadingDetector.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * https://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 | package org.apache.commons.configuration2.reloading;
18 |
19 | import java.util.Random;
20 |
21 | /**
22 | * An implementation of {@code ReloadingDetector} which randomly returns true or false.
23 | */
24 | public class RandomReloadingDetector implements ReloadingDetector {
25 | /** The random object. */
26 | private final Random random = new Random();
27 |
28 | @Override
29 | public boolean isReloadingRequired() {
30 | return random.nextBoolean();
31 | }
32 |
33 | @Override
34 | public void reloadingPerformed() {
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/commons/configuration2/TestPatternSubtreeConfigurationWrapper.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * https://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.apache.commons.configuration2;
19 |
20 | import static org.junit.jupiter.api.Assertions.assertThrows;
21 |
22 | import org.junit.jupiter.api.Test;
23 |
24 | /**
25 | */
26 | public class TestPatternSubtreeConfigurationWrapper {
27 | /**
28 | * Tests a read operation if the wrapped configuration does not implement FileBased.
29 | */
30 | @Test
31 | void testReadNotFileBased() {
32 | assertThrows(NullPointerException.class, () -> {
33 | new PatternSubtreeConfigurationWrapper(null, "");
34 | });
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/commons/configuration2/io/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * https://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | /**
19 | *
20 | * A package with classes related to I/O operations.
21 | *
22 | *
23 | * Most of the interfaces and classes contained in this package are related to file-based configurations. For instance,
24 | * the basic interfaces for reading and writing data or for managing a reference to a file are defined here. This
25 | * package also contains various strategy classes for locating files. They can be used to construct a location strategy
26 | * for the configuration sources of a specific application.
27 | *
28 | */
29 | package org.apache.commons.configuration2.io;
30 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/commons/configuration2/tree/NodeModelSupport.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * https://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 | package org.apache.commons.configuration2.tree;
18 |
19 | /**
20 | *
21 | * An interface to be implemented by objects that support a {@link NodeModel}.
22 | *
23 | *
24 | * This interface defines a single method for querying a {@code NodeModel}.
25 | *
26 | *
27 | * @param the type of the supported {@code NodeModel}
28 | * @since 2.0
29 | */
30 | public interface NodeModelSupport {
31 | /**
32 | * Gets the {@code NodeModel} supported by this object.
33 | *
34 | * @return the {@code NodeModel}
35 | */
36 | NodeModel getNodeModel();
37 | }
38 |
--------------------------------------------------------------------------------
/src/test/resources/testMultiConfiguration_3002.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
20 |
21 | #2222222
22 | #000000
23 | #222222
24 |
25 | ${colors.header3}
26 |
27 | 25
28 |
29 | OK-2,Cancel-2,Help-2
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/src/test/resources/testCCMultiTenentReloading.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
21 |
22 |
23 |
25 |
26 |
27 |
28 |
31 |
32 |
--------------------------------------------------------------------------------
/src/test/resources/testMultiConfiguration_2002.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
21 |
22 | #2222222
23 | #000000
24 | #222222
25 |
26 | ${colors.header3}
27 |
28 | 25
29 |
30 | OK-2,Cancel-2,Help-2
31 |
32 |
33 |
--------------------------------------------------------------------------------
/src/test/resources/testInterpolationBuilder.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/.asf.yaml:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one or more
2 | # contributor license agreements. See the NOTICE file distributed with
3 | # this work for additional information regarding copyright ownership.
4 | # The ASF licenses this file to You under the Apache License, Version 2.0
5 | # (the "License"); you may not use this file except in compliance with
6 | # the License. You may obtain a copy of the License at
7 | #
8 | # https://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 | github:
17 | description: "Apache Commons Configuration"
18 | homepage: https://commons.apache.org/configuration/
19 |
20 | notifications:
21 | commits: commits@commons.apache.org
22 | issues: issues@commons.apache.org
23 | pullrequests: issues@commons.apache.org
24 | jira_options: link label
25 | jobs: notifications@commons.apache.org
26 | # commits_bot_dependabot: dependabot@commons.apache.org
27 | issues_bot_dependabot: dependabot@commons.apache.org
28 | pullrequests_bot_dependabot: dependabot@commons.apache.org
29 | issues_bot_codecov-commenter: notifications@commons.apache.org
30 | pullrequests_bot_codecov-commenter: notifications@commons.apache.org
31 |
--------------------------------------------------------------------------------
/src/test/resources/testMultiConfiguration_1001.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
20 | #808080
21 | #000000
22 | #008000
23 |
24 | ${colors.header}
25 |
26 | 15
27 |
28 | OK,Cancel,Help
29 |
30 |
31 |
32 |
33 | My Channel
34 |
35 |
36 | more test 2 data
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/commons/configuration2/resolver/EntityResolverSupport.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * https://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 | package org.apache.commons.configuration2.resolver;
18 |
19 | import org.xml.sax.EntityResolver;
20 |
21 | /**
22 | * Interface that identifies the class as using an EntityResolver
23 | *
24 | * @since 1.7
25 | */
26 | public interface EntityResolverSupport {
27 | /**
28 | * Gets the EntityResolver associated with the class.
29 | *
30 | * @return The EntityResolver.
31 | */
32 | EntityResolver getEntityResolver();
33 |
34 | /**
35 | * Sets the EntityResolver to associate with this class.
36 | *
37 | * @param resolver The EntityResolver
38 | */
39 | void setEntityResolver(EntityResolver resolver);
40 | }
41 |
--------------------------------------------------------------------------------
/src/test/resources/01/testMultiConfiguration_1001.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
20 | #808080
21 | #000000
22 | #008000
23 |
24 | ${colors.header}
25 |
26 | 15
27 |
28 | OK,Cancel,Help
29 |
30 |
31 |
32 |
33 | My Channel
34 |
35 |
36 | more test 2 data
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/commons/configuration2/event/TestSubsetConfigurationEvents.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * https://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 | package org.apache.commons.configuration2.event;
18 |
19 | import java.util.HashMap;
20 |
21 | import org.apache.commons.configuration2.AbstractConfiguration;
22 | import org.apache.commons.configuration2.MapConfiguration;
23 | import org.apache.commons.configuration2.SubsetConfiguration;
24 |
25 | /**
26 | * Test class for the events generated by SubsetConfiguration.
27 | */
28 | public class TestSubsetConfigurationEvents extends AbstractTestConfigurationEvents {
29 | @Override
30 | protected AbstractConfiguration createConfiguration() {
31 | return (SubsetConfiguration) new MapConfiguration(new HashMap<>()).subset("test");
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/test/resources/testValidateValid.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
21 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 | ]>
31 |
32 |
33 |
46 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/commons/configuration2/ConfigurationConsumer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * https://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.apache.commons.configuration2;
19 |
20 | import org.apache.commons.configuration2.ex.ConfigurationException;
21 |
22 | /**
23 | * A Configuration task that may throw a ConfigurationException.
24 | *
25 | * @param the type of the input to the operation.
26 | * @since 2.6
27 | */
28 | @FunctionalInterface
29 | public interface ConfigurationConsumer {
30 |
31 | /**
32 | * Performs this operation on the given argument.
33 | *
34 | * @param t the input argument
35 | * @throws ConfigurationException May be thrown while performing a Configuration operation.
36 | */
37 | void accept(T t) throws ConfigurationException;
38 | }
39 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/commons/configuration2/beanutils/BeanCreationTestCtorBean.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * https://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 | package org.apache.commons.configuration2.beanutils;
18 |
19 | /**
20 | * Another test bean class for bean creation operations which defines some constructors.
21 | */
22 | public class BeanCreationTestCtorBean extends BeanCreationTestBean {
23 | public BeanCreationTestCtorBean() {
24 | }
25 |
26 | public BeanCreationTestCtorBean(final BeanCreationTestBean buddy) {
27 | setBuddy(buddy);
28 | }
29 |
30 | public BeanCreationTestCtorBean(final String s) {
31 | setStringValue(s);
32 | }
33 |
34 | public BeanCreationTestCtorBean(final String s, final int i) {
35 | this(s);
36 | setIntValue(i);
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/commons/configuration2/reloading/AlwaysReloadingDetector.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * https://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 | package org.apache.commons.configuration2.reloading;
18 |
19 | /**
20 | * A reloading detector implementation which always indicates that a reload is required. This is used by some test
21 | * classes.
22 | */
23 | public class AlwaysReloadingDetector implements ReloadingDetector {
24 | /**
25 | * {@inheritDoc} This implementation always returns true.
26 | */
27 | @Override
28 | public boolean isReloadingRequired() {
29 | return true;
30 | }
31 |
32 | /**
33 | * Empty dummy implementation of this interface method.
34 | */
35 | @Override
36 | public void reloadingPerformed() {
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/src/test/resources/testValidation.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/commons/configuration2/tree/InMemoryNodeModelSupport.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * https://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 | package org.apache.commons.configuration2.tree;
18 |
19 | /**
20 | *
21 | * A specialized version of the {@code NodeModelSupport} interface which allows querying an {@link InMemoryNodeModel}.
22 | *
23 | *
24 | * This interface is needed by some special node model implementations used by in-memory configurations. Such
25 | * implementations require the extended capabilities of an {@code InMemoryNodeModel}.
26 | *
27 | *
28 | * @since 2.0
29 | */
30 | public interface InMemoryNodeModelSupport extends NodeModelSupport {
31 | /**
32 | * {@inheritDoc} This variant specializes the return type to {@code InMemoryNodeModel}.
33 | */
34 | @Override
35 | InMemoryNodeModel getNodeModel();
36 | }
37 |
--------------------------------------------------------------------------------
/src/test/resources/testDigesterOptionalConfiguration.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/commons/configuration2/reloading/ReloadingControllerSupport.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * https://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 | package org.apache.commons.configuration2.reloading;
18 |
19 | /**
20 | *
21 | * Definition of an interface to be implemented by components which support reloading operations managed by a
22 | * {@link ReloadingController}.
23 | *
24 | *
25 | * Classes implementing this interface have to provide access to a {@link ReloadingController} instance. This object can
26 | * then be used to trigger reloading checks.
27 | *
28 | *
29 | * @since 2.0
30 | */
31 | public interface ReloadingControllerSupport {
32 | /**
33 | * Gets the {@code ReloadingController} associated with this object.
34 | *
35 | * @return the associated {@code ReloadingController}
36 | */
37 | ReloadingController getReloadingController();
38 | }
39 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/commons/configuration2/event/TestEventType.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * https://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 | package org.apache.commons.configuration2.event;
18 |
19 | import static org.junit.jupiter.api.Assertions.assertEquals;
20 |
21 | import org.junit.jupiter.api.BeforeEach;
22 | import org.junit.jupiter.api.Test;
23 |
24 | /**
25 | * Test class for {@code EventType}.
26 | */
27 | public class TestEventType {
28 | /** The event type to be tested. */
29 | private EventType eventType;
30 |
31 | @BeforeEach
32 | public void setUp() throws Exception {
33 | eventType = new EventType<>(null, "TEST");
34 | }
35 |
36 | /**
37 | * Tests the string representation.
38 | */
39 | @Test
40 | void testToString() {
41 | final String s = eventType.toString();
42 | assertEquals("EventType [ TEST ]", s);
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/src/test/resources/testSystemProperties.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
29 |
31 |
32 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/commons/configuration2/interpol/StringLookupAdapter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * https://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 | package org.apache.commons.configuration2.interpol;
18 |
19 | import java.util.Objects;
20 |
21 | import org.apache.commons.text.lookup.StringLookup;
22 |
23 | /**
24 | * Wraps an Apache Commons Text {@link StringLookup} as an Apache Commons Configuration {@link Lookup}.
25 | *
26 | * @since 2.4
27 | */
28 | final class StringLookupAdapter implements Lookup {
29 |
30 | /**
31 | * The StringLookup delegate.
32 | */
33 | private final StringLookup stringLookup;
34 |
35 | StringLookupAdapter(final StringLookup stringLookup) {
36 | this.stringLookup = Objects.requireNonNull(stringLookup, "stringLookup");
37 | }
38 |
39 | @Override
40 | public Object lookup(final String key) {
41 | return stringLookup.lookup(key);
42 | }
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/src/test/resources/testCCLookup.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
22 |
23 |
24 |
25 |
27 |
28 |
29 |
30 |
31 |
32 | -->
33 |
34 |
35 |
--------------------------------------------------------------------------------
/src/test/resources/testValidation2.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/src/test/resources/testMultiConfiguration_3001.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
20 |
21 | #808080
22 | #000000
23 | #008000
24 |
25 | ${colors.header}
26 |
27 | 15
28 |
29 | OK,Cancel,Help
30 |
31 |
32 |
33 |
34 | My Channel
35 |
36 |
37 | more test 2 data
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/commons/configuration2/sync/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * https://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | /**
19 | *
20 | * A package containing interfaces and classes related to synchronization of configurations.
21 | *
22 | *
23 | * Whether a configuration object has to be thread-safe or not is application-specific. Therefore, this library allows
24 | * an application to adapt configuration objects to their requirements regarding thread-safety by assigning them
25 | * so-called {@code Synchronizer} objects. A configuration invokes its {@code Synchronizer} every time it is accessed
26 | * (in read or write mode). If configurations are not accessed concurrently by multiple threads, a simple dummy
27 | * {@code Synchronizer} can be used - this is also the default setting. To ensure thread-safety, a fully functional
28 | * implementation has to be set.
29 | *
30 | */
31 | package org.apache.commons.configuration2.sync;
32 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/commons/configuration2/beanutils/TestConfigurationDynaBeanXMLConfig.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * https://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.apache.commons.configuration2.beanutils;
19 |
20 | import org.apache.commons.configuration2.Configuration;
21 | import org.apache.commons.configuration2.XMLConfiguration;
22 |
23 | /**
24 | * An additional test class for ConfigurationDynaBean. This test class performs the same tests as the default test
25 | * class, but uses a XMLConfiguration as underlying configuration object.
26 | */
27 | public class TestConfigurationDynaBeanXMLConfig extends TestConfigurationDynaBean {
28 | /**
29 | * Creates the underlying configuration object. This implementation will create a XMLConfiguration.
30 | *
31 | * @return the underlying configuration
32 | */
33 | @Override
34 | protected Configuration createConfiguration() {
35 | return new XMLConfiguration();
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/src/test/resources/testHierarchicalXMLConfiguration2.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
20 |
21 |
22 |
23 | Case1Text
24 |
25 |
26 |
27 |
28 |
29 | Case2Text
30 |
31 |
32 |
33 |
34 |
37 |
38 |
39 |
40 |
41 |
42 | Case4Text
43 |
44 |
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/commons/configuration2/TestNonStringProperties.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * https://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.apache.commons.configuration2;
19 |
20 | import org.apache.commons.configuration2.io.FileHandler;
21 | import org.junit.jupiter.api.BeforeEach;
22 |
23 | /**
24 | * Test if non-string properties are handled correctly.
25 | */
26 | public class TestNonStringProperties extends BaseNonStringProperties {
27 | /** The File that we test with */
28 | private final String testProperties = ConfigurationAssert.getTestFile("test.properties").getAbsolutePath();
29 |
30 | @BeforeEach
31 | public void setUp() throws Exception {
32 | final PropertiesConfiguration c = new PropertiesConfiguration();
33 | final FileHandler handler = new FileHandler(c);
34 | handler.setFileName(testProperties);
35 | handler.load();
36 | conf = c;
37 | nonStringTestHolder.setConfiguration(conf);
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/src/test/resources/test2.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one or more
2 | # contributor license agreements. See the NOTICE file distributed with
3 | # this work for additional information regarding copyright ownership.
4 | # The ASF licenses this file to You under the Apache License, Version 2.0
5 | # (the "License"); you may not use this file except in compliance with
6 | # the License. You may obtain a copy of the License at
7 | #
8 | # https://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 | configuration.loaded = true
16 |
17 | packages = override.packages
18 | propertyInOrder=test2.properties
19 |
20 |
21 | #
22 | # Other test properties
23 | #
24 |
25 | test.equals = value=one
26 |
27 | test.empty=
28 |
29 | #
30 | # Non String Properties
31 | #
32 |
33 | test.boolean = true
34 | test.boolean.array = false
35 | test.boolean.array = true
36 |
37 | test.byte = 10
38 | test.byte.array = 20
39 | test.byte.array = 30
40 |
41 | test.double = 10.25
42 | test.double.array = 20.35
43 | test.double.array = 30.45
44 |
45 | test.float = 20.25
46 | test.float.array = 30.35
47 | test.float.array = 40.45
48 |
49 | test.integer = 10
50 | test.integer.array = 20
51 | test.integer.array = 30
52 |
53 | test.long = 1000000
54 | test.long.array = 2000000
55 | test.long.array = 3000000
56 |
57 | test.short = 1
58 | test.short.array = 2
59 | test.short.array = 3
60 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/commons/configuration2/builder/fluent/JndiBuilderParameters.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * https://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 | package org.apache.commons.configuration2.builder.fluent;
18 |
19 | import org.apache.commons.configuration2.builder.BasicBuilderProperties;
20 | import org.apache.commons.configuration2.builder.BuilderParameters;
21 | import org.apache.commons.configuration2.builder.JndiBuilderProperties;
22 |
23 | /**
24 | *
25 | * Definition of a parameters interface providing a fluent API for setting all properties for a JNDI configuration.
26 | *
27 | *
28 | * Important note: This interface is not intended to be implemented by client code! It defines a set of
29 | * available properties and may be extended even in minor releases.
30 | *
31 | *
32 | * @since 2.0
33 | */
34 | public interface JndiBuilderParameters extends BasicBuilderProperties, JndiBuilderProperties, BuilderParameters {
35 | }
36 |
--------------------------------------------------------------------------------
/src/main/assembly/src.xml:
--------------------------------------------------------------------------------
1 |
17 |
20 | src
21 |
22 | tar.gz
23 | zip
24 |
25 | ${artifactId}-${commons.release.version}-src
26 |
27 |
28 |
29 | LICENSE*
30 | NOTICE*
31 | RELEASE-NOTES*
32 | pom.xml
33 | CONTRIBUTING.md
34 | README.md
35 |
36 |
37 |
38 | conf
39 |
40 |
41 | src
42 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/commons/configuration2/builder/fluent/DatabaseBuilderParameters.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * https://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 | package org.apache.commons.configuration2.builder.fluent;
18 |
19 | import org.apache.commons.configuration2.builder.BasicBuilderProperties;
20 | import org.apache.commons.configuration2.builder.BuilderParameters;
21 | import org.apache.commons.configuration2.builder.DatabaseBuilderProperties;
22 |
23 | /**
24 | *
25 | * Definition of a parameters interface providing a fluent API for setting all properties for a database configuration.
26 | *
27 | *
28 | * Important note: This interface is not intended to be implemented by client code! It defines a set of
29 | * available properties and may be extended even in minor releases.
30 | *
48 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/commons/configuration2/TestEqualsProperty.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * https://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.apache.commons.configuration2;
19 |
20 | import static org.junit.jupiter.api.Assertions.assertEquals;
21 |
22 | import org.apache.commons.configuration2.io.FileHandler;
23 | import org.junit.jupiter.api.Test;
24 |
25 | /**
26 | * test if properties that contain a "=" will be loaded correctly.
27 | */
28 | public class TestEqualsProperty {
29 | /** The File that we test with */
30 | private final String testProperties = ConfigurationAssert.getTestFile("test.properties").getAbsolutePath();
31 |
32 | @Test
33 | void testEquals() throws Exception {
34 | final PropertiesConfiguration conf = new PropertiesConfiguration();
35 | final FileHandler handler = new FileHandler(conf);
36 | handler.setFileName(testProperties);
37 | handler.load();
38 |
39 | final String equals = conf.getString("test.equals");
40 | assertEquals("value=one", equals);
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/commons/configuration2/beanutils/BeanCreationTestBean.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * https://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 | package org.apache.commons.configuration2.beanutils;
18 |
19 | /**
20 | * A simple bean class used for testing bean creation operations.
21 | */
22 | public class BeanCreationTestBean {
23 | private String stringValue;
24 |
25 | private int intValue;
26 |
27 | private BeanCreationTestBean buddy;
28 |
29 | public BeanCreationTestBean getBuddy() {
30 | return buddy;
31 | }
32 |
33 | public int getIntValue() {
34 | return intValue;
35 | }
36 |
37 | public String getStringValue() {
38 | return stringValue;
39 | }
40 |
41 | public void setBuddy(final BeanCreationTestBean buddy) {
42 | this.buddy = buddy;
43 | }
44 |
45 | public void setIntValue(final int intValue) {
46 | this.intValue = intValue;
47 | }
48 |
49 | public void setStringValue(final String stringValue) {
50 | this.stringValue = stringValue;
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/src/test/resources/testDigesterConfigurationInclude1.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
20 |
53 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/commons/configuration2/builder/fluent/CombinedBuilderParameters.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * https://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 | package org.apache.commons.configuration2.builder.fluent;
18 |
19 | import org.apache.commons.configuration2.builder.BasicBuilderProperties;
20 | import org.apache.commons.configuration2.builder.BuilderParameters;
21 | import org.apache.commons.configuration2.builder.combined.CombinedBuilderProperties;
22 |
23 | /**
24 | *
25 | * Definition of a parameters interface providing a fluent API for setting all properties of a builder for a combined
26 | * configuration.
27 | *
28 | *
29 | * Important note: This interface is not intended to be implemented by client code! It defines a set of
30 | * available properties and may be extended even in minor releases.
31 | *
32 | *
33 | * @since 2.0
34 | */
35 | public interface CombinedBuilderParameters
36 | extends BasicBuilderProperties, CombinedBuilderProperties, BuilderParameters {
37 | }
38 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/commons/configuration2/builder/fluent/FileBasedBuilderParameters.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * https://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 | package org.apache.commons.configuration2.builder.fluent;
18 |
19 | import org.apache.commons.configuration2.builder.BasicBuilderProperties;
20 | import org.apache.commons.configuration2.builder.BuilderParameters;
21 | import org.apache.commons.configuration2.builder.FileBasedBuilderProperties;
22 |
23 | /**
24 | *
25 | * Definition of a parameters interface providing a fluent API for setting all properties of a configuration of a
26 | * file-based configuration builder.
27 | *
28 | *
29 | * Important note: This interface is not intended to be implemented by client code! It defines a set of
30 | * available properties and may be extended even in minor releases.
31 | *
32 | *
33 | * @since 2.0
34 | */
35 | public interface FileBasedBuilderParameters
36 | extends BasicBuilderProperties, FileBasedBuilderProperties, BuilderParameters {
37 | }
38 |
--------------------------------------------------------------------------------
/src/main/assembly/bin.xml:
--------------------------------------------------------------------------------
1 |
17 |
20 | bin
21 |
22 | tar.gz
23 | zip
24 |
25 | ${artifactId}-${commons.release.version}
26 |
27 |
28 |
29 | LICENSE*
30 | NOTICE*
31 | RELEASE-NOTES*
32 |
33 |
34 |
35 | target
36 |
37 |
38 | *.jar
39 |
40 |
41 |
42 | target/site/apidocs
43 | apidocs
44 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/commons/configuration2/builder/fluent/MultiFileBuilderParameters.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * https://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 | package org.apache.commons.configuration2.builder.fluent;
18 |
19 | import org.apache.commons.configuration2.builder.BasicBuilderProperties;
20 | import org.apache.commons.configuration2.builder.BuilderParameters;
21 | import org.apache.commons.configuration2.builder.combined.MultiFileBuilderProperties;
22 |
23 | /**
24 | *
25 | * Definition of a parameters interface providing a fluent API for setting all properties of a builder managing multiple
26 | * file-based configurations.
27 | *
28 | *
29 | * Important note: This interface is not intended to be implemented by client code! It defines a set of
30 | * available properties and may be extended even in minor releases.
31 | *
32 | *
33 | * @since 2.0
34 | */
35 | public interface MultiFileBuilderParameters
36 | extends BasicBuilderProperties, MultiFileBuilderProperties, BuilderParameters {
37 | }
38 |
--------------------------------------------------------------------------------
/src/test/resources/test.plist:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * https://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 | {
18 | simple-string = string1;
19 | quoted-string = "string2";
20 | quoted-string2 = "this is a string";
21 | "complex-string" = "this is a \"complex\" string {(=,;)}";
22 |
23 | // This is a test single-line comment
24 | array = ( "value1", "value2", "value3" );
25 |
26 | empty-array = ();
27 |
28 | nested-arrays = ( (a , b) , (c, d) );
29 |
30 | dictionary-array =
31 | (
32 | { foo = bar },
33 | { key = value }
34 | )
35 |
36 | dictionary =
37 | {
38 | foo1 = bar1;
39 | foo2 = bar2;
40 | }
41 |
42 | empty-dictionary = { };
43 |
44 | nested-dictionaries =
45 | {
46 | foo =
47 | {
48 | bar =
49 | {
50 | "key" = "value";
51 | }
52 | }
53 | }
54 |
55 | date = <*D2002-03-22 11:30:00 +0100>;
56 |
57 | data = <666F6f 20 626172>;
58 |
59 | empty-data = < >;
60 | }
61 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/commons/configuration2/interpol/DummyLookup.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * https://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 | package org.apache.commons.configuration2.interpol;
18 |
19 | /**
20 | *
24 | * This implementation always returns null for a passed in variable indicating that it cannot resolve that
25 | * variable. This is useful for instance as an application of the null object pattern.
26 | *
27 | *
28 | * This class does not define any state, therefore a single instance can be shared. To enforce usage of only a single
29 | * instance this class is actually an enumeration.
30 | *
31 | *
32 | * @since 2.0
33 | */
34 | public enum DummyLookup implements Lookup {
35 | /** The single instance of this class. */
36 | INSTANCE;
37 |
38 | /**
39 | * {@inheritDoc} This implementation always returns null.
40 | */
41 | @Override
42 | public Object lookup(final String variable) {
43 | return null;
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/src/test/resources/sample.xsd:
--------------------------------------------------------------------------------
1 |
2 |
18 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/commons/configuration2/convert/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * https://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | /**
19 | *
20 | * This package contains interfaces and classes related to data type conversions.
21 | *
22 | *
23 | * An {@code AbstractConfiguration} object is associated with an object responsible for data type conversions. Each
24 | * conversion is done by this object. By replacing the default conversion handler by a custom version, client
25 | * applications can adapt and extend the type conversions available.
26 | *
27 | *
28 | * Related to data type conversion is also the topic of list delimiter parsing and splitting; before a string value can
29 | * be converted to a target data type, it must be clear whether it is to be interpreted as a single value or as a list
30 | * containing multiple values. In this package there are classes implementing different strategies for list delimiter
31 | * handling. Client code can choose the one which is most suitable for the current use case.
32 | *
33 | */
34 | package org.apache.commons.configuration2.convert;
35 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/commons/configuration2/builder/combined/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * https://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | /**
19 | *
20 | * A package containing the implementation of the builder for combined configurations.
21 | *
22 | *
23 | * The {@code CombinedConfigurationBuilder} class defined in this package can create a {@code CombinedConfiguration}
24 | * object from various configuration sources that are declared in a so-called configuration definition file.
25 | * This is a convenient means to collect distributed configuration information and access them as a single logic source.
26 | *
27 | *
28 | * In addition, the {@code MultiFileConfigurationBuilder} class is located in this package. This builder class selects
29 | * one file-based configuration out of a set based on dynamic variable substitution. A typical use case would be the
30 | * definition of multiple configuration files for the different stages of a project: development, integration test,
31 | * production, etc.
32 | *
33 | */
34 | package org.apache.commons.configuration2.builder.combined;
35 |
--------------------------------------------------------------------------------
/src/test/resources/testClasspath.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one or more
2 | # contributor license agreements. See the NOTICE file distributed with
3 | # this work for additional information regarding copyright ownership.
4 | # The ASF licenses this file to You under the Apache License, Version 2.0
5 | # (the "License"); you may not use this file except in compliance with
6 | # the License. You may obtain a copy of the License at
7 | #
8 | # https://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 | configuration.loaded = true
16 |
17 | packages = packagea
18 |
19 | include = include.properties
20 |
21 | #
22 | # Other test properties
23 | #
24 |
25 | test.equals = value=one
26 |
27 | test.empty=
28 |
29 | #
30 | # Test a property that uses a previous property
31 | #
32 | base=base
33 | base.reference=${base}extra
34 |
35 | #
36 | # Non String Properties
37 | #
38 |
39 | test.boolean = true
40 | test.boolean.array = false
41 | test.boolean.array = true
42 |
43 | test.byte = 10
44 | test.byte.array = 20
45 | test.byte.array = 30
46 |
47 | test.double = 10.25
48 | test.double.array = 20.35
49 | test.double.array = 30.45
50 |
51 | test.float = 20.25
52 | test.float.array = 30.35
53 | test.float.array = 40.45
54 |
55 | test.integer = 10
56 | test.integer.array = 20
57 | test.integer.array = 30
58 |
59 | test.long = 1000000
60 | test.long.array = 2000000
61 | test.long.array = 3000000
62 |
63 | test.short = 1
64 | test.short.array = 2
65 | test.short.array = 3
66 |
67 | test.overwrite = 1
--------------------------------------------------------------------------------
/.github/workflows/maven.yml:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one or more
2 | # contributor license agreements. See the NOTICE file distributed with
3 | # this work for additional information regarding copyright ownership.
4 | # The ASF licenses this file to You under the Apache License, Version 2.0
5 | # (the "License"); you may not use this file except in compliance with
6 | # the License. You may obtain a copy of the License at
7 | #
8 | # https://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 | name: Java CI
17 |
18 | on: [push, pull_request]
19 |
20 | permissions:
21 | contents: read
22 |
23 | jobs:
24 | build:
25 |
26 | runs-on: ubuntu-latest
27 | continue-on-error: ${{ matrix.experimental }}
28 | strategy:
29 | matrix:
30 | java: [ 8, 11, 17, 21, 25 ]
31 | experimental: [false]
32 | include:
33 | - java: 26-ea
34 | experimental: true
35 |
36 | steps:
37 | - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
38 | with:
39 | persist-credentials: false
40 | - name: Set up JDK ${{ matrix.java }}
41 | uses: actions/setup-java@f2beeb24e141e01a676f977032f5a29d81c9e27e # v5.1.0
42 | with:
43 | distribution: 'temurin'
44 | java-version: ${{ matrix.java }}
45 | cache: 'maven'
46 | - name: Build with Maven
47 | run: mvn --errors --show-version --batch-mode --no-transfer-progress
48 |
49 | # For Java 11, you can be more strict: -DadditionalJOption=-Xdoclint/package:-org.apache.commons.configuration2.plist
50 |
--------------------------------------------------------------------------------