1 package org.apache.maven.plugin.assembly.filter;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import org.codehaus.plexus.components.io.fileselectors.FileInfo;
23
24
25
26
27
28 public class MetaInfSpringHandler
29 extends AbstractLineAggregatingHandler
30 {
31
32 private static final String SPRING_PATH_PREFIX = "META-INF/";
33
34 @Override
35 protected String getOutputPathPrefix( final FileInfo fileInfo )
36 {
37 return SPRING_PATH_PREFIX;
38 }
39
40 @Override
41 protected boolean fileMatches( final FileInfo fileInfo )
42 {
43 final String path = fileInfo.getName();
44
45 String leftover = null;
46 if ( path.startsWith( "/META-INF/spring." ) )
47 {
48 leftover = path.substring( "/META-INF/spring.".length() );
49 }
50 else if ( path.startsWith( "META-INF/spring." ) )
51 {
52 leftover = path.substring( "META-INF/spring.".length() - 1 );
53 }
54
55 return leftover != null && leftover.length() > 0;
56 }
57
58 }