Code example for Vector

Methods: size, toArray

0
		// FIXME dirty hack for backwards compatibility with old Infocalypse repo's 
		return INFOCALYPSE_DIRTY_HACK.matcher(mimeType).matches();
	} 
	 
	static String[] getMIMETypes() {
		return mimeTypesByNumber.toArray(new String[mimeTypesByNumber.size()]);
	} 
 
	/** Make sure the filename has the correct extension for the MIME type */ 
	public static String forceExtension(String s, String expectedMimeType) {
		int dotIdx = s.lastIndexOf('.');
		String ext = getExtension(expectedMimeType);
		if(ext == null)
			ext = "bin";
		if((dotIdx == -1) && (expectedMimeType != null)) {
			s += '.' + ext;
			return s;
		} 
		if(dotIdx != -1) {
			String oldExt = s.substring(dotIdx+1);
			if(DefaultMIMETypes.isValidExt(expectedMimeType, oldExt))