package com.limegroup.gnutella.malware; import java.io.File; import java.io.IOException; import java.util.Scanner; import org.limewire.util.CommonUtils; import com.limegroup.gnutella.util.LimeWireUtils; class VirusUtils { static File getLicenseFile() { return new File("lib/avg/license"); } static File getDatabaseDirectory() { assert !LimeWireUtils.isTemporaryDirectoryInUse(); return new File(CommonUtils.getUserSettingsDir(), "avg/database"); } static File getTemporaryDirectory() { assert !LimeWireUtils.isTemporaryDirectoryInUse(); return new File(CommonUtils.getUserSettingsDir(), "avg/temp"); } static String getNfoValue(File nfo, String key) throws IOException { Scanner scanner = null; try { scanner = new Scanner(nfo); while(scanner.hasNextLine()) { String line = scanner.nextLine(); String[] keyValue = line.split(":"); if(keyValue.length != 2) continue; String k = keyValue[0].trim(); String v = keyValue[1].trim(); if(k.equals(key)) return v; } throw new IOException("Key not found"); } finally { if(scanner != null) scanner.close(); } } }