Correct reference to EPL in source headers
[egit/chris.git] / org.eclipse.egit.core / src / org / eclipse / egit / core / GitProvider.java
blobd646c15f44108d5c69d5bad7557f7e2a8e992e22
1 /*******************************************************************************
2 * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>
3 * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>
5 * All rights reserved. This program and the accompanying materials
6 * are made available under the terms of the Eclipse Public License v1.0
7 * which accompanies this distribution, and is available at
8 * http://www.eclipse.org/legal/epl-v10.html
9 *******************************************************************************/
10 package org.eclipse.egit.core;
12 import org.eclipse.core.resources.IResourceRuleFactory;
13 import org.eclipse.core.resources.team.IMoveDeleteHook;
14 import org.eclipse.core.resources.team.ResourceRuleFactory;
15 import org.eclipse.core.runtime.CoreException;
16 import org.eclipse.egit.core.internal.storage.GitFileHistoryProvider;
17 import org.eclipse.egit.core.project.GitProjectData;
18 import org.eclipse.team.core.RepositoryProvider;
19 import org.eclipse.team.core.history.IFileHistoryProvider;
21 /**
22 * The Team provider class for a Git repository.
24 public class GitProvider extends RepositoryProvider {
25 private GitProjectData data;
27 private GitMoveDeleteHook hook;
29 private GitFileHistoryProvider historyProvider;
31 private final IResourceRuleFactory resourceRuleFactory = new GitResourceRuleFactory();
33 public String getID() {
34 return getClass().getName();
37 public void configureProject() throws CoreException {
38 getData().markTeamPrivateResources();
41 public void deconfigure() throws CoreException {
42 GitProjectData.delete(getProject());
45 public boolean canHandleLinkedResources() {
46 return true;
49 @Override
50 public boolean canHandleLinkedResourceURI() {
51 return true;
54 public synchronized IMoveDeleteHook getMoveDeleteHook() {
55 if (hook == null) {
56 GitProjectData _data = getData();
57 if (_data != null)
58 hook = new GitMoveDeleteHook(_data);
60 return hook;
63 /**
64 * @return information about the mapping of an Eclipse project
65 * to a Git repository.
67 public synchronized GitProjectData getData() {
68 if (data == null) {
69 data = GitProjectData.get(getProject());
71 return data;
74 public synchronized IFileHistoryProvider getFileHistoryProvider() {
75 if (historyProvider == null) {
76 historyProvider = new GitFileHistoryProvider();
78 return historyProvider;
81 @Override
82 public IResourceRuleFactory getRuleFactory() {
83 return resourceRuleFactory;
86 private static class GitResourceRuleFactory extends ResourceRuleFactory {
87 // Use the default rule factory instead of the
88 // pessimistic one by default.