Skip to content

Commit d73d156

Browse files
committed
Added DelegatingArchvier and NoOpArchiver
1 parent 7f39bb1 commit d73d156

File tree

2 files changed

+564
-0
lines changed

2 files changed

+564
-0
lines changed
Lines changed: 280 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,280 @@
1+
package org.codehaus.plexus.archiver.diags;
2+
3+
/*
4+
* Copyright 2014 The Codehaus Foundation.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
import org.codehaus.plexus.archiver.ArchiveEntry;
20+
import org.codehaus.plexus.archiver.ArchivedFileSet;
21+
import org.codehaus.plexus.archiver.Archiver;
22+
import org.codehaus.plexus.archiver.ArchiverException;
23+
import org.codehaus.plexus.archiver.FileSet;
24+
import org.codehaus.plexus.archiver.ResourceIterator;
25+
import org.codehaus.plexus.components.io.resources.PlexusIoResource;
26+
import org.codehaus.plexus.components.io.resources.PlexusIoResourceCollection;
27+
28+
import javax.annotation.Nonnull;
29+
import java.io.File;
30+
import java.io.IOException;
31+
import java.util.Map;
32+
33+
@SuppressWarnings( { "UnusedDeclaration", "deprecation" } )
34+
public class DelgatingArchiver implements Archiver
35+
{
36+
private final Archiver target;
37+
38+
public DelgatingArchiver( Archiver target )
39+
{
40+
this.target = target;
41+
}
42+
43+
public void createArchive()
44+
throws ArchiverException, IOException
45+
{
46+
target.createArchive();
47+
}
48+
49+
@Deprecated
50+
public void addDirectory( @Nonnull File directory )
51+
throws ArchiverException
52+
{
53+
target.addDirectory( directory );
54+
}
55+
56+
@Deprecated
57+
public void addDirectory( @Nonnull File directory, String prefix )
58+
throws ArchiverException
59+
{
60+
target.addDirectory( directory, prefix );
61+
}
62+
63+
@Deprecated
64+
public void addDirectory( @Nonnull File directory, String[] includes, String[] excludes )
65+
throws ArchiverException
66+
{
67+
target.addDirectory( directory, includes, excludes );
68+
}
69+
70+
public void addDirectory( @Nonnull File directory, String prefix, String[] includes, String[] excludes )
71+
throws ArchiverException
72+
{
73+
target.addDirectory( directory, prefix, includes, excludes );
74+
}
75+
76+
public void addFileSet( @Nonnull FileSet fileSet )
77+
throws ArchiverException
78+
{
79+
target.addFileSet( fileSet );
80+
}
81+
82+
public void addSymlink( String symlinkName, String symlinkDestination )
83+
throws ArchiverException
84+
{
85+
target.addSymlink( symlinkName, symlinkDestination );
86+
}
87+
88+
public void addSymlink( String symlinkName, int permissions, String symlinkDestination )
89+
throws ArchiverException
90+
{
91+
target.addSymlink( symlinkName, permissions, symlinkDestination );
92+
}
93+
94+
public void addFile( @Nonnull File inputFile, @Nonnull String destFileName )
95+
throws ArchiverException
96+
{
97+
target.addFile( inputFile, destFileName );
98+
}
99+
100+
public void addFile( @Nonnull File inputFile, @Nonnull String destFileName, int permissions )
101+
throws ArchiverException
102+
{
103+
target.addFile( inputFile, destFileName, permissions );
104+
}
105+
106+
public void addArchivedFileSet( @Nonnull File archiveFile )
107+
throws ArchiverException
108+
{
109+
target.addArchivedFileSet( archiveFile );
110+
}
111+
112+
@Deprecated
113+
public void addArchivedFileSet( @Nonnull File archiveFile, String prefix )
114+
throws ArchiverException
115+
{
116+
target.addArchivedFileSet( archiveFile, prefix );
117+
}
118+
119+
public void addArchivedFileSet( File archiveFile, String[] includes, String[] excludes )
120+
throws ArchiverException
121+
{
122+
target.addArchivedFileSet( archiveFile, includes, excludes );
123+
}
124+
125+
public void addArchivedFileSet( @Nonnull File archiveFile, String prefix, String[] includes, String[] excludes )
126+
throws ArchiverException
127+
{
128+
target.addArchivedFileSet( archiveFile, prefix, includes, excludes );
129+
}
130+
131+
public void addArchivedFileSet( ArchivedFileSet fileSet )
132+
throws ArchiverException
133+
{
134+
target.addArchivedFileSet( fileSet );
135+
}
136+
137+
public void addResource( PlexusIoResource resource, String destFileName, int permissions )
138+
throws ArchiverException
139+
{
140+
target.addResource( resource, destFileName, permissions );
141+
}
142+
143+
public void addResources( PlexusIoResourceCollection resources )
144+
throws ArchiverException
145+
{
146+
target.addResources( resources );
147+
}
148+
149+
public File getDestFile()
150+
{
151+
return target.getDestFile();
152+
}
153+
154+
public void setDestFile( File destFile )
155+
{
156+
target.setDestFile( destFile );
157+
}
158+
159+
public void setFileMode( int mode )
160+
{
161+
target.setFileMode( mode );
162+
}
163+
164+
public int getFileMode()
165+
{
166+
return target.getFileMode();
167+
}
168+
169+
public int getOverrideFileMode()
170+
{
171+
return target.getOverrideFileMode();
172+
}
173+
174+
public void setDefaultFileMode( int mode )
175+
{
176+
target.setDefaultFileMode( mode );
177+
}
178+
179+
public int getDefaultFileMode()
180+
{
181+
return target.getDefaultFileMode();
182+
}
183+
184+
public void setDirectoryMode( int mode )
185+
{
186+
target.setDirectoryMode( mode );
187+
}
188+
189+
public int getDirectoryMode()
190+
{
191+
return target.getDirectoryMode();
192+
}
193+
194+
public int getOverrideDirectoryMode()
195+
{
196+
return target.getOverrideDirectoryMode();
197+
}
198+
199+
public void setDefaultDirectoryMode( int mode )
200+
{
201+
target.setDefaultDirectoryMode( mode );
202+
}
203+
204+
public int getDefaultDirectoryMode()
205+
{
206+
return target.getDefaultDirectoryMode();
207+
}
208+
209+
public boolean getIncludeEmptyDirs()
210+
{
211+
return target.getIncludeEmptyDirs();
212+
}
213+
214+
public void setIncludeEmptyDirs( boolean includeEmptyDirs )
215+
{
216+
target.setIncludeEmptyDirs( includeEmptyDirs );
217+
}
218+
219+
public void setDotFileDirectory( File dotFileDirectory )
220+
{
221+
target.setDotFileDirectory( dotFileDirectory );
222+
}
223+
224+
@Nonnull
225+
public ResourceIterator getResources()
226+
throws ArchiverException
227+
{
228+
return target.getResources();
229+
}
230+
231+
public Map<String, ArchiveEntry> getFiles()
232+
{
233+
return target.getFiles();
234+
}
235+
236+
public boolean isForced()
237+
{
238+
return target.isForced();
239+
}
240+
241+
public void setForced( boolean forced )
242+
{
243+
target.setForced( forced );
244+
}
245+
246+
public boolean isSupportingForced()
247+
{
248+
return target.isSupportingForced();
249+
}
250+
251+
public String getDuplicateBehavior()
252+
{
253+
return target.getDuplicateBehavior();
254+
}
255+
256+
public void setDuplicateBehavior( String duplicate )
257+
{
258+
target.setDuplicateBehavior( duplicate );
259+
}
260+
261+
public void setUseJvmChmod( boolean useJvmChmod )
262+
{
263+
target.setUseJvmChmod( useJvmChmod );
264+
}
265+
266+
public boolean isUseJvmChmod()
267+
{
268+
return target.isUseJvmChmod();
269+
}
270+
271+
public boolean isIgnorePermissions()
272+
{
273+
return target.isIgnorePermissions();
274+
}
275+
276+
public void setIgnorePermissions( boolean ignorePermissions )
277+
{
278+
target.setIgnorePermissions( ignorePermissions );
279+
}
280+
}

0 commit comments

Comments
 (0)