Improve error reporting in the branch dialog
[egit/imyousuf.git] / org.spearce.egit.core / src / org / spearce / egit / core / internal / storage / WorkspaceFileRevision.java
blob6ab5bbcc9dc6fed97d7e8931ca9421286d6e192c
1 /*******************************************************************************
2 * Copyright (C) 2007, Robin Rosenberg <me@lathund.dewire.com>
3 * Copyright (C) 2006, Robin Rosenberg <robin.rosenberg@dewire.com>
4 * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>
6 * All rights reserved. This program and the accompanying materials
7 * are made available under the terms of the Eclipse Public License v1.0
8 * See LICENSE for the full license text, also available.
9 *******************************************************************************/
10 package org.spearce.egit.core.internal.storage;
12 import org.eclipse.core.resources.IResource;
13 import org.eclipse.core.resources.IStorage;
14 import org.eclipse.core.runtime.CoreException;
15 import org.eclipse.core.runtime.IProgressMonitor;
16 import org.eclipse.team.core.history.IFileRevision;
18 /** An {@link IFileRevision} for the current version in the workspace. */
19 class WorkspaceFileRevision extends GitFileRevision implements IFileRevision {
20 private final IResource rsrc;
22 WorkspaceFileRevision(final IResource resource) {
23 super(resource.getName());
24 rsrc = resource;
27 public IStorage getStorage(IProgressMonitor monitor) throws CoreException {
28 return rsrc instanceof IStorage ? (IStorage) rsrc : null;
31 public boolean isPropertyMissing() {
32 return false;
35 public IFileRevision withAllProperties(IProgressMonitor monitor)
36 throws CoreException {
37 return null;
40 public String getAuthor() {
41 return "";
44 public long getTimestamp() {
45 return -1;
48 public String getComment() {
49 return "";
52 public String getContentIdentifier() {
53 return WORKSPACE;