Examples of MimeDetector


Examples of eu.medsea.mimeutil.detector.MimeDetector

      log.warn("MimeDetector [" + mimeDetector + "] will not be registered as a MimeDetector with this name is already registered.");
      return (MimeDetector)mimeDetectors.get(mimeDetector);
    }
    // Create the mime detector if we can
    try {
      MimeDetector md = (MimeDetector)Class.forName(mimeDetector).newInstance();
      md.init();
      if(log.isDebugEnabled()) {
        log.debug("Registering MimeDetector with name [" + md.getName() + "] and description [" + md.getDescription() + "]");
      }
      mimeDetectors.put(mimeDetector, md);
      return md;
    }catch(Exception e) {
      log.error("Exception while registering MimeDetector [" + mimeDetector + "].", e);
View Full Code Here

Examples of eu.medsea.mimeutil.detector.MimeDetector

      // The TextMimeDetector will throw this if it decides
      // the content is not text
    }
    for(Iterator it  = mimeDetectors.values().iterator();it.hasNext();) {
      try {
        MimeDetector md = (MimeDetector)it.next();
        mimeTypes.addAll(md.getMimeTypes(data));
      }catch(UnsupportedOperationException ignore) {
        // We ignore this as it indicates that this MimeDetector does not support
        // Getting mime types from files
      }catch(Exception e) {
        log.error(e.getLocalizedMessage(), e);
View Full Code Here

Examples of eu.medsea.mimeutil.detector.MimeDetector

      // The TextMimeDetector will throw this if it decides
      // the content is not text
    }
    for(Iterator it  = mimeDetectors.values().iterator();it.hasNext();) {
      try {
        MimeDetector md = (MimeDetector)it.next();
        mimeTypes.addAll(md.getMimeTypes(fileName));
      }catch(UnsupportedOperationException usoe) {
        // We ignore this as it indicates that this MimeDetector does not support
        // Getting mime types from streams
      }catch(Exception e) {
        log.error(e.getLocalizedMessage(), e);
View Full Code Here

Examples of eu.medsea.mimeutil.detector.MimeDetector

      // The TextMimeDetector will throw this if it decides
      // the content is not text
    }
    for(Iterator it  = mimeDetectors.values().iterator();it.hasNext();) {
      try {
        MimeDetector md = (MimeDetector)it.next();
        mimeTypes.addAll(md.getMimeTypes(file));
      }catch(UnsupportedOperationException usoe) {
        // We ignore this as it indicates that this MimeDetector does not support
        // Getting mime types from streams
      }catch(Exception e) {
        log.error(e.getLocalizedMessage(), e);
View Full Code Here

Examples of eu.medsea.mimeutil.detector.MimeDetector

      // The TextMimeDetector will throw this if it decides
      // the content is not text
    }
    for(Iterator it  = mimeDetectors.values().iterator();it.hasNext();) {
      try {
        MimeDetector md = (MimeDetector)it.next();
        mimeTypes.addAll(md.getMimeTypes(in));
      }catch(UnsupportedOperationException usoe) {
        // We ignore this as it indicates that this MimeDetector does not support
        // Getting mime types from streams
      }catch(Exception e) {
        log.error(e.getLocalizedMessage(), e);
View Full Code Here

Examples of eu.medsea.mimeutil.detector.MimeDetector

      // The TextMimeDetector will throw this if it decides
      // the content is not text
    }
    for(Iterator it  = mimeDetectors.values().iterator();it.hasNext();) {
      try {
        MimeDetector md = (MimeDetector)it.next();
        mimeTypes.addAll(md.getMimeTypes(url));
      }catch(UnsupportedOperationException usoe) {
        // We ignore this as it indicates that this MimeDetector does not support
        // Getting mime types from streams
      }catch(Exception e) {
        log.error(e.getLocalizedMessage(), e);
View Full Code Here

Examples of eu.medsea.mimeutil.detector.MimeDetector

    }
    if(log.isDebugEnabled()) {
      log.debug("Unregistering MimeDetector [" + mimeDetector + "] from registry.");
    }
    try {
      MimeDetector md = (MimeDetector)mimeDetectors.get(mimeDetector);
      if(md != null) {
        md.delete();
        return (MimeDetector)mimeDetectors.remove(mimeDetector);
      }
    }catch(Exception e) {
      log.error("Exception while un-registering MimeDetector [" + mimeDetector + "].", e);
    }
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.