Remote Systems
v6.4.1

com.ibm.etools.systems.files.importexport.jar
Class RemoteJarFileExportOperation

java.lang.Object
  extended byWorkspaceModifyOperation
      extended bycom.ibm.etools.systems.files.importexport.jar.RemoteJarFileExportOperation
All Implemented Interfaces:
IRemoteJarExportRunnable

public class RemoteJarFileExportOperation
extends WorkspaceModifyOperation
implements IRemoteJarExportRunnable

See Also:
Serialized Form

Constructor Summary
RemoteJarFileExportOperation(RemoteJarExportData[] jarExports, Shell parent)
          Creates an instance of this class.
RemoteJarFileExportOperation(RemoteJarExportData jarExport, Shell parent)
          Creates an instance of this class.
 
Method Summary
protected  void addError(String message, Throwable error)
          Adds a new error to the list with the passed information.
protected  void addInfo(String message, Throwable error)
          Adds a new info to the list with the passed information.
protected  void addToStatus(CoreException ex)
           
protected  void addWarning(String message, Throwable error)
          Adds a new warning to the list with the passed information.
protected  boolean canBeExported(boolean hasErrors, boolean hasWarnings)
           
protected  int countSelectedElements()
          Answers the number of file resources specified by the JAR package.
protected  IFile createFileHandle(IPath filePath)
          Creates a file resource handle for the file with the given workspace path.
protected  IFolder createFolderHandle(IPath folderPath)
          Creates a folder resource handle for the folder with the given workspace path.
protected  void execute(IProgressMonitor progressMonitor)
          Exports the resources as specified by the JAR package.
protected  void exportElement(Object element, IProgressMonitor progressMonitor)
          Exports the passed resource to the JAR file
protected  void exportSelectedElements(IProgressMonitor progressMonitor)
          Exports the resources as specified by the JAR package.
protected  Iterator filesOnClasspath(IFile file, IPath pathInJar, IJavaProject javaProject, IPackageFragmentRoot pkgRoot, IProgressMonitor progressMonitor)
          Returns an iterator on a list with files that correspond to the passed file and that are on the classpath of its project.
protected  Iterator filesOnClasspath(IFile file, IPath pathInJar, IJavaProject javaProject, IProgressMonitor progressMonitor)
          Deprecated. As of 2.1 use the method with additional IPackageFragmentRoot paramter
 IStatus getStatus()
          Returns the status of this operation.
protected  boolean isDescendant(List resources, IResource child)
          Answer a boolean indicating whether the passed child is a descendant of one or more members of the passed resources collection
protected  boolean preconditionsOK()
           
protected  void reportPossibleCompileProblems(IFile file, boolean hasErrors, boolean hasWarnings, boolean canBeExported)
           
protected  void saveDescription()
           
protected  void saveFiles()
           
protected  void saveManifest()
           
 void singleRun(IProgressMonitor progressMonitor)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RemoteJarFileExportOperation

public RemoteJarFileExportOperation(RemoteJarExportData jarExport,
                                    Shell parent)
Creates an instance of this class.

Parameters:
parent - the parent for the dialog, or null if no dialog should be presented

RemoteJarFileExportOperation

public RemoteJarFileExportOperation(RemoteJarExportData[] jarExports,
                                    Shell parent)
Creates an instance of this class.

Parameters:
parent - the parent for the dialog, or null if no dialog should be presented
Method Detail

addToStatus

protected void addToStatus(CoreException ex)

addInfo

protected void addInfo(String message,
                       Throwable error)
Adds a new info to the list with the passed information. Normally the export operation continues after a warning.

Parameters:
message - the message

addWarning

protected void addWarning(String message,
                          Throwable error)
Adds a new warning to the list with the passed information. Normally the export operation continues after a warning.

Parameters:
message - the message

addError

protected void addError(String message,
                        Throwable error)
Adds a new error to the list with the passed information. Normally an error terminates the export operation.

Parameters:
message - the message

countSelectedElements

protected int countSelectedElements()
Answers the number of file resources specified by the JAR package.

Returns:
int

exportElement

protected void exportElement(Object element,
                             IProgressMonitor progressMonitor)
                      throws InterruptedException
Exports the passed resource to the JAR file

Parameters:
element - the resource or JavaElement to export
Throws:
InterruptedException

exportSelectedElements

protected void exportSelectedElements(IProgressMonitor progressMonitor)
                               throws InterruptedException
Exports the resources as specified by the JAR package.

Throws:
InterruptedException

filesOnClasspath

protected Iterator filesOnClasspath(IFile file,
                                    IPath pathInJar,
                                    IJavaProject javaProject,
                                    IProgressMonitor progressMonitor)
                             throws CoreException
Deprecated. As of 2.1 use the method with additional IPackageFragmentRoot paramter

Returns an iterator on a list with files that correspond to the passed file and that are on the classpath of its project.

Parameters:
file - the file for which to find the corresponding classpath resources
pathInJar - the path that the file has in the JAR (i.e. project and source folder segments removed)
javaProject - the javaProject that contains the file
Returns:
the iterator over the corresponding classpath files for the given file
Throws:
CoreException

filesOnClasspath

protected Iterator filesOnClasspath(IFile file,
                                    IPath pathInJar,
                                    IJavaProject javaProject,
                                    IPackageFragmentRoot pkgRoot,
                                    IProgressMonitor progressMonitor)
                             throws CoreException
Returns an iterator on a list with files that correspond to the passed file and that are on the classpath of its project.

Parameters:
file - the file for which to find the corresponding classpath resources
pathInJar - the path that the file has in the JAR (i.e. project and source folder segments removed)
javaProject - the javaProject that contains the file
pkgRoot - the package fragment root that contains the file
Returns:
the iterator over the corresponding classpath files for the given file
Throws:
CoreException

createFileHandle

protected IFile createFileHandle(IPath filePath)
Creates a file resource handle for the file with the given workspace path. This method does not create the file resource; this is the responsibility of createFile.

Parameters:
filePath - the path of the file resource to create a handle for
Returns:
the new file resource handle

createFolderHandle

protected IFolder createFolderHandle(IPath folderPath)
Creates a folder resource handle for the folder with the given workspace path.

Parameters:
folderPath - the path of the folder to create a handle for
Returns:
the new folder resource handle

getStatus

public IStatus getStatus()
Returns the status of this operation. The result is a status object containing individual status objects.

Specified by:
getStatus in interface IRemoteJarExportRunnable
Returns:
the status of this operation

isDescendant

protected boolean isDescendant(List resources,
                               IResource child)
Answer a boolean indicating whether the passed child is a descendant of one or more members of the passed resources collection

Parameters:
resources - a List contain potential parents
child - the resource to test
Returns:
a boolean indicating if the child is a descendant

canBeExported

protected boolean canBeExported(boolean hasErrors,
                                boolean hasWarnings)
                         throws CoreException
Throws:
CoreException

reportPossibleCompileProblems

protected void reportPossibleCompileProblems(IFile file,
                                             boolean hasErrors,
                                             boolean hasWarnings,
                                             boolean canBeExported)

execute

protected void execute(IProgressMonitor progressMonitor)
                throws InvocationTargetException,
                       InterruptedException
Exports the resources as specified by the JAR package.

Parameters:
progressMonitor - the progress monitor that displays the progress
Throws:
InvocationTargetException
InterruptedException
See Also:
getStatus()

singleRun

public void singleRun(IProgressMonitor progressMonitor)
               throws InvocationTargetException,
                      InterruptedException
Throws:
InvocationTargetException
InterruptedException

preconditionsOK

protected boolean preconditionsOK()

saveFiles

protected void saveFiles()

saveDescription

protected void saveDescription()
                        throws CoreException,
                               IOException
Throws:
CoreException
IOException

saveManifest

protected void saveManifest()
                     throws CoreException,
                            IOException
Throws:
CoreException
IOException

Remote Systems
v6.4.1

Copyright © 2005 IBM Corp. All Rights Reserved.

Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.