@@ -51,11 +51,11 @@ public AbstractSingleArchiveResourceSet() {
5151 * @param base The base
5252 * @param internalPath The internal path
5353 *
54- * @throws IllegalArgumentException if the {@link WebResourceRoot} is available but this resource set cannot be
54+ * @throws IllegalStateException if the {@link WebResourceRoot} is available but this resource set cannot be
5555 * started
5656 */
5757 public AbstractSingleArchiveResourceSet (WebResourceRoot root , String webAppMount , String base , String internalPath )
58- throws IllegalArgumentException {
58+ throws IllegalStateException {
5959 setRoot (root );
6060 setWebAppMount (webAppMount );
6161 setBase (base );
@@ -65,7 +65,7 @@ public AbstractSingleArchiveResourceSet(WebResourceRoot root, String webAppMount
6565 try {
6666 start ();
6767 } catch (LifecycleException e ) {
68- throw new IllegalStateException (e );
68+ throw new IllegalStateException (sm . getString ( "abstractArchiveResourceSet.startFail" ), e );
6969 }
7070 }
7171 }
@@ -87,7 +87,8 @@ protected Map<String,JarEntry> getArchiveEntries(boolean single) {
8787 } catch (IOException ioe ) {
8888 // Should never happen
8989 archiveEntries = null ;
90- throw new IllegalStateException (ioe );
90+ throw new IllegalStateException (
91+ sm .getString ("abstractArchiveResourceSet.archiveEntriesFail" , getBase ()), ioe );
9192 } finally {
9293 if (jarFile != null ) {
9394 closeJarFile ();
@@ -107,7 +108,8 @@ protected JarEntry getArchiveEntry(String pathInArchive) {
107108 return jarFile .getJarEntry (pathInArchive );
108109 } catch (IOException ioe ) {
109110 // Should never happen
110- throw new IllegalStateException (ioe );
111+ throw new IllegalStateException (
112+ sm .getString ("abstractArchiveResourceSet.archiveEntryFail" , getBase ()), ioe );
111113 } finally {
112114 if (jarFile != null ) {
113115 closeJarFile ();
@@ -127,7 +129,8 @@ protected boolean isMultiRelease() {
127129 multiRelease = Boolean .valueOf (jarFile .isMultiRelease ());
128130 } catch (IOException ioe ) {
129131 // Should never happen
130- throw new IllegalStateException (ioe );
132+ throw new IllegalStateException (
133+ sm .getString ("abstractArchiveResourceSet.multiReleaseFail" , getBase ()), ioe );
131134 } finally {
132135 if (jarFile != null ) {
133136 closeJarFile ();
@@ -148,13 +151,15 @@ protected void initInternal() throws LifecycleException {
148151 try (JarFile jarFile = new JarFile (new File (getBase ()), true , ZipFile .OPEN_READ , Runtime .version ())) {
149152 setManifest (jarFile .getManifest ());
150153 } catch (IOException ioe ) {
151- throw new IllegalArgumentException (ioe );
154+ throw new LifecycleException (
155+ sm .getString ("abstractArchiveResourceSet.manifestFail" , getBase ()), ioe );
152156 }
153157
154158 try {
155159 setBaseUrl (UriUtil .buildJarSafeUrl (new File (getBase ())));
156160 } catch (IOException ioe ) {
157- throw new IllegalArgumentException (ioe );
161+ throw new LifecycleException (
162+ sm .getString ("abstractArchiveResourceSet.baseUrlFail" , getBase ()), ioe );
158163 }
159164 }
160165}
0 commit comments