1 19 20 package org.netbeans.modules.apisupport.project; 21 22 import java.io.File ; 23 import junit.framework.TestCase; 24 25 29 public class InstalledFileLocatorImpl extends org.openide.modules.InstalledFileLocator { 30 private static File installDir; 31 32 33 36 public InstalledFileLocatorImpl() { 37 } 38 39 40 public File locate(String relativePath, String codeNameBase, boolean localized) { 41 String user = System.getProperty("netbeans.user"); 42 File f = new File (user + File.separator + relativePath); 43 if (f.exists()) { 44 return f; 45 } 46 47 File root = installDir; 48 if (root == null) { 49 return null; 50 } 51 52 File [] arr = installDir.listFiles(); 53 for (int i = 0; i < arr.length; i++) { 54 f = new File (arr[i], relativePath); 55 if (f.exists()) { 56 return f; 57 } 58 } 59 60 return null; 61 } 62 63 public static void registerDestDir(File file) { 64 installDir = file; 65 } 66 67 } 68 | Popular Tags |