Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package org.codehaus.mojo.rpm;
  
  /*
   * Licensed to the Apache Software Foundation (ASF) under one
   * or more contributor license agreements.  See the NOTICE file
   * distributed with this work for additional information
   * regarding copyright ownership.  The ASF licenses this file
   * to you under the Apache License, Version 2.0 (the
   * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
  *
  *   http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
  */
 
 import java.io.File;
 import java.util.List;
A description of a location where files to be packaged can be found.

Author(s):
Bob Allison
Carlos
Brett Okken
 
 public class Source
 {
     // // // Properties
 
    
The source location.
 
     private String location;

    
The list of inclusions.
 
     private List<Stringincludes;

    
The list of exclusions.
 
     private List<Stringexcludes;

    
Optional destination name for the file identified by location.
NOTE: This is only applicable if the location is a file, not a directory.
 
     private String destination;

    
true to omit the default exclusions.
 
     private boolean noDefaultExcludes;

    
A regular expression that, if populated, this indicates that the files defined are only applicable if this value matches the RPMMojo.needarch value.
 
     private String targetArchitecture;

    
java.util.regex.Pattern compiled from targetArchitecture.

Since:
2.0-beta-3
 
     private Pattern targetArchitecturePattern;

    
A regular expression that, if populated, indicates that the files defined are only applicable if the expression matches the RPMMojo.needOS value.

Since:
2.0-beta-3
 
     private String targetOSName;

    
java.util.regex.Pattern compiled from targetOSName.

Since:
2.0-beta-3
 
     private Pattern targetOSNamePattern;

    
Indicates if the source should be filtered.

Since:
2.0
 
     private boolean filter;

    
The location with any/all macros evaluated.

Since:
2.1-alpha-1
 
     private String macroEvaluatedLocation;

    
Retrieve the location holding the file(s) to install.

Returns:
The location holding the file(s) to install.
    public String getLocation()
    {
        return ;
    }

    
Set the location holding the file(s) to install.

Parameters:
loc The new location holding the file(s) to install.
    public void setLocationString loc )
    {
         = loc;
    }

    
Retrieve the list of files to include in the package.

Returns:
The list of files to include in the package.
    public List<StringgetIncludes()
    {
        return ;
    }

    
Set the list of files to include in the package.

Parameters:
incl The new list of files to include in the package.
    public void setIncludesList<Stringincl )
    {
         = incl;
    }

    
Retrieve the list of files to exclude from the package.

Returns:
The list of files to exclude from the package.
    public List<StringgetExcludes()
    {
        return ;
    }

    
Set the list of files to exclude from the package.

Parameters:
excl The new list of files to exclude from the package.
    public void setExcludesList<Stringexcl )
    {
         = excl;
    }

    
Retrieve the default exclude status.

Returns:
true if the default excludes should be omitted.
    public boolean getNoDefaultExcludes()
    {
        return ;
    }

    
Set the default exclude status.

Parameters:
noDefExcl true if the default excludes should be omitted.
    public void setNoDefaultExcludesboolean noDefExcl )
    {
         = noDefExcl;
    }
    // // // Public methods

    

Returns:
Returns the destination.
See also:
setDestination(java.lang.String)
    public String getDestination()
    {
        return this.;
    }

    
Sets the destination file name.

NOTE: This is only applicable if the location is a file, not a directory.

Parameters:
destination The destination that the location should be in the final rpm.
    public void setDestinationString destination )
    {
        this. = destination;
    }

    

Returns:
Returns the targetArchitecture.
    public String getTargetArchitecture()
    {
        return this.;
    }

    
Sets a regular expression that indicates that the files defined are only applicable if the expression matches the architecture.

In order to be backwards compatible, the targetArch will be converted to lower case for the purpose of comparison.

Parameters:
targetArch The target architecture to set.
    public void setTargetArchitectureString targetArch )
    {
        this. = targetArch;
        this. =
            targetArch == null ? null : Pattern.compiletargetArch.toLowerCase. ) );
    }

    
Indicates if the getTargetArchitecture() matches the archicture.

Parameters:
architecture The target architecture for the rpm.
Returns:
if the getTargetArchitecture() matches the archicture.
    boolean matchesArchitectureString architecture )
    {
        return  == null ? true : .matcherarchitecture ).matches();
    }

    

Returns:
Returns the targetOSName.
Since:
2.0-beta-3
    public String getTargetOSName()
    {
        return this.;
    }

    
Sets a regular expression that indicates that the files defined are only applicable if the expression matches the operating system name.

Parameters:
targetOSName The targetOSName to set.
Since:
2.0-beta-3
    public void setTargetOSNameString targetOSName )
    {
        this. = targetOSName;
        this. = targetOSName != null ? Pattern.compiletargetOSName ) : null;
    }

    

Returns:
Returns the filter.
Since:
2.0
    public boolean isFilter()
    {
        return this.;
    }

    

Parameters:
filter The filter to set.
Since:
2.0
    public void setFilterboolean filter )
    {
        this. = filter;
    }

    
Indicates if the target OS name matches osName.

Parameters:
osName The name of the os to match against the getTargetOSName().
Returns:
if getTargetOSName() matches osName.
Since:
2.0-beta-3
    boolean matchesOSNameString osName )
    {
        return  == null ? true : .matcherosName ).matches();
    }

    

Returns:
Returns the macroEvaluatedLocation.
Since:
2.1-alpha-1
    {
        return this.;
    }

    

Parameters:
macroEvaluatedLocation The macroEvaluatedLocation to set.
Since:
2.1-alpha-1
    final void setMacroEvaluatedLocationString macroEvaluatedLocation )
    {
        this. = macroEvaluatedLocation;
    }

    
    public String toString()
    {
        StringBuilder sb = new StringBuilder();
        sb.append"{" );
        if (  == null )
        {
            sb.append"nowhere" );
        }
        else
        {
            sb.append"\"" +  + "\"" );
        }
        if (  != null )
        {
            sb.append" incl:" +  );
        }
        if (  != null )
        {
            sb.append" excl:" +  );
        }
        if (  != null )
        {
            sb.append" destination: " );
            sb.append );
        }
        sb.append" filter: " + Boolean.toString ) );
        if (  )
        {
            sb.append" [no default excludes]" );
        }
        if (  != null )
        {
            sb.append" targetArch: " );
            sb.append );
        }
        sb.append"}" );
        return sb.toString();
    }
New to GrepCode? Check out our FAQ X