1 /* 2 * ArchiveEntryFactory.java 3 * 4 * Created on 3. Dezember 2006, 20:29 5 */ 6 7 package de.schlichtherle.io.archive.spi; 8 9 import java.io.CharConversionException; 10 11 /** 12 * A factory for archive entries. 13 * <p> 14 * In TrueZIP 6, there is no need to implement this interface. 15 * Its implemented by the package private <code>ArchiveController</code> 16 * class in order to allow one constructor of the package private 17 * <code>ArchiveFileSystem</code> class to create archive entries for 18 * missing parent directories. 19 * <p> 20 * TODO: In TrueZIP 7, this interface will be extended by the 21 * {@link ArchiveDriver} interface and replace the 22 * {@link ArchiveDriver#createArchiveEntry} method. 23 * The latter method requires an additional 24 * {@link de.schlichtherle.io.archive.Archive} parameter which is never 25 * used and could be wrapped in another object if really needed. 26 * The refactoring will simplify the archive controller class and all archive 27 * driver implementations and make the archive file system class a tiny 28 * little bit faster. 29 * 30 * @author Christian Schlichtherle 31 * @version @version@ 32 * @since TrueZIP 6.4 33 */ 34 public interface ArchiveEntryFactory { 35 /** 36 * Creates a new {@link ArchiveEntry} instance for <code>path</code> which 37 * may be used within an {@link OutputArchive}. 38 * 39 * @param name The path name of the entry to create 40 * - never <code>null</code>. 41 * @param blueprint If not <code>null</code>, then the newly created entry 42 * shall inherit as much attributes from this object as possible 43 * (with the exception of the name). 44 * This is typically used for archive copy operations. 45 * Note that there is no guarantee on the runtime type of this 46 * object; it may have been created by other drivers. 47 * It is safe to ignore the <code>metaData</code> property when 48 * copying entries. 49 * @return A newly created <code>ArchiveEntry</code> instance. 50 * @throws CharConversionException If <code>name</code> contains illegal 51 * characters. 52 * @see ArchiveEntry 53 */ 54 ArchiveEntry createArchiveEntry( 55 String name, 56 ArchiveEntry blueprint) 57 throws CharConversionException; 58 } 59