package com.limegroup.gnutella.malware; class DangerousFileType { // The mime type of ASF files private static final String ASF_TYPE = "video/x-ms-asf"; // Known file extensions of ASF files private static final String[] ASF_EXTENSIONS = { "asf", "wm", "wma", "wmv" }; // The mime type of EXE files private static final String EXE_TYPE = "application/x-dosexec"; // Known file extensions of EXE files private static final String[] EXE_EXTENSIONS = { // I've found and tested examples of the following extensions "acm", "ax", "com", "cpl", "dll", "drv", "exe", "fon", "ocx", "scr", "sys", // I haven't found examples of the following extensions, but see // http://www.garykessler.net/library/file_sigs.html "386", "pif", "qts", "qtx", "vbx", "vxd" }; final String mimeType; final String[] extensions; DangerousFileType(String mimeType, String[] extensions) { this.mimeType = mimeType; this.extensions = extensions; } /** * Returns an array of known file types, which may be empty but not null. */ protected static DangerousFileType[] getKnownTypes() { return new DangerousFileType[] { // Add known file types here new DangerousFileType(ASF_TYPE, ASF_EXTENSIONS), new DangerousFileType(EXE_TYPE, EXE_EXTENSIONS) }; } }