-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
f1f164d
commit 283f550
Showing
15 changed files
with
252 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ error-tags: | |
PK-CORE: | ||
packages: | ||
- com.exasol.projectkeeper | ||
highest-index: 192 | ||
highest-index: 196 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
project-keeper/src/main/java/com/exasol/projectkeeper/dependencyupdate/XmlDocumentIO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package com.exasol.projectkeeper.dependencyupdate; | ||
|
||
import java.nio.file.Path; | ||
import java.util.Optional; | ||
|
||
import org.w3c.dom.Document; | ||
import org.w3c.dom.Node; | ||
|
||
import com.exasol.projectkeeper.validators.pom.io.PomFileReader; | ||
import com.exasol.projectkeeper.validators.pom.io.PomFileWriter; | ||
import com.exasol.projectkeeper.xpath.XPathErrorHandlingWrapper; | ||
|
||
/** | ||
* This class provides read and write access to XML documents. | ||
* <p> | ||
* The advantage of this class is that it can be easily mocked in tests and it preserves comments when writing XML. | ||
*/ | ||
class XmlDocumentIO { | ||
/** | ||
* Read an XML document from a file. | ||
* | ||
* @param path path to the file | ||
* @return XML document | ||
*/ | ||
Document read(final Path path) { | ||
return PomFileReader.parse(path); | ||
} | ||
|
||
/** | ||
* Write an XML document to a file. | ||
* | ||
* @param document XML document | ||
* @param path path to the file | ||
*/ | ||
void write(final Document document, final Path path) { | ||
PomFileWriter.writeFile(document, path); | ||
} | ||
|
||
/** | ||
* Run an XPath query on an XML document and return the first result. | ||
* | ||
* @param current current node | ||
* @param xPath XPath query | ||
* @return first result of the query | ||
*/ | ||
Optional<Node> runXPath(final Node current, final String xPath) { | ||
return Optional.ofNullable(XPathErrorHandlingWrapper.runXPath(current, xPath)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 0 additions & 47 deletions
47
project-keeper/src/main/java/com/exasol/projectkeeper/validators/pom/PomRenderer.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.