Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: LGPL 

import java.util.Arrays;

import java.util.List;

public class Main {
    private static final List<String> ARCHIVE_EXTENSIONS = Arrays
            .asList(("7z,cbr,deb,gz,pkg,rar,rpm,sitx,tar,gz,zip,zipx,alz,bz,"
                    + "bz2,cbz,mpkg,pet,sfx,sit,tgz,war,0,7z,001,7z,002,ace,apz,ar,arc,archiver,asr,b1,b64,ba,"
                    + "bndl,bzip,c00,c01,cba,cbt,comppkg,hauptwerk,rar,cp9,cpgz,cxarchive,czip,dar,dgc,dist,"
                    + "dl_,ecs,efw,egg,f,gca,gmz,gzip,hbc,hki,hki1,hki2,hki3,ice,ipg,ipk,ita,jgz,jic,kgb,"
                    + "layout,lbr,lha,lnx,lqr,lz,lzm,lzma,lzo,mint,mzp,mzp,nex,package,pae,pak,paq6,paq7,par,"
                    + "par2,pbi,pea,pf,piz,psz,pup,pup,pwa,qda,r00,r01,rar5,rp9,rte,rz,s00,s01,s02,s7z,sar,"
                    + "sdc,sea,sfs,sh,shr,smpf,sqx,tar,lzma,taz,tbz,tz,uha,vem,vsi,xar,xef,xmcdz,z,z01,"
                    + "zfsendtotarget,zz,a00,a01,a02,agg,arh,arj,bh,boo,bundle,c02,c10,cb7,cdz,"
                    + "comppkg_hauptwerk_rar,cpt,dd,dz,epi,fdp,fp8,gz2,gzi,hbc2,hbe,ize,lemon,lzh,lzx,mou,oar,"
                    + "oz,p01,p19,pack,gz,paq8,paq8l,pax,pcv,puz,r0,r02,r03,r1,r2,r21,r30,rev,rk,rnc,sbx,sdn,"
                    + "sen,shar,snb,srep,sy_,tar,gz2,tar,xz,tbz2,tlz,tlzma,trs,txz,tx_,ufs,uzip,uzip,xx,xz,y,"
                    + "z02,z03,z04,zix,zoo,zsplit,000,ain,ari,ark,bza,bzip2,car,gza,ha,hpk,hyp,ish,j,jar,pack,"
                    + "kz,md,paq8f,paq8p,pim,pit,shk,spt,tg,uc2,wot,xez,yz,yz1,zap,zi,zl,zpi").split(","));

    private static boolean isArchive(String ext) {
        for (String s : ARCHIVE_EXTENSIONS) {
            if (s.equalsIgnoreCase(ext))
                return true;
        }
        return false;
    }
}