1 11 package org.eclipse.core.resources.team; 12 13 import java.net.URI ; 14 import org.eclipse.core.filesystem.EFS; 15 import org.eclipse.core.filesystem.URIUtil; 16 import org.eclipse.core.internal.resources.InternalTeamHook; 17 import org.eclipse.core.resources.*; 18 import org.eclipse.core.runtime.*; 19 20 35 public abstract class TeamHook extends InternalTeamHook { 36 44 protected final IResourceRuleFactory defaultFactory = new ResourceRuleFactory(); 45 46 50 protected TeamHook() { 51 super(); 52 } 53 54 74 public IResourceRuleFactory getRuleFactory(IProject project) { 75 return defaultFactory; 76 } 77 78 99 protected final void setRuleFactory(IProject project, IResourceRuleFactory factory) { 100 super.setRuleFactory(project, factory); 101 } 102 103 129 public IStatus validateCreateLink(IFile file, int updateFlags, IPath location) { 130 return Status.OK_STATUS; 131 } 132 133 160 public IStatus validateCreateLink(IFile file, int updateFlags, URI location) { 161 if (EFS.SCHEME_FILE.equals(location.getScheme())) 163 return validateCreateLink(file, updateFlags, URIUtil.toPath(location)); 164 return Status.OK_STATUS; 165 } 166 167 193 public IStatus validateCreateLink(IFolder folder, int updateFlags, IPath location) { 194 return Status.OK_STATUS; 195 } 196 197 224 public IStatus validateCreateLink(IFolder folder, int updateFlags, URI location) { 225 if (EFS.SCHEME_FILE.equals(location.getScheme())) 227 return validateCreateLink(folder, updateFlags, URIUtil.toPath(location)); 228 return Status.OK_STATUS; 229 } 230 } 231 | Popular Tags |