Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private static String contentType(String fileName)
- {
- if (fileName.endsWith(".htm") || fileName.endsWith(".html"))
- {
- return "text/html";
- }
- if (fileName.endsWith(".jpg") || fileName.endsWith(".jpeg"))
- {
- return "image/jpeg";
- }
- if (fileName.endsWith(".gif"))
- {
- return "image/gif";
- }
- if (fileName.endsWith(".txt"))
- {
- return "text/plain";
- }
- if (fileName.endsWith(".pdf"))
- {
- return "application/pdf";
- }
- return "application/octet-stream";
- }
Add Comment
Please, Sign In to add comment