Package com.mucommander.commons.file.filter

Examples of com.mucommander.commons.file.filter.ExtensionFilenameFilter


        this.tempDestJar = tempDestJar;
        this.classLoader = getClass().getClassLoader();

        directoryOrClassFileFilter = new OrFileFilter(
            new AttributeFileFilter(FileAttribute.DIRECTORY),
            new ExtensionFilenameFilter(".class")
        );
    }
View Full Code Here


public class ImageFactory implements ViewerFactory {
    /** Used to filter out file extensions that the image viewer cannot open. */
    private ExtensionFilenameFilter filter;

    public ImageFactory() {
        filter = new ExtensionFilenameFilter(new String[] {".png", ".gif", ".jpg", ".jpeg"});
        filter.setCaseSensitive(false);
    }
View Full Code Here

        // Adds the extensions folder to the classpath.
        addToClassPath(getExtensionsFolder());

        // Adds all JAR files contained by the extensions folder to the classpath.
        files = getExtensionsFolder().ls(new ExtensionFilenameFilter(".jar"));
        for (AbstractFile file : files)
            addToClassPath(file);
    }
View Full Code Here

    /**
     * Creates a new instance of <code>ClassFinder</code>.
     */
    public ClassFinder() {
        filter = new OrFileFilter(
            new ExtensionFilenameFilter(".class"),
            new AttributeFileFilter(FileAttribute.DIRECTORY)
        );
    }
View Full Code Here

    private static Iterator<String> getThemeNames(AbstractFile themeFolder) {
        AbstractFile[] files;
        Vector<String> names;

        try {
            files = themeFolder.ls(new ExtensionFilenameFilter(".xml"));
            names = new Vector<String>();
            for (AbstractFile file : files)
                names.add(getThemeName(file));
            return names.iterator();
        }
View Full Code Here

     * @param  file currently selected file.
     * @return      the filter that should be applied by this action.
     */
    private FilenameFilter getFilter(AbstractFile file) {
        String                  ext;
        ExtensionFilenameFilter filter;

        // If no extension has been configured, analyse the current selection.
        if((ext = getExtension()) == null) {

            // If there is no current selection, abort.
            if(file == null)
                return null;

            // If the current file doesn't have an extension, return a filename filter that
            // match null extensions.
            if((ext = file.getExtension()) == null)
                return new AbstractFilenameFilter() {
                    public boolean accept(String name) {return AbstractFile.getExtension(name) == null;}
                };
        }

        // At this point, ext contains the extension that should be matched.
        filter = new ExtensionFilenameFilter("." + ext);

        // Initialises the filter's case-sensitivy depending on the action's propeties.
        filter.setCaseSensitive(isCaseSensitive());

        return filter;
    }
View Full Code Here

TOP

Related Classes of com.mucommander.commons.file.filter.ExtensionFilenameFilter

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.