Package org.eclipse.jdt.ui.jarpackager
Class JarWriter2
java.lang.Object
org.eclipse.jdt.ui.jarpackager.JarWriter2
Deprecated, for removal: This API element is subject to removal in a future version.
Creates a JAR file for the given JAR package data.
Clients may subclass.
- Since:
- 3.1
- See Also:
-
Constructor Summary
ConstructorDescriptionJarWriter2
(JarPackageData jarPackage, org.eclipse.swt.widgets.Shell parent) Deprecated, for removal: This API element is subject to removal in a future version.Creates an instance which is used to create a JAR based on the given JarPackage. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addDirectories
(org.eclipse.core.runtime.IPath destinationPath, File correspondingFile) Deprecated, for removal: This API element is subject to removal in a future version.Creates the directory entries for the given path and writes it to the current archive.protected void
addFile
(org.eclipse.core.resources.IFile resource, org.eclipse.core.runtime.IPath path, File correspondingFile) Deprecated, for removal: This API element is subject to removal in a future version.Creates a new JarEntry with the passed path and contents, and writes it to the current archive.protected boolean
canCreateJar
(org.eclipse.swt.widgets.Shell parent) Deprecated, for removal: This API element is subject to removal in a future version.Checks if the JAR file can be overwritten.void
close()
Deprecated, for removal: This API element is subject to removal in a future version.Closes the archive and does all required cleanup.void
write
(org.eclipse.core.resources.IFile resource, org.eclipse.core.runtime.IPath destinationPath) Deprecated, for removal: This API element is subject to removal in a future version.Writes the passed resource to the current archive.
-
Constructor Details
-
JarWriter2
public JarWriter2(JarPackageData jarPackage, org.eclipse.swt.widgets.Shell parent) throws org.eclipse.core.runtime.CoreException Deprecated, for removal: This API element is subject to removal in a future version.Creates an instance which is used to create a JAR based on the given JarPackage.- Parameters:
jarPackage
- the JAR specificationparent
- the shell used to display question dialogs, ornull
if "false/no/cancel" is the answer and no dialog should be shown- Throws:
org.eclipse.core.runtime.CoreException
- to signal any other unusual termination. This can also be used to return information in the status object.
-
-
Method Details
-
close
public void close() throws org.eclipse.core.runtime.CoreExceptionDeprecated, for removal: This API element is subject to removal in a future version.Closes the archive and does all required cleanup.- Throws:
org.eclipse.core.runtime.CoreException
- to signal any other unusual termination. This can also be used to return information in the status object.
-
write
public void write(org.eclipse.core.resources.IFile resource, org.eclipse.core.runtime.IPath destinationPath) throws org.eclipse.core.runtime.CoreException Deprecated, for removal: This API element is subject to removal in a future version.Writes the passed resource to the current archive.- Parameters:
resource
- the file to be writtendestinationPath
- the path for the file inside the archive- Throws:
org.eclipse.core.runtime.CoreException
- to signal any other unusual termination. This can also be used to return information in the status object.
-
addFile
protected void addFile(org.eclipse.core.resources.IFile resource, org.eclipse.core.runtime.IPath path, File correspondingFile) throws IOException, org.eclipse.core.runtime.CoreException Deprecated, for removal: This API element is subject to removal in a future version.Creates a new JarEntry with the passed path and contents, and writes it to the current archive.- Parameters:
resource
- the file to writepath
- the path inside the archivecorrespondingFile
- the corresponding file in the file system ornull
if it doesn't exist- Throws:
IOException
- if an I/O error has occurredorg.eclipse.core.runtime.CoreException
- if the resource can-t be accessed
-
addDirectories
protected void addDirectories(org.eclipse.core.runtime.IPath destinationPath, File correspondingFile) throws IOException Deprecated, for removal: This API element is subject to removal in a future version.Creates the directory entries for the given path and writes it to the current archive.- Parameters:
destinationPath
- the path to addcorrespondingFile
- the corresponding file in the file system ornull
if it doesn't exist- Throws:
IOException
- if an I/O error has occurred
-
canCreateJar
protected boolean canCreateJar(org.eclipse.swt.widgets.Shell parent) Deprecated, for removal: This API element is subject to removal in a future version.Checks if the JAR file can be overwritten. If the JAR package setting does not allow to overwrite the JAR then a dialog will ask the user again.- Parameters:
parent
- the parent for the dialog, ornull
if no dialog should be presented- Returns:
true
if it is OK to create the JAR
-
JarWriter3
instead which leverages newEFS
support