com.atlassian.crucible.scm
Interface DirectoryBrowser


public interface DirectoryBrowser


Method Summary
 FileHistory getFileHistory(Principal principal, java.lang.String path, java.lang.String pegRevision)
          Get the change history of the given file or directory (history of directory changes may not be supported by all SCMs).
 java.util.List<DirectorySummary> listDirectories(Principal principal, java.lang.String path)
          Get a summary of each directory directly under a given path
 java.util.List<FileSummary> listFiles(Principal principal, java.lang.String path)
          Get a summary of each file directly under a given path.
 

Method Detail

listFiles

java.util.List<FileSummary> listFiles(Principal principal,
                                      java.lang.String path)
                                      throws NotFoundException
Get a summary of each file directly under a given path. If the specified path refers to a file instead of a directory, an empty is returned.

Parameters:
principal - the principal performing this operation
path - the path to the directory whose files are required
Returns:
a list of FileSummary objects, each being a file directly at the given path (directories excluded)
Throws:
NotFoundException - when the specified path cannot be found.

listDirectories

java.util.List<DirectorySummary> listDirectories(Principal principal,
                                                 java.lang.String path)
                                                 throws NotFoundException
Get a summary of each directory directly under a given path

Parameters:
principal - the principal performing this operation
path - the path to the directory whose directories are required
Returns:
a list of DirectorySummary objects, each being a directory directly at the given path
Throws:
NotFoundException - when the specified path cannot be found.

getFileHistory

FileHistory getFileHistory(Principal principal,
                           java.lang.String path,
                           java.lang.String pegRevision)
                           throws NotFoundException
Get the change history of the given file or directory (history of directory changes may not be supported by all SCMs).

Parameters:
principal - the principal performing this operation
path - the path to the file or directory in question
pegRevision - for those SCMs which support it, this is the peg revision to identify which particular version of the file on the path is required.
Returns:
The file or directory's change history
Throws:
NotFoundException - when the specified path cannot be found.