1 /******************************************************************************* 2 * Copyright (c) 2000, 2005 IBM Corporation and others. 3 * All rights reserved. This program and the accompanying materials 4 * are made available under the terms of the Eclipse Public License v1.0 5 * which accompanies this distribution, and is available at 6 * http://www.eclipse.org/legal/epl-v10.html 7 * 8 * Contributors: 9 * IBM Corporation - initial API and implementation 10 *******************************************************************************/ 11 package org.eclipse.jdt.ui.jarpackager; 12 13 import org.eclipse.core.runtime.CoreException; 14 import org.eclipse.core.runtime.IStatus; 15 16 /** 17 * Writes the description file of a JAR package data object. 18 * <p> 19 * The format is defined by the client who implements the 20 * reader/writer pair. 21 * </p> 22 * 23 * @see org.eclipse.jdt.ui.jarpackager.JarPackageData 24 * @see org.eclipse.jdt.ui.jarpackager.IJarDescriptionReader 25 * @since 2.0 26 */ 27 public interface IJarDescriptionWriter { 28 29 /** 30 * Writes the JAR package data to the description file 31 * to to the underlying stream. 32 * <p> 33 * It is the client's responsibility to close this writer. 34 * </p> 35 * 36 * @param jarPackage the jar package data to write 37 * 38 * @throws CoreException if writing fails, e.g. I/O error during write operation 39 */ 40 void write(JarPackageData jarPackage) throws CoreException; 41 42 /** 43 * Closes this writer. 44 * <p> 45 * It is the client's responsibility to close this writer. 46 * </p> 47 * 48 * @throws CoreException if closing fails, e.g. I/O error during close operation 49 */ 50 public void close() throws CoreException; 51 52 /** 53 * Returns the status of this reader. 54 * If there were any errors, the result is a status object containing 55 * individual status objects for each error. 56 * If there were no errors, the result is a status object with error code <code>OK</code>. 57 * 58 * @return the status of this operation 59 */ 60 public IStatus getStatus(); 61 } 62