blob: 0ab709d4f81b0a840b8294044b57b0a60a7a0b8e (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
/*******************************************************************************
* Copyright (C) 2007, Robin Rosenberg <me@lathund.dewire.com>
* Copyright (C) 2006, Robin Rosenberg <robin.rosenberg@dewire.com>
* Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*******************************************************************************/
package org.eclipse.egit.core.internal.storage;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IStorage;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.team.core.history.IFileRevision;
/** An {@link IFileRevision} for the current version in the workspace. */
public class WorkspaceFileRevision extends GitFileRevision {
private final IResource rsrc;
/**
* @param resource
*/
public WorkspaceFileRevision(final IResource resource) {
super(resource.getLocation().toString());
rsrc = resource;
}
public IStorage getStorage(IProgressMonitor monitor) throws CoreException {
return rsrc instanceof IStorage ? (IStorage) rsrc : null;
}
public boolean isPropertyMissing() {
return false;
}
public String getAuthor() {
return ""; //$NON-NLS-1$
}
public long getTimestamp() {
return -1;
}
public String getComment() {
return ""; //$NON-NLS-1$
}
public String getContentIdentifier() {
return WORKSPACE;
}
}
|