Search in sources :

Example 1 with ModifiedAction

use of com.thoughtworks.go.domain.materials.ModifiedAction in project gocd by gocd.

the class SvnLogXmlParser method parseLogEntry.

private Modification parseLogEntry(Element logEntry, String path) throws ParseException {
    Element logEntryPaths = logEntry.getChild("paths");
    if (logEntryPaths == null) {
        /* Path-based access control forbids us from learning
             * details of this log entry, so skip it. */
        return null;
    }
    Date modifiedTime = convertDate(logEntry.getChildText("date"));
    String author = logEntry.getChildText("author");
    String comment = logEntry.getChildText("msg");
    String revision = logEntry.getAttributeValue("revision");
    Modification modification = new Modification(author, comment, null, modifiedTime, revision);
    List paths = logEntryPaths.getChildren("path");
    for (Iterator iterator = paths.iterator(); iterator.hasNext(); ) {
        Element node = (Element) iterator.next();
        if (underPath(path, node.getText())) {
            ModifiedAction action = convertAction(node.getAttributeValue("action"));
            modification.createModifiedFile(node.getText(), null, action);
        }
    }
    return modification;
}
Also used : Modification(com.thoughtworks.go.domain.materials.Modification) Element(org.jdom2.Element) Iterator(java.util.Iterator) ModifiedAction(com.thoughtworks.go.domain.materials.ModifiedAction) ArrayList(java.util.ArrayList) List(java.util.List) Date(java.util.Date)

Example 2 with ModifiedAction

use of com.thoughtworks.go.domain.materials.ModifiedAction in project gocd by gocd.

the class ModifiedActionTypeHandlerCallback method setParameter.

public void setParameter(ParameterSetter parameterSetter, Object parameter) throws SQLException {
    ModifiedAction modifiedAction = (ModifiedAction) parameter;
    parameterSetter.setString(modifiedAction.toString());
}
Also used : ModifiedAction(com.thoughtworks.go.domain.materials.ModifiedAction)

Aggregations

ModifiedAction (com.thoughtworks.go.domain.materials.ModifiedAction)2 Modification (com.thoughtworks.go.domain.materials.Modification)1 ArrayList (java.util.ArrayList)1 Date (java.util.Date)1 Iterator (java.util.Iterator)1 List (java.util.List)1 Element (org.jdom2.Element)1