001 /*
002 * This file is part of muCommander, http://www.mucommander.com
003 * Copyright (C) 2002-2008 Maxence Bernard
004 *
005 * muCommander is free software; you can redistribute it and/or modify
006 * it under the terms of the GNU General Public License as published by
007 * the Free Software Foundation; either version 3 of the License, or
008 * (at your option) any later version.
009 *
010 * muCommander is distributed in the hope that it will be useful,
011 * but WITHOUT ANY WARRANTY; without even the implied warranty of
012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
013 * GNU General Public License for more details.
014 *
015 * You should have received a copy of the GNU General Public License
016 * along with this program. If not, see <http://www.gnu.org/licenses/>.
017 */
018
019 package com.mucommander.file.impl.ar;
020
021 import com.mucommander.file.AbstractArchiveFile;
022 import com.mucommander.file.AbstractFile;
023 import com.mucommander.file.ArchiveFormatProvider;
024 import com.mucommander.file.filter.ExtensionFilenameFilter;
025 import com.mucommander.file.filter.FilenameFilter;
026
027 import java.io.IOException;
028
029 /**
030 * This class is the provider for the 'Ar' archive format implemented by {@link ArArchiveFile}.
031 *
032 * @see com.mucommander.file.impl.ar.ArArchiveFile
033 * @author Nicolas Rinaudo, Maxence Bernard
034 */
035 public class ArFormatProvider implements ArchiveFormatProvider {
036
037 /** Static instance of the filename filter that matches archive filenames */
038 private final static ExtensionFilenameFilter filenameFilter = new ExtensionFilenameFilter(new String[]
039 {".ar", ".a", ".deb", ".udeb"}
040 );
041
042
043 //////////////////////////////////////////
044 // ArchiveFormatProvider implementation //
045 //////////////////////////////////////////
046
047 public AbstractArchiveFile getFile(AbstractFile file) throws IOException {
048 return new ArArchiveFile(file);
049 }
050
051 public FilenameFilter getFilenameFilter() {
052 return filenameFilter;
053 }
054 }