Examples of MimetypesFileTypeMap


Examples of javax.activation.MimetypesFileTypeMap

          return;
        }

        String filename = file.getAbsolutePath();
        Long size = file.length();
        String contentType = new MimetypesFileTypeMap().getContentType( file );
        Boolean enabled = new Boolean( true );
        Boolean cached = retval;

        boolean added = false;
View Full Code Here

Examples of javax.activation.MimetypesFileTypeMap

    this.domain = domain;
    this.siteName = siteName;
    service = new SitesService(applicationName);

    // Common mime types
    mediaTypes = new MimetypesFileTypeMap();
    mediaTypes.addMimeTypes("application/msword doc");
    mediaTypes.addMimeTypes("application/vnd.ms-excel xls");
    mediaTypes.addMimeTypes("application/pdf pdf");
    mediaTypes.addMimeTypes("text/richtext rtx");
    mediaTypes.addMimeTypes("text/csv csv");
View Full Code Here

Examples of javax.activation.MimetypesFileTypeMap

          logger.trace("Loading Java Activation Framework FileTypeMap from " + resource);
        }
        InputStream inputStream = null;
        try {
          inputStream = resource.getInputStream();
          return new MimetypesFileTypeMap(inputStream);
        }
        catch (IOException ex) {
          // ignore
        }
        finally {
View Full Code Here

Examples of javax.activation.MimetypesFileTypeMap

   * @throws IOException if resource access failed
   * @see javax.activation.MimetypesFileTypeMap#MimetypesFileTypeMap(java.io.InputStream)
   * @see javax.activation.MimetypesFileTypeMap#addMimeTypes(String)
   */
  protected FileTypeMap createFileTypeMap(Resource mappingLocation, String[] mappings) throws IOException {
    MimetypesFileTypeMap fileTypeMap = null;
    if (mappingLocation != null) {
      InputStream is = mappingLocation.getInputStream();
      try {
        fileTypeMap = new MimetypesFileTypeMap(is);
      }
      finally {
        is.close();
      }
    }
    else {
      fileTypeMap = new MimetypesFileTypeMap();
    }
    if (mappings != null) {
      for (String mapping : mappings) {
        fileTypeMap.addMimeTypes(mapping);
      }
    }
    return fileTypeMap;
  }
View Full Code Here

Examples of javax.activation.MimetypesFileTypeMap

      Resource mappingLocation = new ClassPathResource("org/springframework/mail/javamail/mime.types");
      if (mappingLocation.exists()) {
        InputStream inputStream = null;
        try {
          inputStream = mappingLocation.getInputStream();
          return new MimetypesFileTypeMap(inputStream);
        }
        catch (IOException ex) {
          // ignore
        }
        finally {
View Full Code Here

Examples of javax.activation.MimetypesFileTypeMap

      Resource mappingLocation = new ClassPathResource("org/springframework/mail/javamail/mime.types");
      if (mappingLocation.exists()) {
        InputStream inputStream = null;
        try {
          inputStream = mappingLocation.getInputStream();
          return new MimetypesFileTypeMap(inputStream);
        }
        catch (IOException ex) {
          // ignore
        }
        finally {
View Full Code Here

Examples of javax.activation.MimetypesFileTypeMap

          logger.trace("Loading Java Activation Framework FileTypeMap from " + mappingLocation);
        }
        InputStream inputStream = null;
        try {
          inputStream = mappingLocation.getInputStream();
          return new MimetypesFileTypeMap(inputStream);
        }
        catch (IOException ex) {
          // ignore
        }
        finally {
View Full Code Here

Examples of javax.activation.MimetypesFileTypeMap

      Resource mappingLocation = new ClassPathResource("org/springframework/mail/javamail/mime.types");
      if (mappingLocation.exists()) {
        InputStream inputStream = null;
        try {
          inputStream = mappingLocation.getInputStream();
          return new MimetypesFileTypeMap(inputStream);
        }
        catch (IOException ex) {
          // ignore
        }
        finally {
View Full Code Here

Examples of javax.activation.MimetypesFileTypeMap

  private static Logger logger = Logger.getLogger(EmailHelper.class);
  private static MimetypesFileTypeMap mimetypes=getMimeTypesFile();

  private static MimetypesFileTypeMap getMimeTypesFile() {
    MimetypesFileTypeMap mimetypestemp=null;
    try {
      mimetypestemp=new MimetypesFileTypeMap(EmailHelper.class.getResource("/com/aesthete/swingobjects/resources/mime.types").getFile());
    } catch (IOException e) {
      logger.error(e);
    }
    return mimetypestemp;
  }
View Full Code Here

Examples of javax.activation.MimetypesFileTypeMap

          parts[i++] = new StringPart(entry.getName(),
              (String) entry.getValue());
        }
      }
      FilePart filePart = new FilePart(fileParamName, file.getName(),
          file, new MimetypesFileTypeMap().getContentType(file),
          "UTF-8");
      filePart.setTransferEncoding("binary");
      parts[parts.length - 1] = filePart;

      postMethod.setRequestEntity(new MultipartRequestEntity(parts,
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.