1 | |
package org.apache.maven.plugin.assembly.archive.archiver; |
2 | |
|
3 | |
import org.codehaus.plexus.archiver.Archiver; |
4 | |
import org.codehaus.plexus.archiver.ArchiverException; |
5 | |
|
6 | |
import java.io.File; |
7 | |
import java.io.IOException; |
8 | |
import java.util.Map; |
9 | |
|
10 | |
public class PrefixingProxyArchiver |
11 | |
implements Archiver |
12 | |
{ |
13 | |
|
14 | |
private Archiver delegate; |
15 | |
private String rootPrefix; |
16 | |
|
17 | |
public PrefixingProxyArchiver( String rootPrefix, Archiver delegate ) |
18 | 0 | { |
19 | 0 | this.rootPrefix = rootPrefix; |
20 | 0 | this.delegate = delegate; |
21 | |
|
22 | 0 | if ( !rootPrefix.endsWith( "/" ) ) |
23 | |
{ |
24 | 0 | this.rootPrefix += "/"; |
25 | |
} |
26 | 0 | } |
27 | |
|
28 | |
public void addArchivedFileSet( File archiveFile, String prefix, String[] includes, String[] excludes ) |
29 | |
throws ArchiverException |
30 | |
{ |
31 | 0 | delegate.addArchivedFileSet( archiveFile, rootPrefix + prefix, includes, excludes ); |
32 | 0 | } |
33 | |
|
34 | |
public void addArchivedFileSet( File archiveFile, String prefix ) |
35 | |
throws ArchiverException |
36 | |
{ |
37 | 0 | delegate.addArchivedFileSet( archiveFile, rootPrefix + prefix ); |
38 | 0 | } |
39 | |
|
40 | |
public void addArchivedFileSet( File archiveFile, String[] includes, String[] excludes ) |
41 | |
throws ArchiverException |
42 | |
{ |
43 | 0 | delegate.addArchivedFileSet( archiveFile, rootPrefix, includes, excludes ); |
44 | 0 | } |
45 | |
|
46 | |
public void addArchivedFileSet( File archiveFile ) |
47 | |
throws ArchiverException |
48 | |
{ |
49 | 0 | delegate.addArchivedFileSet( archiveFile, rootPrefix ); |
50 | 0 | } |
51 | |
|
52 | |
public void addDirectory( File directory, String prefix, String[] includes, String[] excludes ) |
53 | |
throws ArchiverException |
54 | |
{ |
55 | 0 | delegate.addDirectory( directory, rootPrefix + prefix, includes, excludes ); |
56 | 0 | } |
57 | |
|
58 | |
public void addDirectory( File directory, String prefix ) |
59 | |
throws ArchiverException |
60 | |
{ |
61 | 0 | delegate.addDirectory( directory, rootPrefix + prefix ); |
62 | 0 | } |
63 | |
|
64 | |
public void addDirectory( File directory, String[] includes, String[] excludes ) |
65 | |
throws ArchiverException |
66 | |
{ |
67 | 0 | delegate.addDirectory( directory, rootPrefix, includes, excludes ); |
68 | 0 | } |
69 | |
|
70 | |
public void addDirectory( File directory ) |
71 | |
throws ArchiverException |
72 | |
{ |
73 | 0 | delegate.addDirectory( directory, rootPrefix ); |
74 | 0 | } |
75 | |
|
76 | |
public void addFile( File inputFile, String destFileName, int permissions ) |
77 | |
throws ArchiverException |
78 | |
{ |
79 | 0 | delegate.addFile( inputFile, rootPrefix + destFileName, permissions ); |
80 | 0 | } |
81 | |
|
82 | |
public void addFile( File inputFile, String destFileName ) |
83 | |
throws ArchiverException |
84 | |
{ |
85 | 0 | delegate.addFile( inputFile, rootPrefix + destFileName ); |
86 | 0 | } |
87 | |
|
88 | |
public void createArchive() |
89 | |
throws ArchiverException, IOException |
90 | |
{ |
91 | 0 | delegate.createArchive(); |
92 | 0 | } |
93 | |
|
94 | |
public int getDefaultDirectoryMode() |
95 | |
{ |
96 | 0 | return delegate.getDefaultDirectoryMode(); |
97 | |
} |
98 | |
|
99 | |
public int getDefaultFileMode() |
100 | |
{ |
101 | 0 | return delegate.getDefaultFileMode(); |
102 | |
} |
103 | |
|
104 | |
public File getDestFile() |
105 | |
{ |
106 | 0 | return delegate.getDestFile(); |
107 | |
} |
108 | |
|
109 | |
public Map getFiles() |
110 | |
{ |
111 | 0 | return delegate.getFiles(); |
112 | |
} |
113 | |
|
114 | |
public boolean getIncludeEmptyDirs() |
115 | |
{ |
116 | 0 | return delegate.getIncludeEmptyDirs(); |
117 | |
} |
118 | |
|
119 | |
public boolean isForced() |
120 | |
{ |
121 | 0 | return delegate.isForced(); |
122 | |
} |
123 | |
|
124 | |
public boolean isSupportingForced() |
125 | |
{ |
126 | 0 | return delegate.isSupportingForced(); |
127 | |
} |
128 | |
|
129 | |
public void setDefaultDirectoryMode( int mode ) |
130 | |
{ |
131 | 0 | delegate.setDefaultDirectoryMode( mode ); |
132 | 0 | } |
133 | |
|
134 | |
public void setDefaultFileMode( int mode ) |
135 | |
{ |
136 | 0 | delegate.setDefaultFileMode( mode ); |
137 | 0 | } |
138 | |
|
139 | |
public void setDestFile( File destFile ) |
140 | |
{ |
141 | 0 | delegate.setDestFile( destFile ); |
142 | 0 | } |
143 | |
|
144 | |
public void setForced( boolean forced ) |
145 | |
{ |
146 | 0 | delegate.setForced( forced ); |
147 | 0 | } |
148 | |
|
149 | |
public void setIncludeEmptyDirs( boolean includeEmptyDirs ) |
150 | |
{ |
151 | 0 | delegate.setIncludeEmptyDirs( includeEmptyDirs ); |
152 | 0 | } |
153 | |
|
154 | |
public void setDotFileDirectory( File dotFileDirectory ) |
155 | |
{ |
156 | 0 | throw new UnsupportedOperationException( "Undocumented feature of plexus-archiver; this is not yet supported." ); |
157 | |
} |
158 | |
|
159 | |
} |