Thanks Prasanna, I think the loader might have changed since you created
this diff, but I can see your change and will commit this tonight.
Serge Knystautas
Loki Technologies
http://www.lokitech.com/
----- Original Message -----
From: "Prasanna Uppaladadium" <[EMAIL PROTECTED]>
To: "Java Apache Mail Server" <[EMAIL PROTECTED]>
Sent: Monday, October 09, 2000 12:24 PM
Subject: Small patch for MailetLoader.java
> Hi,
>
> I am new on this list and I hope this is the right place to submit
> patches. If not, I apologize in advance.
>
> I was writing my own mailet when I found that it is necessary to provide
> a "." at the end of each package name in the <mailetpackages> section
> (in James.xml.conf). IMO the code should take care of whether or not a
> "." is placed at the end of the package name.
>
> I have added that code to the getMailet(String, MailetContext) method in
> org.apache.james.transport.MailetLoader. It is quite likely that the fix
> is already made in CVS.
>
> Hope the patch helps.
>
> ================== Begin patch =======================
>
> public Mailet getMailet(String mailetName, MailetContext context) throws
> Exception {
> for (int i = 0; i < mailetPackages.size(); i++) {
> String className = null;
> String mailetPackage = (String)mailetPackages.elementAt(i);
>
> if(mailetPackage != null) {
> if(mailetPackage.length() > 0 &&
> mailetPackage.charAt(mailetPackage.length() - 1) == '.') {
> className = mailetPackageName + mailetName;
> } else {
> className = mailetPackageName + "." + mailetName;
> }
> } else {
> className = mailetName; // Default unnamed package.
> }
>
> try {
> AbstractMailet mailet = (AbstractMailet)
> Class.forName(className).newInstance();
> mailet.setMailetContext(context);
> mailet.init();
> return mailet;
> } catch (ClassNotFoundException cnfe) {
> //do this so we loop through all the packages
> }
> }
> throw new ClassNotFoundException("Requested mailet not
> found: " + mailetName +
> ". looked in " + mailetPackages.toString());
> }
>
> =============== End patch ==================
>
> Thanks,
> Prasanna.
>
>
>
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Archives: <http://www.mail-archive.com/james%40list.working-dogs.com/>
Problems?: [EMAIL PROTECTED]