Java tutorial
//package com.java2s; //License from project: LGPL import java.util.Arrays; import java.util.List; public class Main { private static final List<String> TEXT_EXTENSIONS = Arrays.asList(("log,msg,pages,tex,txt,wpd,wps,abw,bib," + "dotx,dwd,eml,fdx,gdoc,lst,sig,sty,wps,wpt,aim,ans,asc,ase,aww,bad,bdp,bdr,bean,bib,bna," + "boc,btd,bzabw,charset,chord,cnm,crwl,cyi,diz,dne,doc,docm,dotm,dvi,dx,eio,emlx," + "emulecollection,err,etf,fadein,fbl,fcf,fdr,fdt,fdxt,flr,fodt,fountain,fpt,frt,gpd,gsd," + "gthr,gv,hht,hs,hwp,idx,ipspot,kes,klg,klg,knt,kon,kwd,lbt,lis,lnt,lp2,lst,ltx,luf,lwp," + "lxfml,lyx,mbox,md5,txt,mell,mellel,mnt,mwd,mwp,nb,nfo,njx,notes,nwp,ofl,ott,p7s,pages-tef," + "pjt,plantuml,psw,pu,pwd,pwi,qdl,qpf,readme,ris,rpt,rst,rtd,rtfd,rzk,rzn,safetext,scriv," + "scrivx,sct,scw,sdw,sgm,sla,sla,gz,sms,ssa,story,strings,sub,sublime-project,sublime-workspace," + "sxw,tab,tdf,tdf,template,text,textclipping,tmd,u3i,unauth,unx,uot,utf8,utxt,vct,webdoc," + "wpa,wpd,xbdoc,xdl,xdl,xwp,xwp,xy3,xyp,xyw,zabw,zrtf,1st,act,apt,asc,aty,awp,awt,bbs,bml," + "brx,chart,cod,cws,dgs,dropbox,dsv,dxb,dxp,eit,emf,epp,err,fadein,template,fdf,fds,gmd," + "gpn,hbk,hz,jis,min,mw,ndoc,ngloss,nwctxt,nwm,ocr,odm,ort,pfs,pfx,pmo,prt,pvj,pvm,pwdp," + "pwdpl,pwr,rtx,run,sam,sam,scc,scm,sdm,se,session,skcard,smf,stw,sxg,tab,tlb,tm,tmv,tpc," + "trelby,tvj,uof,vnt,wbk,wp,wp4,wp5,wp7,wpt,wri,xbplate,ascii,dca,docxml,docz,dox,dsc," + "etx,euc,faq,fft,fwdn,hwp,iil,ipf,jarvis,joe,jp1,jrtf,latex,ltr,lue,lyt,man,mcw,me,now," + "odif,odo,openbsd,prt,rad,rft,saf,save,sdoc,thp,upd,vw,wn,wp6,wpd,wpl,wpw,wsd,wtx,xwp," + "xy,zw,prop,rc,conf,bak,idc,kcm,kl").split(",")); private static boolean isText(String ext) { for (String s : TEXT_EXTENSIONS) { if (s.equalsIgnoreCase(ext)) return true; } return false; } }