/** * Add a FileFilter to list of file filters to be accepted * * @param filter FileFilter to be added */ public void add(AbstractFilePersister filter) { filters.add(filter); String extension = filter.getExtension(); if (!extensions.contains(extension)) { extensions.add(filter.getExtension()); desc = ((desc == null) ? "" : desc + ", ") + "*." + extension; } }
/** * Find the base name of the given filename. * * <p>This is the name minus any valid file extension. Invalid extensions are left alone. * * @param n the given file name * @return the name (a String) without extension */ public String getBaseName(String n) { AbstractFilePersister p = getPersisterFromFileName(n); if (p == null) { return n; } int extLength = p.getExtension().length() + 1; return n.substring(0, n.length() - extLength); }
/** @return the extension of the default persister (just the text, not the ".") */ public String getDefaultExtension() { return defaultPersister.getExtension(); }