com.pmease.quickbuild.repositorysupport
Class SourceViewSupport<T extends Revision>

java.lang.Object
  extended by com.pmease.quickbuild.repositorysupport.SourceViewSupport<T>
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
WorkingDirLocator

public abstract class SourceViewSupport<T extends Revision>
extends java.lang.Object
implements java.io.Serializable

This interface is used to read file from repository to view/diff source files between builds, or display content of source files referenced by reporting tools such as EMMA and PMD. NOTE: Methods of this interface should not change any files in the workspace; otherwise, ongoing builds may be affected.

See Also:
Serialized Form

Constructor Summary
SourceViewSupport(Repository<T> repository)
           
 
Method Summary
 Repository<T> getRepository()
           
abstract  java.lang.String getRepositoryPath(java.lang.String checkoutPath)
          Get the path in repository given a checkout path on disk.
 java.util.List<java.lang.String> readSource(java.lang.String repositoryPath)
          Read source with current repository revision.
 java.lang.String readSourceAsString(java.lang.String repositoryPath)
           
 java.lang.String readSourceAsString(java.lang.String repositoryPath, java.lang.String lineSeparator)
           
abstract  java.util.List<java.lang.String> readSourceByEdition(java.lang.String repositoryPath, java.lang.String edition)
          Get source file content by specified file edition
abstract  java.util.List<java.lang.String> readSourceByRevision(java.lang.String repositoryPath, T revision)
          Get source file content by specified repository revision.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SourceViewSupport

public SourceViewSupport(Repository<T> repository)
Method Detail

getRepository

public Repository<T> getRepository()

getRepositoryPath

public abstract java.lang.String getRepositoryPath(java.lang.String checkoutPath)
Get the path in repository given a checkout path on disk. Please note that the checkout path is the path to a checkout file relative to the workspace. This file does not necessarily to be exist on disk, and this method might be called even if the checkouts has been cleared.

Returns:
null if specified checkout file can not be mapped to a path in repository

readSourceByRevision

public abstract java.util.List<java.lang.String> readSourceByRevision(java.lang.String repositoryPath,
                                                                      T revision)
Get source file content by specified repository revision.

Parameters:
repositoryPath - the path in repository
revision - revision of the repository as returned by Repository.getHeadRevision() or Repository#getLabelRevision(String)
Returns:
lines of the source file. Null value will be returned if specified path does not represents a text file or file does not exist.

readSourceByEdition

public abstract java.util.List<java.lang.String> readSourceByEdition(java.lang.String repositoryPath,
                                                                     java.lang.String edition)
Get source file content by specified file edition

Parameters:
repositoryPath - the path in repository
edition - the file edition defined in Modification.getEdition() which is fetched from Repository#getChangesBetween().
Returns:
lines of the source file. Null value will be returned if specified path does not represents a text file or file does not exist.

readSource

public java.util.List<java.lang.String> readSource(java.lang.String repositoryPath)
Read source with current repository revision.

Parameters:
repositoryPath -
Returns:

readSourceAsString

public java.lang.String readSourceAsString(java.lang.String repositoryPath,
                                           java.lang.String lineSeparator)

readSourceAsString

public java.lang.String readSourceAsString(java.lang.String repositoryPath)
Read content of a repository file with specified repository path. Revision of the file will be the same as the build.



Copyright © 2005-2010 PMEase Inc. All Rights Reserved.