DataFlavor: getMimeType() : DataFlavor « java.awt.datatransfer « Java by API






DataFlavor: getMimeType()

/*
Mime type: text/plain; class=java.io.InputStream; charset=ASCII
Primary type: text
Subtype: plain
Parameter: ASCII
Name: Plain ASCII text
Representation class: class java.io.InputStream

*/

import java.awt.datatransfer.DataFlavor;

public class MainClass {

  public static void main(String[] args) {

    DataFlavor df = new DataFlavor("text/plain; charset=ASCII", "Plain ASCII text");

    System.out.println("Mime type: " + df.getMimeType());
    System.out.println("Primary type: " + df.getPrimaryType());
    System.out.println("Subtype: " + df.getSubType());
    System.out.println("Parameter: " + df.getParameter("charset"));
    System.out.println("Name: " + df.getHumanPresentableName());
    String s = df.getRepresentationClass().toString();
    System.out.println("Representation class: " + s + "\n");

  }
}


           
       








Related examples in the same category

1.DataFlavor.javaFileListFlavor
2.DataFlavor.stringFlavor
3.new DataFlavor(String mimeType, String humanPresentableName)
4.new DataFlavor(Class representationClass, String humanPresentableName)
5.DataFlavor: getHumanPresentableName()
6.DataFlavor: getParameter(String paramName)
7.DataFlavor: getPrimaryType()
8.DataFlavor: getRepresentationClass()
9.DataFlavor: getSubType()
10.DataFlavor: isMimeTypeEqual(DataFlavor dataFlavor)