001package org.apache.maven.scm.command.blame;
002
003/*
004 * Licensed to the Apache Software Foundation (ASF) under one
005 * or more contributor license agreements.  See the NOTICE file
006 * distributed with this work for additional information
007 * regarding copyright ownership.  The ASF licenses this file
008 * to you under the Apache License, Version 2.0 (the
009 * "License"); you may not use this file except in compliance
010 * with the License.  You may obtain a copy of the License at
011 *
012 *   http://www.apache.org/licenses/LICENSE-2.0
013 *
014 * Unless required by applicable law or agreed to in writing,
015 * software distributed under the License is distributed on an
016 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
017 * KIND, either express or implied.  See the License for the
018 * specific language governing permissions and limitations
019 * under the License.
020 */
021
022import org.apache.maven.scm.CommandParameter;
023import org.apache.maven.scm.ScmException;
024import org.apache.maven.scm.ScmFileSet;
025import org.apache.maven.scm.ScmRequest;
026import org.apache.maven.scm.repository.ScmRepository;
027
028/**
029 * @author Olivier Lamy
030 * @since 1.8
031 */
032public class BlameScmRequest
033    extends ScmRequest
034{
035
036    /**
037     * -w option for git
038     */
039    private boolean ignoreWhitespace;
040
041
042    public BlameScmRequest( ScmRepository scmRepository, ScmFileSet scmFileSet )
043    {
044        super( scmRepository, scmFileSet );
045    }
046
047    public void setFilename( String filename )
048        throws ScmException
049    {
050        this.getCommandParameters().setString( CommandParameter.FILE, filename );
051    }
052
053    public String getFilename()
054        throws ScmException
055    {
056        return this.getCommandParameters().getString( CommandParameter.FILE );
057    }
058
059    public boolean isIgnoreWhitespace()
060    {
061        return ignoreWhitespace;
062    }
063
064    public void setIgnoreWhitespace( boolean ignoreWhitespace )
065        throws ScmException
066    {
067        this.ignoreWhitespace = ignoreWhitespace;
068
069        if ( ignoreWhitespace )
070        {
071            this.getCommandParameters().setString( CommandParameter.IGNORE_WHITESPACE, "TRUE" );
072        }
073        else
074        {
075            this.getCommandParameters().setString( CommandParameter.IGNORE_WHITESPACE, "FALSE" );
076        }
077    }
078}