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