diff --git a/proposal/myrmidon/src/java/org/apache/myrmidon/components/deployer/Deployment.java b/proposal/myrmidon/src/java/org/apache/myrmidon/components/deployer/Deployment.java index 99e1cd98d..9b4b1d23d 100644 --- a/proposal/myrmidon/src/java/org/apache/myrmidon/components/deployer/Deployment.java +++ b/proposal/myrmidon/src/java/org/apache/myrmidon/components/deployer/Deployment.java @@ -8,12 +8,14 @@ package org.apache.myrmidon.components.deployer; import java.io.File; -import java.net.URL; -import java.net.MalformedURLException; import java.io.IOException; +import java.net.MalformedURLException; +import java.net.URL; +import javax.xml.parsers.ParserConfigurationException; import javax.xml.parsers.SAXParser; import javax.xml.parsers.SAXParserFactory; -import javax.xml.parsers.ParserConfigurationException; +import org.apache.avalon.excalibur.i18n.ResourceManager; +import org.apache.avalon.excalibur.i18n.Resources; import org.apache.avalon.framework.configuration.Configuration; import org.apache.avalon.framework.configuration.ConfigurationException; import org.apache.avalon.framework.configuration.SAXConfigurationHandler; @@ -27,6 +29,9 @@ import org.xml.sax.XMLReader; */ public class Deployment { + private static final Resources REZ = + ResourceManager.getPackageResources( Deployment.class ); + public final static String DESCRIPTOR_NAME = "META-INF/ant-descriptor.xml"; private File m_file; @@ -55,7 +60,8 @@ public class Deployment try { return m_file.getCanonicalFile().toURL(); } catch( final IOException ioe ) { - throw new DeploymentException( "Unable to form url", ioe ); + final String message = REZ.getString( "bad-url.error", m_file ); + throw new DeploymentException( message, ioe ); } } @@ -80,16 +86,18 @@ public class Deployment } catch( final SAXException se ) { - throw new DeploymentException( "Malformed configuration data", se ); + final String message = REZ.getString( "bad-descriptor.error" ); + throw new DeploymentException( message, se ); } catch( final ParserConfigurationException pce ) { - throw new DeploymentException( "Error configuring parser", pce ); + final String message = REZ.getString( "bad-parser.error" ); + throw new DeploymentException( message, pce ); } catch( final IOException ioe ) { - throw new DeploymentException( "Error reading configuration", ioe ); + final String message = REZ.getString( "bad-read.error" ); + throw new DeploymentException( message, ioe ); } } } - diff --git a/proposal/myrmidon/src/java/org/apache/myrmidon/components/deployer/Resources.properties b/proposal/myrmidon/src/java/org/apache/myrmidon/components/deployer/Resources.properties index 4d47d1f84..508d95878 100644 --- a/proposal/myrmidon/src/java/org/apache/myrmidon/components/deployer/Resources.properties +++ b/proposal/myrmidon/src/java/org/apache/myrmidon/components/deployer/Resources.properties @@ -1,8 +1,8 @@ register-converter.notice=Registered converter {0} that converts from {1} to {2}. register-role.notice=Registered {0}/{1} as {2}. - url-deploy.notice=Deploying {0}. file-deploy.notice=Deploying AntLib file ({0}). + deploy-lib.error=Error deploying library from {0}. deploy-converter.error=Failed to deploy {0} converter. bad-descriptor.error=Malformed descriptor. @@ -10,4 +10,8 @@ deploy-type.error=Failed to deploy {0} type. unknown-name4role.error=RoleManager does not know name for role {0}. unknown-role4name.error=RoleManager does not know role for name {0}. no-file.error=Could not find application archive at {0}. -file-is-dir.error=Could not find application archive at {0} as it is a directory. \ No newline at end of file +file-is-dir.error=Could not find application archive at {0} as it is a directory. + +bad-url.error=Unable to form url from file {0}. +bad-parser.error=Error configuring parser. +bad-read.error=Error reading configuration. \ No newline at end of file