01: package org.columba.mail.spam.spamassassin;
02:
03: import java.io.File;
04: import java.net.MalformedURLException;
05: import java.net.URL;
06:
07: import org.columba.core.base.OSInfo;
08: import org.columba.core.gui.externaltools.AbstractExternalToolsPlugin;
09:
10: /**
11: * @author fdietz
12: */
13: public class SpamAssassinExternalToolPlugin extends
14: AbstractExternalToolsPlugin {
15: protected static URL websiteURL;
16:
17: static {
18: try {
19: websiteURL = new URL("http://www.spamassassin.org/");
20: } catch (MalformedURLException mue) {
21: }
22: //does not happen
23: }
24:
25: File defaultLinux = new File("/usr/bin/spamassassin");
26: File defaultLocalLinux = new File("/usr/local/bin/spamassassin");
27:
28: public SpamAssassinExternalToolPlugin() {
29: super ();
30: }
31:
32: public String getDescription() {
33: return "<html><body><p>spamassassin - mail filter to identify spam using text analysis</p></body></html>";
34: }
35:
36: public URL getWebsite() {
37: return websiteURL;
38: }
39:
40: public File locate() {
41: /*
42: * If this is a unix-based system, check the 2 best-known areas for the
43: * aspell binary.
44: */
45: if (OSInfo.isLinux() || OSInfo.isSolaris()) {
46: if (defaultLinux.exists()) {
47: return defaultLinux;
48: } else if (defaultLocalLinux.exists()) {
49: return defaultLocalLinux;
50: }
51: }
52:
53: return null;
54: }
55: }
|