org.apache.commons.io.filefilter.AbstractFileFilter Java Examples

The following examples show how to use org.apache.commons.io.filefilter.AbstractFileFilter. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source Project: flow   Author: vaadin   File: VaadinConnectTsGenerator.java    License: Apache License 2.0 5 votes vote down vote up
private static Collection<File> getFilesToDelete(Set<File> generatedFiles,
        File outputDirFile) {
    return FileUtils.listFiles(outputDirFile, new AbstractFileFilter() {
        @Override
        public boolean accept(File file) {
            return shouldDelete(generatedFiles, file);
        }
    }, TrueFileFilter.INSTANCE);
}
 
Example #2
Source Project: wisdom   Author: wisdom-framework   File: RunnerUtils.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Checks if a file having somewhat the current tested application name is contained in the given directory. This
 * method follows the default maven semantic. The final file is expected to have a name compliant with the
 * following rules: <code>artifactId-version.jar</code>. If the version ends with <code>-SNAPSHOT</code>,
 * it just checks for <code>artifactId-stripped_version</code>, where stripped version is the version without the
 * <code>SNAPSHOT</code> part.
 * <p>
 * The artifactId and version are read from the <code>target/osgi/osgi.properties</code> file,
 * that should have been written by the Wisdom build process.
 *
 * @param directory the directory
 * @return the bundle file if found
 * @throws java.io.IOException if something bad happens.
 */
public static File detectApplicationBundleIfExist(File directory) throws IOException {
    Properties properties = getMavenProperties();
    if (properties == null || directory == null || !directory.isDirectory()) {
        return null;
    }

    final String artifactId = properties.getProperty("project.artifactId");
    final String groupId = properties.getProperty("project.groupId");
    final String bsn = getBundleSymbolicName(groupId, artifactId);
    String version = properties.getProperty("project.version");
    final String strippedVersion;
    if (version.endsWith("-SNAPSHOT")) {
        strippedVersion = version.substring(0, version.length() - "-SNAPSHOT".length());
    } else {
        strippedVersion = version;
    }

    Iterator<File> files = FileUtils.iterateFiles(directory, new AbstractFileFilter() {
        @Override
        public boolean accept(File file) {
            return file.isFile()
                    && file.getName().startsWith(bsn + "-" + strippedVersion)
                    && file.getName().endsWith(".jar");
        }
    }, TrueFileFilter.INSTANCE);

    if (files.hasNext()) {
        return files.next();
    }
    return null;
}
 
Example #3
Source Project: api-mining   Author: mast-group   File: JavaTypeTokenizer.java    License: GNU General Public License v3.0 4 votes vote down vote up
@Override
public AbstractFileFilter getFileFilter() {
	return baseTokenizer.getFileFilter();
}
 
Example #4
Source Project: api-mining   Author: mast-group   File: JavaTokenTypeTokenizer.java    License: GNU General Public License v3.0 4 votes vote down vote up
@Override
public AbstractFileFilter getFileFilter() {
	return javaCodeFiler;
}
 
Example #5
Source Project: api-mining   Author: mast-group   File: JavaWhitespaceTokenizer.java    License: GNU General Public License v3.0 4 votes vote down vote up
@Override
public AbstractFileFilter getFileFilter() {
	return javaCodeFilter;
}
 
Example #6
Source Project: api-mining   Author: mast-group   File: JavaWhitespaceTokenizer.java    License: GNU General Public License v3.0 4 votes vote down vote up
@Override
public AbstractFileFilter getFileFilter() {
	final TokenizerImplementation tok = new TokenizerImplementation();
	return tok.getFileFilter();
}
 
Example #7
Source Project: api-mining   Author: mast-group   File: JavaASTAnnotatedTokenizer.java    License: GNU General Public License v3.0 4 votes vote down vote up
@Override
public AbstractFileFilter getFileFilter() {
	return baseTokenizer.getFileFilter();
}
 
Example #8
Source Project: api-mining   Author: mast-group   File: JavaTokenizer.java    License: GNU General Public License v3.0 4 votes vote down vote up
@Override
public AbstractFileFilter getFileFilter() {
	return javaCodeFileFilter;
}
 
Example #9
Source Project: api-mining   Author: mast-group   File: AbstractJygmentsTokenizer.java    License: GNU General Public License v3.0 4 votes vote down vote up
@Override
public AbstractFileFilter getFileFilter() {
	return codeFilter;
}
 
Example #10
Source Project: api-mining   Author: mast-group   File: CDTTokenizer.java    License: GNU General Public License v3.0 4 votes vote down vote up
@Override
public AbstractFileFilter getFileFilter() {
	return C_CODE_TOKENIZER;
}
 
Example #11
Source Project: api-mining   Author: mast-group   File: CppWhitespaceTokenizer.java    License: GNU General Public License v3.0 4 votes vote down vote up
@Override
public AbstractFileFilter getFileFilter() {
	return CPP_CODE_FILTER;
}
 
Example #12
Source Project: api-mining   Author: mast-group   File: AbstractCdtASTAnnotatedTokenizer.java    License: GNU General Public License v3.0 4 votes vote down vote up
@Override
public AbstractFileFilter getFileFilter() {
	return baseTokenizer.getFileFilter();
}
 
Example #13
Source Project: api-mining   Author: mast-group   File: CppTokenTypeTokenizer.java    License: GNU General Public License v3.0 4 votes vote down vote up
@Override
public AbstractFileFilter getFileFilter() {
	return CPP_CODE_FILTER;
}
 
Example #14
Source Project: api-mining   Author: mast-group   File: AbstractPythonTokenizer.java    License: GNU General Public License v3.0 4 votes vote down vote up
@Override
public AbstractFileFilter getFileFilter() {
	return pythonCodeFilter;
}
 
Example #15
Source Project: api-mining   Author: mast-group   File: JavascriptTokenizer.java    License: GNU General Public License v3.0 4 votes vote down vote up
@Override
public AbstractFileFilter getFileFilter() {
	return JAVASCRIPT_CODE_FILTER;
}
 
Example #16
Source Project: api-mining   Author: mast-group   File: FormattingTokenizer.java    License: GNU General Public License v3.0 4 votes vote down vote up
@Override
public AbstractFileFilter getFileFilter() {
	return baseTokenizer.getFileFilter();
}
 
Example #17
Source Project: tassal   Author: mast-group   File: JavaTypeTokenizer.java    License: BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@Override
public AbstractFileFilter getFileFilter() {
	return baseTokenizer.getFileFilter();
}
 
Example #18
Source Project: tassal   Author: mast-group   File: JavaTokenTypeTokenizer.java    License: BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@Override
public AbstractFileFilter getFileFilter() {
	return javaCodeFiler;
}
 
Example #19
Source Project: tassal   Author: mast-group   File: JavaWhitespaceTokenizer.java    License: BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@Override
public AbstractFileFilter getFileFilter() {
	return javaCodeFilter;
}
 
Example #20
Source Project: tassal   Author: mast-group   File: JavaWhitespaceTokenizer.java    License: BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@Override
public AbstractFileFilter getFileFilter() {
	final TokenizerImplementation tok = new TokenizerImplementation();
	return tok.getFileFilter();
}
 
Example #21
Source Project: tassal   Author: mast-group   File: JavaASTAnnotatedTokenizer.java    License: BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@Override
public AbstractFileFilter getFileFilter() {
	return baseTokenizer.getFileFilter();
}
 
Example #22
Source Project: tassal   Author: mast-group   File: JavaTokenizer.java    License: BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@Override
public AbstractFileFilter getFileFilter() {
	return javaCodeFileFilter;
}
 
Example #23
Source Project: tassal   Author: mast-group   File: AbstractJygmentsTokenizer.java    License: BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@Override
public AbstractFileFilter getFileFilter() {
	return codeFilter;
}
 
Example #24
Source Project: tassal   Author: mast-group   File: CDTTokenizer.java    License: BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@Override
public AbstractFileFilter getFileFilter() {
	return C_CODE_TOKENIZER;
}
 
Example #25
Source Project: tassal   Author: mast-group   File: CppWhitespaceTokenizer.java    License: BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@Override
public AbstractFileFilter getFileFilter() {
	return CPP_CODE_FILTER;
}
 
Example #26
Source Project: tassal   Author: mast-group   File: AbstractCdtASTAnnotatedTokenizer.java    License: BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@Override
public AbstractFileFilter getFileFilter() {
	return baseTokenizer.getFileFilter();
}
 
Example #27
Source Project: tassal   Author: mast-group   File: CppTokenTypeTokenizer.java    License: BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@Override
public AbstractFileFilter getFileFilter() {
	return CPP_CODE_FILTER;
}
 
Example #28
Source Project: tassal   Author: mast-group   File: AbstractPythonTokenizer.java    License: BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@Override
public AbstractFileFilter getFileFilter() {
	return pythonCodeFilter;
}
 
Example #29
Source Project: tassal   Author: mast-group   File: JavascriptTokenizer.java    License: BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@Override
public AbstractFileFilter getFileFilter() {
	return JAVASCRIPT_CODE_FILTER;
}
 
Example #30
Source Project: tassal   Author: mast-group   File: FormattingTokenizer.java    License: BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@Override
public AbstractFileFilter getFileFilter() {
	return baseTokenizer.getFileFilter();
}