1 19 20 package org.netbeans.modules.projectimport.eclipse; 21 22 import java.io.File ; 23 import org.netbeans.modules.projectimport.ProjectImporterException; 24 import org.openide.filesystems.FileUtil; 25 26 33 public final class WorkspaceFactory { 34 35 36 private static WorkspaceFactory instance = new WorkspaceFactory(); 37 38 private WorkspaceFactory() {} 39 40 public static WorkspaceFactory getInstance() { 41 return instance; 42 } 43 44 50 public Workspace load(String workspaceDir) throws ProjectImporterException { 51 if (workspaceDir != null) { 52 return load(FileUtil.normalizeFile(new File (workspaceDir))); 53 } 54 return null; 55 } 56 57 63 public Workspace load(File workspaceDir) throws ProjectImporterException { 64 Workspace workspace = Workspace.createWorkspace(workspaceDir); 65 if (workspace != null) { 66 WorkspaceParser parser = new WorkspaceParser(workspace); 67 parser.parse(); 68 } 69 return workspace; 70 } 71 } 72 | Popular Tags |