proguard.io
Interface DataEntryWriter

All Known Implementing Classes:
CascadingDataEntryWriter, DirectoryWriter, FilteredDataEntryWriter, JarWriter, ParentDataEntryWriter

public interface DataEntryWriter

This interface provides methods for writing data entries, such as ZIP entries or files. The implementation determines to which type of data entry the data will be written.


Method Summary
 void close()
          Finishes writing all data entries.
 boolean createDirectory(DataEntry dataEntry)
          Creates a directory.
 java.io.OutputStream getOutputStream(DataEntry dataEntry)
          Returns an output stream for writing data.
 java.io.OutputStream getOutputStream(DataEntry dataEntry, Finisher finisher)
          Returns an output stream for writing data.
 

Method Detail

createDirectory

boolean createDirectory(DataEntry dataEntry)
                        throws java.io.IOException
Creates a directory.

Parameters:
dataEntry - the data entry for which the directory is to be created.
Returns:
whether the directory has been created.
Throws:
java.io.IOException

getOutputStream

java.io.OutputStream getOutputStream(DataEntry dataEntry)
                                     throws java.io.IOException
Returns an output stream for writing data. The caller must not close the output stream; closing the output stream is the responsibility of the implementation of this interface.

Parameters:
dataEntry - the data entry for which the output stream is to be created.
Returns:
the output stream. The stream may be null to indicate that the data entry should not be written.
Throws:
java.io.IOException

getOutputStream

java.io.OutputStream getOutputStream(DataEntry dataEntry,
                                     Finisher finisher)
                                     throws java.io.IOException
Returns an output stream for writing data. The caller must not close the output stream; closing the output stream is the responsibility of the implementation of this interface.

Parameters:
dataEntry - the data entry for which the output stream is to be created.
finisher - the optional finisher that will be called before this class closes the output stream (at some later point in time) that will be returned (now).
Returns:
the output stream. The stream may be null to indicate that the data entry should not be written.
Throws:
java.io.IOException

close

void close()
           throws java.io.IOException
Finishes writing all data entries.

Throws:
java.io.IOException