1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.maven.plugins.shade.resource;
20
21 import java.io.IOException;
22 import java.io.InputStream;
23 import java.util.List;
24 import java.util.jar.JarOutputStream;
25
26 import org.apache.maven.plugins.shade.relocation.Relocator;
27
28
29
30
31
32 public class DontIncludeResourceTransformer extends AbstractCompatibilityTransformer {
33 String resource;
34
35 List<String> resources;
36
37 public boolean canTransformResource(String r) {
38 if ((resource != null && !resource.isEmpty()) && r.endsWith(resource)) {
39 return true;
40 }
41
42 if (resources != null) {
43 for (String resourceEnd : resources) {
44 if (r.endsWith(resourceEnd)) {
45 return true;
46 }
47 }
48 }
49
50 return false;
51 }
52
53 public void processResource(String resource, InputStream is, List<Relocator> relocators, long time)
54 throws IOException {
55
56 }
57
58 public boolean hasTransformedResource() {
59 return false;
60 }
61
62 public void modifyOutputStream(JarOutputStream os) throws IOException {
63
64 }
65 }