import java.io.File; import javax.activation.MimetypesFileTypeMap; public class TestMimeType { public static void main(String[] args) { String fileName = "C://bunny.mp4"; MimetypesFileTypeMap mimeTypesMap = new MimetypesFileTypeMap(); // only by file name String mimeType = mimeTypesMap.getContentType(fileName); // or by actual File instance File file = new File(fileName); mimeType = mimeTypesMap.getContentType(file); System.out.println(mimeType); } }
Friday, 14 June 2013
Thursday, 6 June 2013
for (var i = 0, keys = Object.keys(a_hashmap), ii = keys.length; i < ii; i++)
{
console.log('key : ' + keys[i] + ' val : ' + a_hashmap[keys[i]]);
}
{
console.log('key : ' + keys[i] + ' val : ' + a_hashmap[keys[i]]);
}
Subscribe to:
Posts (Atom)