Class JarWriter

    • Constructor Detail

      • JarWriter

        public JarWriter​(JarPackageData jarPackage,
                         Shell parent)
                  throws CoreException
        Deprecated.
        Creates an instance which is used to create a JAR based on the given JarPackage.
        Parameters:
        jarPackage - the JAR specification
        parent - the shell used to display question dialogs, or null if "false/no/cancel" is the answer and no dialog should be shown
        Throws:
        CoreException - to signal any other unusual termination. This can also be used to return information in the status object.
    • Method Detail

      • close

        public void close()
                   throws CoreException
        Deprecated.
        Closes the archive and does all required cleanup.
        Throws:
        CoreException - to signal any other unusual termination. This can also be used to return information in the status object.
      • write

        public void write​(IFile resource,
                          IPath destinationPath)
                   throws CoreException
        Deprecated.
        Writes the passed resource to the current archive.
        Parameters:
        resource - the file to be written
        destinationPath - the path for the file inside the archive
        Throws:
        CoreException - to signal any other unusual termination. This can also be used to return information in the status object.
      • write

        protected void write​(IPath path,
                             byte[] contents,
                             long lastModified)
                      throws IOException
        Deprecated.
        Creates a new JarEntry with the passed path and contents, and writes it to the current archive.
        Parameters:
        path - the path inside the archive
        contents - the bytes to write
        lastModified - a long which represents the last modification date
        Throws:
        IOException - if an I/O error has occurred
      • canCreateJar

        protected boolean canCreateJar​(Shell parent)
        Deprecated.
        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, or null if no dialog should be presented
        Returns:
        true if it is OK to create the JAR