Here you can find the source of isJSON(final Path file)
public static boolean isJSON(final Path file)
//package com.java2s; //License from project: Open Source License import java.nio.file.Path; public class Main { public static boolean isJSON(final Path file) { if (getExtension(file).equals("png") || getExtension(file).equals("wav") || getExtension(file).equals("ogg") || getExtension(file).equals("txt") || getExtension(file).equals("lua") || getExtension(file).equals("ttf")) { return false; }//from w ww . j ava 2 s. c o m return true; } public static String getExtension(final Path path) { int i = path.toString().lastIndexOf("."); if (i >= 0) { return path.toString().substring(i + 1); } return ""; } }