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 @Override
38 public boolean canTransformResource(String r) {
39 if ((resource != null && !resource.isEmpty()) && r.endsWith(resource)) {
40 return true;
41 }
42
43 if (resources != null) {
44 for (String resourceEnd : resources) {
45 if (r.endsWith(resourceEnd)) {
46 return true;
47 }
48 }
49 }
50
51 return false;
52 }
53
54 @Override
55 public void processResource(String resource, InputStream is, List<Relocator> relocators, long time)
56 throws IOException {
57
58 }
59
60 @Override
61 public boolean hasTransformedResource() {
62 return false;
63 }
64
65 @Override
66 public void modifyOutputStream(JarOutputStream os) throws IOException {
67
68 }
69 }