All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.javaswift.joss.client.website.AbstractFileObjects Maven / Gradle / Ivy

There is a newer version: 0.10.4
Show newest version
package org.javaswift.joss.client.website;

import java.util.Collection;
import java.util.Map;
import java.util.TreeMap;

public abstract class AbstractFileObjects implements FileObjects {

    private final Map fileObjects = new TreeMap();

    private final String[] ignoreFilters;

    public AbstractFileObjects() {
        this(new String[]{});
    }

    public AbstractFileObjects(final String[] ignoreFilters) {
        this.ignoreFilters = ignoreFilters;
    }

    protected void add(String path, FileObject fileObject) {
        this.fileObjects.put(path, fileObject);
    }

    @Override
    public Collection keys() {
        return this.fileObjects.keySet();
    }

    @Override
    public FileObject get(String path) {
        return this.fileObjects.get(path);
    }

    @Override
    public boolean ignore(String path) {
        for (String ignoreFilter : ignoreFilters) {
            if (path.equals(ignoreFilter)) {
                return true;
            }
        }
        return false;
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy