File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
src/main/java/generateimages Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change 15
15
public class Main {
16
16
private static final String URL_REGEX = "(https?://[\\ w-]+(\\ .[\\ w-]+)+(/[^\\ s)]*)?)" ;
17
17
private static final Pattern PATTERN = Pattern .compile (URL_REGEX );
18
+ private static final String GROUP_AND_SOLUTION_REGEX = "(g[^\\ \\ ]+\\ \\ s[^\\ \\ ]+)" ;
19
+ private static final Pattern PATTERN_G_AND_S = Pattern .compile (GROUP_AND_SOLUTION_REGEX );
18
20
19
21
private static void fillFilesRecursively (Path directory , final List <File > resultFiles )
20
22
throws IOException {
@@ -64,6 +66,11 @@ public static void main(String[] args) throws IOException, InterruptedException
64
66
ImageDownloader .downloadImage (
65
67
matcher .group (1 ), file .getParent () + "/" + fileName );
66
68
}
69
+ Matcher matcher2 = PATTERN_G_AND_S .matcher (file .getAbsolutePath ());
70
+ if (matcher2 .find ()) {
71
+ fileName = "https://leetcode-in-java.github.io/src/main/java/"
72
+ + matcher2 .group (1 ).replace ("\\ " , "/" ) + "/" + fileName ;
73
+ }
67
74
matcher .appendReplacement (builder , fileName );
68
75
}
69
76
}
You can’t perform that action at this time.
0 commit comments