Examples of MailcapFile


Examples of com.sun.activation.registries.MailcapFile

    private MailcapFile loadResource(String name) {
        InputStream clis = null;
        try {
            clis = SecuritySupport.getResourceAsStream(this.getClass(), name);
            if (clis != null) {
                MailcapFile mf = new MailcapFile(clis);
                if (LogSupport.isLoggable())
                    LogSupport.log("MailcapCommandMap: successfully loaded " +
                        "mailcap file: " + name);
                return mf;
            } else {
View Full Code Here

Examples of com.sun.activation.registries.MailcapFile

                    if (LogSupport.isLoggable())
                        LogSupport.log("MailcapCommandMap: URL " + url);
                    try {
                        clis = SecuritySupport.openStream(url);
                        if (clis != null) {
                            v.add(new MailcapFile(clis));
                            anyLoaded = true;
                            if (LogSupport.isLoggable())
                                LogSupport.log("MailcapCommandMap: " +
                                    "successfully loaded " +
                                    "mailcap file from URL: " +
                                    url);
                        } else {
                            if (LogSupport.isLoggable())
                                LogSupport.log("MailcapCommandMap: " +
                                    "not loading mailcap " +
                                    "file from URL: " + url);
                        }
                    } catch (IOException ioex) {
                        if (LogSupport.isLoggable())
                            LogSupport.log("MailcapCommandMap: can't load " +
                                                url, ioex);
                    } catch (SecurityException sex) {
                        if (LogSupport.isLoggable())
                            LogSupport.log("MailcapCommandMap: can't load " +
                                                url, sex);
                    } finally {
                        try {
                            if (clis != null)
                                clis.close();
                        } catch (IOException cex) { }
                    }
                }
            }
        } catch (Exception ex) {
            if (LogSupport.isLoggable())
                LogSupport.log("MailcapCommandMap: can't load " + name, ex);
        }

        // if failed to load anything, fall back to old technique, just in case
        if (!anyLoaded) {
            if (LogSupport.isLoggable())
                LogSupport.log("MailcapCommandMap: !anyLoaded");
            MailcapFile mf = loadResource("/" + name);
            if (mf != null)
                v.add(mf);
        }
    }
View Full Code Here

Examples of com.sun.activation.registries.MailcapFile

    /**
     * Load from the named file.
     */
    private MailcapFile loadFile(String name) {
        MailcapFile mtf = null;

        try {
            mtf = new MailcapFile(name);
        } catch (IOException e) {
            //  e.printStackTrace();
        }
        return mtf;
    }
View Full Code Here

Examples of com.sun.activation.registries.MailcapFile

        this();

        if (LogSupport.isLoggable())
            LogSupport.log("MailcapCommandMap: load PROG from " + fileName);
        if (DB[PROG] == null) {
            DB[PROG] = new MailcapFile(fileName);
        }
    }
View Full Code Here

Examples of com.sun.activation.registries.MailcapFile

        this();

        LogSupport.log("MailcapCommandMap: load PROG");
        if (DB[PROG] == null) {
            try {
                DB[PROG] = new MailcapFile(is);
            } catch (IOException ex) {
                // XXX - should throw it
            }
        }
    }
View Full Code Here

Examples of com.sun.activation.registries.MailcapFile

     */
    public synchronized void addMailcap(String mail_cap) {
        // check to see if one exists
        LogSupport.log("MailcapCommandMap: add to PROG");
        if (DB[PROG] == null)
            DB[PROG] = new MailcapFile();

        DB[PROG].appendToMailcap(mail_cap);
    }
View Full Code Here

Examples of com.sun.activation.registries.MailcapFile

/*     */   private static final int PROG = 0;
/*     */
/*     */   public MailcapCommandMap()
/*     */   {
/* 136 */     List dbv = new ArrayList(5);
/* 137 */     MailcapFile mf = null;
/* 138 */     dbv.add(null);
/*     */
/* 140 */     LogSupport.log("MailcapCommandMap: load HOME");
/*     */     try {
/* 142 */       String user_home = System.getProperty("user.home");
View Full Code Here

Examples of com.sun.activation.registries.MailcapFile

/*     */   {
/* 184 */     InputStream clis = null;
/*     */     try {
/* 186 */       clis = SecuritySupport.getResourceAsStream(getClass(), name);
/* 187 */       if (clis != null) {
/* 188 */         MailcapFile mf = new MailcapFile(clis);
/* 189 */         if (LogSupport.isLoggable()) {
/* 190 */           LogSupport.log("MailcapCommandMap: successfully loaded mailcap file: " + name);
/*     */         }
/* 192 */         MailcapFile localMailcapFile1 = mf;
/*     */         return localMailcapFile1;
/*     */       }
/* 194 */       if (LogSupport.isLoggable())
/* 195 */         LogSupport.log("MailcapCommandMap: not loading mailcap file: " + name);
/*     */     }
View Full Code Here

Examples of com.sun.activation.registries.MailcapFile

/* 235 */           if (LogSupport.isLoggable())
/* 236 */             LogSupport.log("MailcapCommandMap: URL " + url);
/*     */           try {
/* 238 */             clis = SecuritySupport.openStream(url);
/* 239 */             if (clis != null) {
/* 240 */               v.add(new MailcapFile(clis));
/* 241 */               anyLoaded = true;
/* 242 */               if (LogSupport.isLoggable()) {
/* 243 */                 LogSupport.log("MailcapCommandMap: successfully loaded mailcap file from URL: " + url);
/*     */               }
/*     */
/*     */             }
/* 248 */             else if (LogSupport.isLoggable()) {
/* 249 */               LogSupport.log("MailcapCommandMap: not loading mailcap file from URL: " + url);
/*     */             }
/*     */           }
/*     */           catch (IOException cex)
/*     */           {
/* 254 */             if (LogSupport.isLoggable())
/* 255 */               LogSupport.log("MailcapCommandMap: can't load " + url, ioex);
/*     */           }
/*     */           catch (SecurityException cex) {
/* 258 */             if (LogSupport.isLoggable())
/* 259 */               LogSupport.log("MailcapCommandMap: can't load " + url, sex);
/*     */           }
/*     */           finally {
/*     */             try {
/* 263 */               if (clis != null)
/* 264 */                 clis.close();
/*     */             } catch (IOException cex) {
/*     */             }
/*     */           }
/*     */         }
/*     */       }
/*     */     } catch (Exception ex) {
/* 270 */       if (LogSupport.isLoggable()) {
/* 271 */         LogSupport.log("MailcapCommandMap: can't load " + name, ex);
/*     */       }
/*     */     }
/*     */
/* 275 */     if (!anyLoaded) {
/* 276 */       if (LogSupport.isLoggable())
/* 277 */         LogSupport.log("MailcapCommandMap: !anyLoaded");
/* 278 */       MailcapFile mf = loadResource("/" + name);
/* 279 */       if (mf != null)
/* 280 */         v.add(mf);
/*     */     }
/*     */   }
View Full Code Here

Examples of com.sun.activation.registries.MailcapFile

/*     */     }
/*     */   }
/*     */
/*     */   private MailcapFile loadFile(String name)
/*     */   {
/* 288 */     MailcapFile mtf = null;
/*     */     try
/*     */     {
/* 291 */       mtf = new MailcapFile(name);
/*     */     }
/*     */     catch (IOException e) {
/*     */     }
/* 295 */     return mtf;
/*     */   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.