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