org.at4j.zip.builder
Class DefaultInternalFileAttributesStrategy

java.lang.Object
  extended by org.at4j.zip.builder.DefaultInternalFileAttributesStrategy
All Implemented Interfaces:
InternalFileAttributesStrategy

public class DefaultInternalFileAttributesStrategy
extends Object
implements InternalFileAttributesStrategy

This is the InternalFileAttributesStrategy implementation that is used by default by the ZipBuilder.

It has a set of file extensions for files that it thinks are text files. This set can be modified at will by clients. The default list was created by taking all file name extensions for file types that could be suspected to contain character data from the mime.types configuration file in the Apache web server version 2.0.63.

Since:
1.0
Author:
Karl Gustafsson

Constructor Summary
DefaultInternalFileAttributesStrategy()
          Create a default internal file attributes strategy instance using the default list of text file name extensions.
 
Method Summary
 ZipInternalFileAttributes createInternalFileAttributes(UnixEntityType type, AbsoluteLocation loc)
          Create internal file attributes based on the supplied information.
 Set<String> getTextFileNameExtensionSet()
          Get the set containing the file name extensions for files that this strategy object thinks are text files.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultInternalFileAttributesStrategy

public DefaultInternalFileAttributesStrategy()
Create a default internal file attributes strategy instance using the default list of text file name extensions.

Method Detail

getTextFileNameExtensionSet

public Set<String> getTextFileNameExtensionSet()
Get the set containing the file name extensions for files that this strategy object thinks are text files. The set returned is the actual set used by this object, so updates to that set will be reflected in this object's behavior.

Extensions are added to the set without the leading dot.

Returns:
The set containing the file name extensions for files that this object thinks are text files.

createInternalFileAttributes

public ZipInternalFileAttributes createInternalFileAttributes(UnixEntityType type,
                                                              AbsoluteLocation loc)
Description copied from interface: InternalFileAttributesStrategy
Create internal file attributes based on the supplied information.

Specified by:
createInternalFileAttributes in interface InternalFileAttributesStrategy
Parameters:
type - The type of entity that is to be added to a Zip archive.
loc - The location of the entity.
Returns:
Internal attributes for the entity.