Package org.apache.tools.ant.types

Examples of org.apache.tools.ant.types.FilterChain


    /**
     * Add a FilterChain.
     * @return a filter chain object.
     */
    public FilterChain createFilterChain() {
        FilterChain filterChain = new FilterChain();
        filterChains.addElement(filterChain);
        return filterChain;
    }
View Full Code Here


    }

    private void configureConcat() {
        concat.setProject(getProject());
        concat.setTaskName(getTaskName());
        FilterChain filterChain = new FilterChain();
        LineContainsRegExp lcre = new LineContainsRegExp();
        RegularExpression regexp = new RegularExpression();
        regexp.setPattern("^import .+;");
        lcre.addConfiguredRegexp(regexp);
        filterChain.add(lcre);
        TokenFilter tf = new TokenFilter();
        TokenFilter.ReplaceRegex rre = new TokenFilter.ReplaceRegex();
        rre.setPattern("import (.+);.*");
        rre.setReplace("\\1");
        tf.add(rre);
        filterChain.add(tf);
        concat.addFilterChain(filterChain);
    }
View Full Code Here

     */
    protected final void prepare(String theResourcePrefix, String theDirName)
        throws IOException
    {
        FileUtils fileUtils = FileUtils.newFileUtils();
        FilterChain filterChain = createFilterChain();

        this.tmpDir = setupTempDirectory(this.tmpDir, theDirName);
        cleanTempDirectory(this.tmpDir);

        // Copy configuration files into the temporary container directory
View Full Code Here

     * @throws IOException If an I/O error occurs
     */
    private void prepare(String theDirName) throws IOException
    {
        FileUtils fileUtils = FileUtils.newFileUtils();
        FilterChain filterChain = createFilterChain();
       
        this.tmpDir = setupTempDirectory(this.tmpDir, theDirName);
        cleanTempDirectory(this.tmpDir);

        File testDomainDir = createDirectory(this.tmpDir, "testdomain");
View Full Code Here

     * @return The default filter chain
     */
    protected final FilterChain createFilterChain()
    {
        ReplaceTokens.Token token = null;
        FilterChain filterChain = new FilterChain();

        // Token for the cactus port
        ReplaceTokens replacePort = new ReplaceTokens();
        token = new ReplaceTokens.Token();
        token.setKey("cactus.port");
        token.setValue(String.valueOf(getPort()));
        replacePort.addConfiguredToken(token);
        filterChain.addReplaceTokens(replacePort);

        // Token for the cactus webapp context.
        if (getDeployableFile() != null)
        {
            ReplaceTokens replaceContext = new ReplaceTokens();
            token = new ReplaceTokens.Token();
            token.setKey("cactus.context");
            token.setValue(getDeployableFile().getTestContext());
            replaceContext.addConfiguredToken(token);
            filterChain.addReplaceTokens(replaceContext);
        }
       
        return filterChain;
    }
View Full Code Here

     */
    protected final void prepare(String theResourcePrefix, String theDirName)
        throws IOException
    {
        FileUtils fileUtils = FileUtils.newFileUtils();
        FilterChain filterChain = createFilterChain();

        if (this.tmpDir == null)
        {
            this.tmpDir = createTempDirectory(theDirName);
        }
View Full Code Here

        File srcFile = new File(srcDir, file);
        long lastModified = srcFile.lastModified();
        File destD = destDir == null ? srcDir : destDir;

        if (fcv == null) {
            FilterChain fc = new FilterChain();
            fc.add(filter);
            fcv = new Vector(1);
            fcv.add(fc);
        }
        File tmpFile = FILE_UTILS.createTempFile("fixcrlf", "", null, true, false);
        try {
View Full Code Here

        Reader instream = primaryReader;
        final int filterReadersCount = filterChains.size();
        final Vector finalFilters = new Vector();

        for (int i = 0; i < filterReadersCount; i++) {
            final FilterChain filterchain =
                (FilterChain) filterChains.elementAt(i);
            final Vector filterReaders = filterchain.getFilterReaders();
            final int readerCount = filterReaders.size();
            for (int j = 0; j < readerCount; j++) {
                finalFilters.addElement(filterReaders.elementAt(j));
            }
        }
View Full Code Here

    /**
     * Adds a FilterChain.
     */
    public FilterChain createFilterChain() {
        FilterChain filterChain = new FilterChain();
        filterChains.addElement(filterChain);
        return filterChain;
    }
View Full Code Here

        Reader instream = primaryReader;
        final int filterReadersCount = filterChains.size();
        final Vector finalFilters = new Vector();

        for (int i = 0; i < filterReadersCount; i++) {
            final FilterChain filterchain =
                (FilterChain) filterChains.elementAt(i);
            final Vector filterReaders = filterchain.getFilterReaders();
            final int readerCount = filterReaders.size();
            for (int j = 0; j < readerCount; j++) {
                finalFilters.addElement(filterReaders.elementAt(j));
            }
        }
View Full Code Here

TOP

Related Classes of org.apache.tools.ant.types.FilterChain

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.