donaldp     01/08/28 23:32:52

  Modified:    
proposal/myrmidon/src/java/org/apache/myrmidon/components/deployer
                        Deployment.java Resources.properties
  Log:
  More i18n.
  
  Revision  Changes    Path
  1.6       +16 -8     
jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/components/deployer/Deployment.java
  
  Index: Deployment.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/components/deployer/Deployment.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Deployment.java   2001/06/10 12:52:38     1.5
  +++ Deployment.java   2001/08/29 06:32:52     1.6
  @@ -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 @@
    */
   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 @@
           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 @@
           }
           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 );
           }
       }
   }
  -
  
  
  
  1.2       +6 -2      
jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/components/deployer/Resources.properties
  
  Index: Resources.properties
  ===================================================================
  RCS file: 
/home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/components/deployer/Resources.properties,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Resources.properties      2001/08/29 06:28:26     1.1
  +++ Resources.properties      2001/08/29 06:32:52     1.2
  @@ -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 @@
   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
  
  
  

Reply via email to