org.eclipse.mylyn.versions.core_0.9.1.v20120425-0100

16:47:01.342 INFO  jd.cli.Main - Decompiling org.eclipse.mylyn.versions.core_0.9.1.v20120425-0100.jar
package org.eclipse.mylyn.versions.core.spi;

import java.util.Map;

public abstract interface ScmInfoAttributes
{
  public abstract Map<String, String> getInfoAtrributes();
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.versions.core.spi.ScmInfoAttributes
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.versions.core.spi;

import java.util.Iterator;
import java.util.List;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.mylyn.versions.core.ChangeSet;
import org.eclipse.mylyn.versions.core.ScmArtifact;
import org.eclipse.mylyn.versions.core.ScmRepository;
import org.eclipse.team.core.history.IFileRevision;

public abstract class ScmConnector
{
  public abstract ScmArtifact getArtifact(IResource paramIResource, String paramString)
    throws CoreException;
  
  public ScmArtifact getArtifact(IResource resource)
    throws CoreException
  {
    return getArtifact(resource, null);
  }
  
  public abstract ChangeSet getChangeSet(ScmRepository paramScmRepository, IFileRevision paramIFileRevision, IProgressMonitor paramIProgressMonitor)
    throws CoreException;
  
  public abstract List<ChangeSet> getChangeSets(ScmRepository paramScmRepository, IProgressMonitor paramIProgressMonitor)
    throws CoreException;
  
  public Iterator<ChangeSet> getChangeSetsIterator(ScmRepository repository, IProgressMonitor monitor)
  {
    throw new UnsupportedOperationException();
  }
  
  public abstract String getProviderId();
  
  public abstract List<ScmRepository> getRepositories(IProgressMonitor paramIProgressMonitor)
    throws CoreException;
  
  public abstract ScmRepository getRepository(IResource paramIResource, IProgressMonitor paramIProgressMonitor)
    throws CoreException;
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.versions.core.spi.ScmConnector
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.versions.core.spi;

import java.net.URI;
import java.util.ArrayList;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.ResourcesPlugin;

public class ScmResourceUtils
{
  public static IProject[] getProjects()
  {
    IWorkspace root = ResourcesPlugin.getWorkspace();
    IProject[] projects = root.getRoot().getProjects();
    return projects;
  }
  
  public static IProject getProject(String name)
  {
    IWorkspace root = ResourcesPlugin.getWorkspace();
    IProject[] projects = root.getRoot().getProjects();
    IProject project = null;
    if (projects != null)
    {
      IProject[] arrayOfIProject1;
      int j = (arrayOfIProject1 = projects).length;
      for (int i = 0; i < j; i++)
      {
        IProject project2 = arrayOfIProject1[i];
        project = project2;
        if (project.getName().equals(name)) {
          return project;
        }
      }
    }
    return null;
  }
  
  public static IFile getWorkSpaceFile(URI aFilePathURI, IProject aProject)
  {
    IFile[] files = getWorkSpaceFiles(aFilePathURI);
    IFile[] arrayOfIFile1;
    int j = (arrayOfIFile1 = files).length;
    for (int i = 0; i < j; i++)
    {
      IFile iFile = arrayOfIFile1[i];
      if (iFile.getProject().equals(aProject)) {
        return iFile;
      }
    }
    return null;
  }
  
  public static IFile[] getWorkSpaceFiles(URI filePathURI)
  {
    IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
    
    IFile[] files = null;
    if (filePathURI != null) {
      files = filterNonExistentFiles(root.findFilesForLocationURI(filePathURI));
    }
    return files;
  }
  
  private static IFile[] filterNonExistentFiles(IFile[] files)
  {
    if (files == null) {
      return null;
    }
    int length = files.length;
    ArrayList<IFile> existentFiles = new ArrayList(length);
    for (int i = 0; i < length; i++) {
      if (files[i].exists()) {
        existentFiles.add(files[i]);
      } else if (files[i].getType() == 1) {
        existentFiles.add(files[i]);
      }
    }
    return (IFile[])existentFiles.toArray(new IFile[existentFiles.size()]);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.versions.core.spi.ScmResourceUtils
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.versions.core.spi;

import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.mylyn.versions.core.ScmArtifact;
import org.eclipse.team.core.RepositoryProvider;
import org.eclipse.team.core.history.IFileHistory;
import org.eclipse.team.core.history.IFileHistoryProvider;
import org.eclipse.team.core.history.IFileRevision;

public class ScmResourceArtifact
  extends ScmArtifact
{
  private final IResource resource;
  private final ScmConnector connector;
  
  public ScmResourceArtifact(ScmConnector connector, IResource resource, String id, String path)
  {
    super(id, path);
    this.connector = connector;
    this.resource = resource;
    setProjectName(resource.getProject().getName());
    setProjectRelativePath(resource.getProjectRelativePath().toPortableString());
  }
  
  public ScmResourceArtifact(ScmConnector connector, IResource resource, String id)
  {
    this(connector, resource, id, resource.getFullPath().toString());
  }
  
  public IFileRevision getFileRevision(IProgressMonitor monitor)
  {
    return getFileHistory(monitor).getFileRevision(getId());
  }
  
  public IFileHistory getFileHistory(IProgressMonitor monitor)
  {
    RepositoryProvider provider = RepositoryProvider.getProvider(resource.getProject(), connector.getProviderId());
    IFileHistory history = provider.getFileHistoryProvider().getFileHistoryFor(resource, 0, 
      monitor);
    return history;
  }
  
  public IFileRevision[] getContributors(IProgressMonitor monitor)
  {
    IFileHistory history = getFileHistory(monitor);
    IFileRevision fileRevision = history.getFileRevision(getId());
    return fileRevision != null ? history.getContributors(fileRevision) : null;
  }
  
  public IFileRevision[] getTargets(IProgressMonitor monitor)
  {
    IFileHistory history = getFileHistory(monitor);
    IFileRevision fileRevision = history.getFileRevision(getId());
    return fileRevision != null ? history.getTargets(fileRevision) : null;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.versions.core.spi.ScmResourceArtifact
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.versions.core;

import java.util.HashMap;
import java.util.Map;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.mylyn.versions.core.spi.ScmInfoAttributes;
import org.eclipse.team.core.history.IFileRevision;

public abstract class ScmArtifact
  implements ScmInfoAttributes
{
  private final String id;
  private final String path;
  private final Map<String, String> fAtrributes = new HashMap();
  private String fProjName = null;
  private String fProjectRelativePath = null;
  
  protected ScmArtifact(String id, String path)
  {
    this.id = id;
    this.path = path;
  }
  
  public abstract IFileRevision[] getContributors(IProgressMonitor paramIProgressMonitor);
  
  public abstract IFileRevision getFileRevision(IProgressMonitor paramIProgressMonitor);
  
  public String getId()
  {
    return id;
  }
  
  public String getPath()
  {
    return path;
  }
  
  public abstract IFileRevision[] getTargets(IProgressMonitor paramIProgressMonitor);
  
  public Map<String, String> getInfoAtrributes()
  {
    return fAtrributes;
  }
  
  public void setProjectName(String projName)
  {
    fProjName = projName;
  }
  
  public void setProjectRelativePath(String projRelPath)
  {
    fProjectRelativePath = projRelPath;
  }
  
  public String getProjectName()
  {
    return fProjName;
  }
  
  public String getProjectRelativePath()
  {
    return fProjectRelativePath;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.versions.core.ScmArtifact
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.versions.core;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.eclipse.mylyn.versions.core.spi.ScmInfoAttributes;

public class ChangeSet
  implements ScmInfoAttributes
{
  private final List<Change> changes;
  private final Map<String, String> fAtrributes = new HashMap();
  private final ScmUser author;
  private final Date date;
  private final String id;
  private String kind;
  private final String message;
  private ScmRepository repository;
  
  public ChangeSet(ScmUser author, Date date, String id, String fullMessage, ScmRepository repository, List<? extends Change> changes)
  {
    this.author = author;
    this.date = date;
    this.id = id;
    message = fullMessage;
    this.repository = repository;
    this.changes = new ArrayList(changes);
  }
  
  public List<Change> getChanges()
  {
    return Collections.unmodifiableList(changes);
  }
  
  public String getKind()
  {
    return kind;
  }
  
  public ScmRepository getRepository()
  {
    return repository;
  }
  
  public ScmUser getAuthor()
  {
    return author;
  }
  
  public Date getDate()
  {
    return date != null ? new Date(date.getTime()) : null;
  }
  
  public String getId()
  {
    return id;
  }
  
  public String getMessage()
  {
    return message;
  }
  
  @Deprecated
  public void setKind(String kind)
  {
    this.kind = kind;
  }
  
  @Deprecated
  public void setRepository(ScmRepository repository)
  {
    this.repository = repository;
  }
  
  public Map<String, String> getInfoAtrributes()
  {
    return fAtrributes;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.versions.core.ChangeSet
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.versions.core;

public class ScmUser
{
  private String email;
  private String id;
  private String name;
  
  public ScmUser(String id, String name, String emailAddress)
  {
    this.id = id;
    this.name = name;
    email = emailAddress;
  }
  
  public String getEmail()
  {
    return email;
  }
  
  public String getId()
  {
    return id;
  }
  
  public String getName()
  {
    return name;
  }
  
  @Deprecated
  public void setEmail(String email)
  {
    this.email = email;
  }
  
  @Deprecated
  public void setId(String id)
  {
    this.id = id;
  }
  
  @Deprecated
  public void setName(String name)
  {
    this.name = name;
  }
  
  public String toString()
  {
    StringBuilder sb = new StringBuilder();
    if (id != null) {
      sb.append(id);
    } else if (name != null) {
      sb.append(name);
    }
    if (email != null) {
      sb.append(" <" + email + ">");
    }
    return sb.toString();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.versions.core.ScmUser
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.versions.core;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IContributor;
import org.eclipse.core.runtime.IExtension;
import org.eclipse.core.runtime.IExtensionPoint;
import org.eclipse.core.runtime.IExtensionRegistry;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.MultiStatus;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.mylyn.commons.core.StatusHandler;
import org.eclipse.mylyn.versions.core.spi.ScmConnector;
import org.eclipse.osgi.util.NLS;
import org.eclipse.team.core.RepositoryProvider;

public class ScmCore
{
  private static HashMap<String, ScmConnector> connectorById = new HashMap();
  
  public static IResource findResource(String file)
  {
    IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
    IPath path = new Path(file);
    path.makeRelative();
    while (path.segmentCount() > 1)
    {
      IResource resource = root.findMember(path);
      if (resource != null) {
        return resource;
      }
      path = path.removeFirstSegments(1);
    }
    return null;
  }
  
  public static List<ScmConnector> getAllRegisteredConnectors()
  {
    List<ScmConnector> scmConnectors = new ArrayList();
    String[] teamProviderIds = RepositoryProvider.getAllProviderTypeIds();
    String[] arrayOfString1;
    int j = (arrayOfString1 = teamProviderIds).length;
    for (int i = 0; i < j; i++)
    {
      String providerId = arrayOfString1[i];
      ScmConnector connector = getScmConnectorById(providerId);
      if (connector != null) {
        scmConnectors.add(connector);
      }
    }
    return scmConnectors;
  }
  
  public static ScmConnector getConnector(IResource resource)
  {
    if (!RepositoryProvider.isShared(resource.getProject())) {
      return null;
    }
    RepositoryProvider provider = RepositoryProvider.getProvider(resource.getProject());
    return getScmConnectorById(provider.getID());
  }
  
  private static synchronized ScmConnector getScmConnectorById(String id)
  {
    ScmConnector connector = (ScmConnector)connectorById.get(id);
    if (connector == null)
    {
      connector = loadConnector(id);
      connectorById.put(id, connector);
    }
    return connector;
  }
  
  private static ScmConnector loadConnector(String id)
  {
    Assert.isNotNull(id);
    MultiStatus result = new MultiStatus("org.eclipse.mylyn.versions.core", 0, "Scm connectors failed to load.", null);
    
    IExtensionRegistry registry = Platform.getExtensionRegistry();
    IExtensionPoint connectorsExtensionPoint = registry.getExtensionPoint("org.eclipse.mylyn.versions.core.connectors");
    IExtension[] extensions = connectorsExtensionPoint.getExtensions();
    IExtension[] arrayOfIExtension1;
    int j = (arrayOfIExtension1 = extensions).length;
    for (int i = 0; i < j; i++)
    {
      IExtension extension = arrayOfIExtension1[i];
      IConfigurationElement[] elements = extension.getConfigurationElements();
      IConfigurationElement[] arrayOfIConfigurationElement1;
      int m = (arrayOfIConfigurationElement1 = elements).length;
      for (int k = 0; k < m; k++)
      {
        IConfigurationElement element = arrayOfIConfigurationElement1[k];
        if (id.equals(element.getAttribute("id"))) {
          try
          {
            Object object = element.createExecutableExtension("core");
            if ((object instanceof ScmConnector)) {
              return (ScmConnector)object;
            }
            result.add(new Status(
              4, 
              "org.eclipse.mylyn.versions.core", 
              NLS.bind(
              "Connector core ''{0}'' does not extend expected class for extension contributed by {1}", 
              object.getClass().getCanonicalName(), element.getContributor().getName())));
          }
          catch (Throwable e)
          {
            result.add(new Status(
              4, 
              "org.eclipse.mylyn.versions.core", 
              NLS.bind(
              "Connector core failed to load for extension contributed by {0}", element.getContributor().getName()), e));
          }
        }
      }
    }
    if (!result.isOK()) {
      StatusHandler.log(result);
    }
    return null;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.versions.core.ScmCore
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.versions.core;

public enum ChangeType
{
  ADDED,  DELETED,  MODIFIED,  REPLACED;
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.versions.core.ChangeType
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.versions.core;

import java.util.HashMap;
import java.util.Map;
import org.eclipse.mylyn.versions.core.spi.ScmInfoAttributes;

public class Change
  implements ScmInfoAttributes
{
  private final ScmArtifact base;
  private final ScmArtifact target;
  private final ChangeType changeType;
  private final Map<String, String> fAtrributes = new HashMap();
  
  public Change(ScmArtifact base, ScmArtifact target, ChangeType changeType)
  {
    this.base = base;
    this.target = target;
    this.changeType = changeType;
  }
  
  public ScmArtifact getBase()
  {
    return base;
  }
  
  public ScmArtifact getTarget()
  {
    return target;
  }
  
  public ChangeType getChangeType()
  {
    return changeType;
  }
  
  public Map<String, String> getInfoAtrributes()
  {
    return fAtrributes;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.versions.core.Change
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.versions.core;

import org.eclipse.mylyn.versions.core.spi.ScmConnector;

public class ScmRepository
{
  private String name;
  private String url;
  private ScmConnector connector;
  
  protected ScmRepository() {}
  
  public ScmRepository(ScmConnector connector, String name, String url)
  {
    this.name = name;
    this.url = url;
  }
  
  public String getName()
  {
    return name;
  }
  
  public String getUrl()
  {
    return url;
  }
  
  public ScmConnector getConnector()
  {
    return connector;
  }
  
  protected void setName(String name)
  {
    this.name = name;
  }
  
  protected void setUrl(String url)
  {
    this.url = url;
  }
  
  protected void setConnector(ScmConnector connector)
  {
    this.connector = connector;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.versions.core.ScmRepository
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.versions.core;

public class ScmInternal
{
  public static final String ID_PLUGIN = "org.eclipse.mylyn.versions.core";
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.versions.core.ScmInternal
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
1

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd