File tree 4 files changed +40
-3
lines changed
src/main/java/org/codehaus/plexus/archiver
4 files changed +40
-3
lines changed Original file line number Diff line number Diff line change 23
23
import org .codehaus .plexus .archiver .ArchiveEntry ;
24
24
import org .codehaus .plexus .archiver .ArchiverException ;
25
25
import org .codehaus .plexus .archiver .ResourceIterator ;
26
+ import org .codehaus .plexus .archiver .exceptions .EmptyArchiveException ;
26
27
import org .codehaus .plexus .archiver .util .ArchiveEntryUtils ;
27
28
import org .codehaus .plexus .archiver .util .ResourceUtils ;
28
29
import org .codehaus .plexus .components .io .attributes .SymlinkUtils ;
@@ -53,7 +54,7 @@ public void execute()
53
54
final ResourceIterator iter = getResources ();
54
55
if ( !iter .hasNext () )
55
56
{
56
- throw new ArchiverException ( "You must set at least one file." );
57
+ throw new EmptyArchiveException ( "You must set at least one file." );
57
58
}
58
59
59
60
final File destDirectory = getDestFile ();
Original file line number Diff line number Diff line change
1
+ /**
2
+ * Copyright 2004 The Apache Software Foundation
3
+ * <p/>
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
+ * <p/>
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ * <p/>
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 .exceptions ;
17
+
18
+ import org .codehaus .plexus .archiver .ArchiverException ;
19
+
20
+ public class EmptyArchiveException
21
+ extends ArchiverException
22
+ {
23
+
24
+ public EmptyArchiveException (String message )
25
+ {
26
+ super ( message );
27
+ }
28
+
29
+ public EmptyArchiveException (String message , Throwable cause )
30
+ {
31
+ super ( message , cause );
32
+ }
33
+
34
+ }
Original file line number Diff line number Diff line change 30
30
import org .codehaus .plexus .archiver .ArchiveEntry ;
31
31
import org .codehaus .plexus .archiver .ArchiverException ;
32
32
import org .codehaus .plexus .archiver .ResourceIterator ;
33
+ import org .codehaus .plexus .archiver .exceptions .EmptyArchiveException ;
33
34
import org .codehaus .plexus .archiver .util .ResourceUtils ;
34
35
import org .codehaus .plexus .archiver .util .Streams ;
35
36
import org .codehaus .plexus .components .io .attributes .PlexusIoResourceAttributes ;
@@ -110,7 +111,7 @@ protected void execute()
110
111
ResourceIterator iter = getResources ();
111
112
if ( !iter .hasNext () )
112
113
{
113
- throw new ArchiverException ( "You must set at least one file." );
114
+ throw new EmptyArchiveException ( "You must set at least one file." );
114
115
}
115
116
116
117
File tarFile = getDestFile ();
Original file line number Diff line number Diff line change 40
40
import org .codehaus .plexus .archiver .ArchiverException ;
41
41
import org .codehaus .plexus .archiver .ResourceIterator ;
42
42
import org .codehaus .plexus .archiver .UnixStat ;
43
+ import org .codehaus .plexus .archiver .exceptions .EmptyArchiveException ;
43
44
import org .codehaus .plexus .archiver .util .ResourceUtils ;
44
45
import org .codehaus .plexus .components .io .functions .SymlinkDestinationSupplier ;
45
46
import org .codehaus .plexus .components .io .resources .PlexusIoResource ;
@@ -254,7 +255,7 @@ private void createArchiveMain()
254
255
ResourceIterator iter = getResources ();
255
256
if ( !iter .hasNext () && !hasVirtualFiles () )
256
257
{
257
- throw new ArchiverException ( "You must set at least one file." );
258
+ throw new EmptyArchiveException ( "You must set at least one file." );
258
259
}
259
260
260
261
zipFile = getDestFile ();
You can’t perform that action at this time.
0 commit comments