Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## net.sf.statsvn.util
Class SvnPropgetUtils

    java.lang.Object
      net.sf.statsvn.util.SvnPropgetUtils

All Implemented Interfaces:
  ISvnPropgetProcessor

Direct Known Subclasses:
  SvnKitPropget

    public class SvnPropgetUtils

extends Object
implements ISvnPropgetProcessor

Utilities class that manages calls to svn propget. Used to find binary files.

Version:
  $Id: SvnPropgetUtils.java 394 2009-08-10 20:08:46Z jkealey $
Author:
  Jason Kealey

Field Summary
`protected List` | `binaryFiles`
`protected ISvnProcessor` | `processor`

Constructor Summary
`SvnPropgetUtils(ISvnProcessor processor)` Invokes propget via the svn propget via the command line.

Method Summary
`protected String` | `getBinaryFilename(String currentLine, boolean removeRoot)` Given a string such as: "lib\junit.jar - application/octet-stream" or "svn:\\host\repo\lib\junit.jar - application/octet-stream" will return the filename if the mime type is binary (doesn't end with text/*) Will return the filename with / was a directory seperator.
`List` | `getBinaryFiles()` Returns the list of binary files in the working directory.
`protected ProcessUtils` | `getFileMimeTypes()` Get the svn:mime-types for all files, latest revision.
`protected ProcessUtils` | `getFileMimeTypes(String revision, String filename)` Get the svn:mime-type for a certain file (leave null for all files).
`protected ISvnProcessor` | `getProcessor()`
`boolean` | `isBinaryFile(String revision, String filename)` It was first thought that a the mime-type of a file's previous revision could be found.
`protected void` | `loadBinaryFiles(ProcessUtils pUtils)` Loads the list of binary files from the input stream equivalent to an svn propget command.
`void` | `loadBinaryFiles(String path)` Loads the list of binary files from the input stream equivalent to an svn propget command.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### binaryFiles

    protected List binaryFiles

### processor

    protected ISvnProcessor processor

Constructor Detail

### SvnPropgetUtils

    public SvnPropgetUtils(ISvnProcessor processor)

  Invokes propget via the svn propget via the command line.

Method Detail

### getProcessor

    protected ISvnProcessor getProcessor()

### getFileMimeTypes

    protected ProcessUtils getFileMimeTypes()

  Get the svn:mime-types for all files, latest revision.

  Returns:
    the inputstream from which to read the information.

### getFileMimeTypes

    protected ProcessUtils getFileMimeTypes(String revision,
                                            String filename)

  Get the svn:mime-type for a certain file (leave null for all files).

  Parameters:
    `revision` - revision for which to query;
    `filename` - the filename (or null for all files)
  Returns:
    the inputstream from which to read the information.

### getBinaryFiles

    public List getBinaryFiles()

  Description copied from interface: `ISvnPropgetProcessor`
  Returns the list of binary files in the working directory.

  Specified by:
    `getBinaryFiles` in interface `ISvnPropgetProcessor`
  Returns:
    the list of binary files

### loadBinaryFiles

    public void loadBinaryFiles(String path)
                         throws IOException

  Loads the list of binary files from the input stream equivalent to an svn propget command.

  Specified by:
    `loadBinaryFiles` in interface `ISvnPropgetProcessor`
  Parameters:
    `path` - a file on disk which contains the results of an svn propget
  Throws:
    `IOException`

### loadBinaryFiles

    protected void loadBinaryFiles(ProcessUtils pUtils)

  Loads the list of binary files from the input stream equivalent to an svn propget command.

  Parameters:
    `stream` - stream equivalent to an svn propget command

### isBinaryFile

    public boolean isBinaryFile(String revision,
                                String filename)

  Description copied from interface: `ISvnPropgetProcessor`
  It was first thought that a the mime-type of a file's previous revision could be found. This is not the case. Leave revision null until future upgrade of svn propget command line.

  Specified by:
    `isBinaryFile` in interface `ISvnPropgetProcessor`
  Parameters:
    `revision` - the revision to query
    `filename` - the filename
  Returns:
    if that version of a file is binary

### getBinaryFilename

    protected String getBinaryFilename(String currentLine,
                                       boolean removeRoot)

  Given a string such as: "lib\junit.jar - application/octet-stream" or "svn:\\host\repo\lib\junit.jar - application/octet-stream" will return the filename if the mime type is binary (doesn't end with text/*) Will return the filename with / was a directory seperator.

  Parameters:
    `currentLine` - the line obtained from svn propget svn:mime-type
    `removeRoot` - if true, will remove any repository prefix
  Returns:
    should return lib\junit.jar in both cases, given that removeRoot==true in the second case.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD