Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPatchSupport.java
More file actions
Latest commit
36 lines (28 loc) · 1.03 KB
/
Copy pathPatchSupport.java
File metadata and controls
36 lines (28 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
packagecom.kdeveloper.utils;
importcom.kdgdev.nxt.utils.FileUtils;
importcom.kdgdev.nxt.utils.IOUtils;
importjava.io.File;
importjava.io.FileInputStream;
importjava.io.IOException;
importjava.nio.charset.Charset;
importjava.util.ArrayList;
importjava.util.List;
importjava.util.regex.Matcher;
importjava.util.regex.Pattern;
/**
* Created by kirill on 29.08.14.
*/
publicclassPatchSupport {
publicstaticList<String> getPatchList(Filein, FilegitDir) throwsIOException {
List<String> fileLines = IOUtils.readLines(newFileInputStream(in), Charset.forName("UTF-8"));
List<String> patchList = newArrayList<>();
PatternmainPattern = Pattern.compile("include\\s+\\\"(.*)\\\"\\s{0,}\\;");
for(Stringline : fileLines) {
Matchermatcher = mainPattern.matcher(line);
if(matcher.matches()) {
patchList.add(FileUtils.fixSeparator(matcher.group(1).replace("%translation_dir%", gitDir.getCanonicalPath())));
}
}
returnpatchList;
}
}