Monday, March 25, 2013

How to get Mime Type in simple way.



Call method
getMimeType("file://" + dosPath)


public static String getMimeType(String fileUrl) throws java.io.IOException, MalformedURLException {
              String type = null;
              URL u = new URL(fileUrl);
              URLConnection uc = null;
              uc = u.openConnection();
              type = uc.getContentType();
              return type;
}

Java Quick Program

1. Write a Code to generate Random numbers public class GenerateRandomNumbers { public static void main(String[] args) { System.out...