001/*
002** Authored by Timothy Gerard Endres
003** <mailto:time@gjt.org>  <http://www.trustice.com>
004** 
005** This work has been placed into the public domain.
006** You may use this work in any way and for any purpose you wish.
007**
008** THIS SOFTWARE IS PROVIDED AS-IS WITHOUT WARRANTY OF ANY KIND,
009** NOT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY. THE AUTHOR
010** OF THIS SOFTWARE, ASSUMES _NO_ RESPONSIBILITY FOR ANY
011** CONSEQUENCE RESULTING FROM THE USE, MODIFICATION, OR
012** REDISTRIBUTION OF THIS SOFTWARE. 
013** 
014*/
015
016package com.ice.tar;
017
018import java.io.File;
019
020/**
021 * This interface indicates if a file qualifies for ASCII translation.
022 * To support customization of TAR translation, this interface allows
023 * the programmer to provide an object that will check files that do
024 * not match the MIME types file's check for 'text/*' types. To provide
025 * your own typer, subclass this class and set the TarArchive's TransFileTyper
026 * via the method setTransFileTyper().
027 */
028
029public class
030TarTransFileTyper
031        {
032        /**
033         * Return true if the file should be translated as ASCII.
034         *
035         * @param f The file to be checked to see if it need ASCII translation.
036         */
037
038        public boolean
039        isAsciiFile( File f )
040                {
041                return false;
042                }
043
044        /**
045         * Return true if the file should be translated as ASCII based on its name.
046         * The file DOES NOT EXIST. This is called during extract, so all we know
047         * is the file name.
048         *
049         * @param name The name of the file to be checked to see if it need ASCII
050         *        translation.
051         */
052
053        public boolean
054        isAsciiFile( String name )
055                {
056                return false;
057                }
058
059        }