Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
104 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import java.nio.charset.Charset; | ||
import java.nio.charset.StandardCharsets; | ||
import java.nio.file.Files; | ||
import java.nio.file.Path; | ||
import java.nio.file.Paths; | ||
import java.util.regex.Matcher; | ||
import java.util.regex.Pattern; | ||
|
||
public class after { | ||
public static void main(String[] args) throws Exception { | ||
Path path = Paths.get("reference/en/en-US/modules/RESTEasy_Spring_Integration.xml"); | ||
Charset charset = StandardCharsets.UTF_8; | ||
String content = new String(Files.readAllBytes(path), charset); | ||
String token = "_SPRING_VER_"; | ||
String ver = getVer(); | ||
|
||
// restore | ||
content = content.replaceAll(ver, token); | ||
Files.write(path, content.getBytes(charset)); | ||
} | ||
|
||
public static String getVer() throws Exception { | ||
Path path = Paths.get("../resteasy-dependencies-bom/pom.xml"); | ||
Charset charset = StandardCharsets.UTF_8; | ||
|
||
String content = new String(Files.readAllBytes(path), charset); | ||
|
||
Pattern pattern = Pattern.compile("<version\\.org\\.springframework>(.*)</version\\.org\\.springframework>"); | ||
Matcher matcher = pattern.matcher(content); | ||
matcher.find(); | ||
return matcher.group(1); | ||
} | ||
} |
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,36 @@ | ||
import java.nio.charset.Charset; | ||
import java.nio.charset.StandardCharsets; | ||
import java.nio.file.Files; | ||
import java.nio.file.Path; | ||
import java.nio.file.Paths; | ||
import java.util.regex.Matcher; | ||
import java.util.regex.Pattern; | ||
|
||
class before { | ||
|
||
public static void main(String... args) throws Exception { | ||
String ver = getVer(); | ||
|
||
Path path = Paths.get("reference/en/en-US/modules/RESTEasy_Spring_Integration.xml"); | ||
Charset charset = StandardCharsets.UTF_8; | ||
|
||
String content = new String(Files.readAllBytes(path), charset); | ||
|
||
String token = "_SPRING_VER_"; | ||
|
||
content = content.replaceAll(token, ver); | ||
Files.write(path, content.getBytes(charset)); | ||
} | ||
|
||
public static String getVer() throws Exception { | ||
Path path = Paths.get("../resteasy-dependencies-bom/pom.xml"); | ||
Charset charset = StandardCharsets.UTF_8; | ||
|
||
String content = new String(Files.readAllBytes(path), charset); | ||
|
||
Pattern pattern = Pattern.compile("<version\\.org\\.springframework>(.*)</version\\.org\\.springframework>"); | ||
Matcher matcher = pattern.matcher(content); | ||
matcher.find(); | ||
return matcher.group(1); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.