~ubuntu-branches/ubuntu/utopic/maven-enforcer/utopic

« back to all changes in this revision

Viewing changes to enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireFilesSize.java

  • Committer: Package Import Robot
  • Author(s): Torsten Werner
  • Date: 2011-09-12 22:30:16 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: package-import@ubuntu.com-20110912223016-e2pk04avoq8bur7t
Tags: 1.0-1
* Team upload
* New upstream release.
* Add more Build-Depends.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
package org.apache.maven.plugins.enforcer;
 
2
 
1
3
/*
2
4
 * Licensed to the Apache Software Foundation (ASF) under one
3
5
 * or more contributor license agreements.  See the NOTICE file
16
18
 * specific language governing permissions and limitations
17
19
 * under the License.
18
20
 */
19
 
package org.apache.maven.plugins.enforcer;
20
21
 
21
22
import java.io.File;
22
23
 
29
30
 
30
31
/**
31
32
 * Rule to validate the main artifact is within certain size constraints.
32
 
 * 
 
33
 *
33
34
 * @author brianf
34
35
 * @author Roman Stumm
35
36
 */
51
52
 
52
53
    /*
53
54
     * (non-Javadoc)
54
 
     * 
 
55
     *
55
56
     * @see org.apache.maven.enforcer.rule.api.EnforcerRule#execute(org.apache.maven.enforcer.rule.api.EnforcerRuleHelper)
56
57
     */
57
58
    public void execute( EnforcerRuleHelper helper )
58
59
        throws EnforcerRuleException
59
60
    {
60
61
        this.log = helper.getLog();
61
 
        
 
62
 
62
63
        // if the file is already defined, use that. Otherwise get the main artifact.
63
64
        if ( files.length == 0 )
64
65
        {
84
85
 
85
86
    /*
86
87
     * (non-Javadoc)
87
 
     * 
 
88
     *
88
89
     * @see org.apache.maven.enforcer.rule.api.EnforcerRule#isCacheable()
89
90
     */
90
91
    public boolean isCacheable()
94
95
 
95
96
    /*
96
97
     * (non-Javadoc)
97
 
     * 
 
98
     *
98
99
     * @see org.apache.maven.enforcer.rule.api.EnforcerRule#isResultValid(org.apache.maven.enforcer.rule.api.EnforcerRule)
99
100
     */
100
101
    public boolean isResultValid( EnforcerRule cachedRule )
112
113
            //if we get here and it's null, treat it as a success.
113
114
            return true;
114
115
        }
115
 
        
 
116
 
116
117
        // check the file now
117
118
        if ( file.exists() )
118
119
        {