File tree Expand file tree Collapse file tree 4 files changed +40
-3
lines changed
src/main/java/org/codehaus/plexus/archiver Expand file tree Collapse file tree 4 files changed +40
-3
lines changed Original file line number Diff line number Diff line change 2323import org .codehaus .plexus .archiver .ArchiveEntry ;
2424import org .codehaus .plexus .archiver .ArchiverException ;
2525import org .codehaus .plexus .archiver .ResourceIterator ;
26+ import org .codehaus .plexus .archiver .exceptions .EmptyArchiveException ;
2627import org .codehaus .plexus .archiver .util .ArchiveEntryUtils ;
2728import org .codehaus .plexus .archiver .util .ResourceUtils ;
2829import org .codehaus .plexus .components .io .attributes .SymlinkUtils ;
@@ -53,7 +54,7 @@ public void execute()
5354 final ResourceIterator iter = getResources ();
5455 if ( !iter .hasNext () )
5556 {
56- throw new ArchiverException ( "You must set at least one file." );
57+ throw new EmptyArchiveException ( "You must set at least one file." );
5758 }
5859
5960 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 3030import org .codehaus .plexus .archiver .ArchiveEntry ;
3131import org .codehaus .plexus .archiver .ArchiverException ;
3232import org .codehaus .plexus .archiver .ResourceIterator ;
33+ import org .codehaus .plexus .archiver .exceptions .EmptyArchiveException ;
3334import org .codehaus .plexus .archiver .util .ResourceUtils ;
3435import org .codehaus .plexus .archiver .util .Streams ;
3536import org .codehaus .plexus .components .io .attributes .PlexusIoResourceAttributes ;
@@ -110,7 +111,7 @@ protected void execute()
110111 ResourceIterator iter = getResources ();
111112 if ( !iter .hasNext () )
112113 {
113- throw new ArchiverException ( "You must set at least one file." );
114+ throw new EmptyArchiveException ( "You must set at least one file." );
114115 }
115116
116117 File tarFile = getDestFile ();
Original file line number Diff line number Diff line change 4040import org .codehaus .plexus .archiver .ArchiverException ;
4141import org .codehaus .plexus .archiver .ResourceIterator ;
4242import org .codehaus .plexus .archiver .UnixStat ;
43+ import org .codehaus .plexus .archiver .exceptions .EmptyArchiveException ;
4344import org .codehaus .plexus .archiver .util .ResourceUtils ;
4445import org .codehaus .plexus .components .io .functions .SymlinkDestinationSupplier ;
4546import org .codehaus .plexus .components .io .resources .PlexusIoResource ;
@@ -254,7 +255,7 @@ private void createArchiveMain()
254255 ResourceIterator iter = getResources ();
255256 if ( !iter .hasNext () && !hasVirtualFiles () )
256257 {
257- throw new ArchiverException ( "You must set at least one file." );
258+ throw new EmptyArchiveException ( "You must set at least one file." );
258259 }
259260
260261 zipFile = getDestFile ();
You can’t perform that action at this time.
0 commit comments