Remove System.out.println from RevWalkFilterTest
[jgit.git] / org.spearce.egit.core / src / org / spearce / egit / core / GitProvider.java
blobdb3a85727ed06aa95ce812a6f5ec26fea32ea5d5
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 * See LICENSE for the full license text, also available.
8 *******************************************************************************/
9 package org.spearce.egit.core;
11 import org.eclipse.core.resources.IResourceRuleFactory;
12 import org.eclipse.core.resources.team.IMoveDeleteHook;
13 import org.eclipse.core.resources.team.ResourceRuleFactory;
14 import org.eclipse.core.runtime.CoreException;
15 import org.eclipse.team.core.RepositoryProvider;
16 import org.eclipse.team.core.history.IFileHistoryProvider;
17 import org.spearce.egit.core.internal.storage.GitFileHistoryProvider;
18 import org.spearce.egit.core.project.GitProjectData;
20 /**
21 * The Team provider class for a Git repository.
23 public class GitProvider extends RepositoryProvider {
24 private GitProjectData data;
26 private GitMoveDeleteHook hook;
28 private GitFileHistoryProvider historyProvider;
30 private final IResourceRuleFactory resourceRuleFactory = new GitResourceRuleFactory();
32 public String getID() {
33 return getClass().getName();
36 public void configureProject() throws CoreException {
37 getData().markTeamPrivateResources();
40 public void deconfigure() throws CoreException {
41 GitProjectData.delete(getProject());
44 public boolean canHandleLinkedResources() {
45 return true;
48 @Override
49 public boolean canHandleLinkedResourceURI() {
50 return true;
53 public synchronized IMoveDeleteHook getMoveDeleteHook() {
54 if (hook == null) {
55 GitProjectData _data = getData();
56 if (_data != null)
57 hook = new GitMoveDeleteHook(_data);
59 return hook;
62 /**
63 * @return information about the mapping of an Eclipse project
64 * to a Git repository.
66 public synchronized GitProjectData getData() {
67 if (data == null) {
68 data = GitProjectData.get(getProject());
70 return data;
73 public synchronized IFileHistoryProvider getFileHistoryProvider() {
74 if (historyProvider == null) {
75 historyProvider = new GitFileHistoryProvider();
77 return historyProvider;
80 @Override
81 public IResourceRuleFactory getRuleFactory() {
82 return resourceRuleFactory;
85 private static class GitResourceRuleFactory extends ResourceRuleFactory {
86 // Use the default rule factory instead of the
87 // pessimistic one by default.