Created
July 22, 2010 20:58
-
-
Save ALRubinger/486584 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface StreamExporter extends Assignable | |
{ | |
//-------------------------------------------------------------------------------------|| | |
// Contracts --------------------------------------------------------------------------|| | |
//-------------------------------------------------------------------------------------|| | |
/** | |
* Exports this reference in an implementation-specific | |
* format represented by the returned {@link InputStream} | |
* | |
* @return {@link InputStream} to read the exported view | |
*/ | |
InputStream export(); | |
/** | |
* Exports provided archive in an implementation-specific format, | |
* written to the specified {@link OutputStream} target. The specified | |
* target will be closed upon completion. | |
* | |
* @param target | |
* @throws ArchiveExportException | |
* @throws IllegalArgumentException If the target is not specified or is closed | |
*/ | |
void exportTo(OutputStream target) throws ArchiveExportException, IllegalArgumentException; | |
/** | |
* Exports provided archive as in an implementation-specific format, written to the | |
* specified {@link File} target. If the target exists this call will | |
* fail with {@link IllegalArgumentException} | |
* | |
* @param archive | |
* @throws IllegalArgumentException If the target is not specified | |
* @throws FileExistsException If the target already exists | |
* @throws ArchiveExportException if the export process fails | |
*/ | |
void exportTo(File target) throws ArchiveExportException, FileExistsException, IllegalArgumentException; | |
/** | |
* Exports provided archive an implementation-specific format, written to the | |
* specified {@link File} target. If the target both exists and the "overwrite" | |
* flag is true, this call will allow the existing file to be overwritten, else | |
* the invocation will fail with {@link IllegalArgumentException} | |
* | |
* @param archive | |
* @throws IllegalArgumentException If the target is not specified | |
* @throws FileExistsException If the target both already exists and the overwrite flag is false | |
* @throws ArchiveExportException if the export process fails | |
*/ | |
void exportTo(File target, boolean overwrite) throws ArchiveExportException, FileExistsException, | |
IllegalArgumentException; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment