1 11 12 package org.eclipse.core.internal.resources; 13 14 import org.eclipse.core.filesystem.EFS; 15 import org.eclipse.core.filesystem.IFileStore; 16 import org.eclipse.core.internal.localstore.*; 17 import org.eclipse.core.internal.properties.*; 18 import org.eclipse.core.internal.utils.Policy; 19 import org.eclipse.core.resources.ResourcesPlugin; 20 import org.eclipse.core.runtime.IPath; 21 import org.eclipse.core.runtime.IStatus; 22 23 28 public class ResourcesCompatibility { 29 39 public static IHistoryStore createHistoryStore(IPath location, int limit, boolean newImpl, boolean convert, boolean rename) { 40 Workspace workspace = (Workspace) ResourcesPlugin.getWorkspace(); 41 if (!newImpl) 42 return new HistoryStore(workspace, location, limit); 44 IFileStore store = EFS.getLocalFileSystem().getStore(location); 45 HistoryStore2 newHistoryStore = new HistoryStore2(workspace, store, limit); 46 if (!convert) 47 return newHistoryStore; 49 IStatus result = new HistoryStoreConverter().convertHistory(workspace, location, limit, newHistoryStore, rename); 50 if (result.getSeverity() != IStatus.OK) 52 Policy.log(result); 53 return newHistoryStore; 54 } 55 62 public static IPropertyManager createPropertyManager(boolean newImpl, boolean convert) { 63 Workspace workspace = (Workspace) ResourcesPlugin.getWorkspace(); 64 if (!newImpl) 65 return new PropertyManager(workspace); 67 PropertyManager2 newPropertyManager = new PropertyManager2(workspace); 68 if (!convert) 69 return newPropertyManager; 71 IStatus result = new PropertyStoreConverter().convertProperties(workspace, newPropertyManager); 73 if (result.getSeverity() != IStatus.OK) 74 Policy.log(result); 76 return newPropertyManager; 77 } 78 } 79 | Popular Tags |