org.eclipse.wst.server.core.util
Class PublishUtil

java.lang.Object
  extended by org.eclipse.wst.server.core.util.PublishUtil

public final class PublishUtil
extends java.lang.Object

Utility class with an assortment of useful file methods.

This class provides all its functionality through static members. It is not intended to be subclassed or instantiated.

Note: This class/interface is 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.

Since:
2.0

Method Summary
static org.eclipse.core.runtime.IStatus[] deleteDirectory(java.io.File dir, org.eclipse.core.runtime.IProgressMonitor monitor)
          Utility method to recursively delete a directory.
static org.eclipse.core.runtime.IStatus[] publishDelta(IModuleResourceDelta[] delta, org.eclipse.core.runtime.IPath path, org.eclipse.core.runtime.IProgressMonitor monitor)
          Handle a delta publish.
static org.eclipse.core.runtime.IStatus[] publishDelta(IModuleResourceDelta delta, org.eclipse.core.runtime.IPath path, org.eclipse.core.runtime.IProgressMonitor monitor)
          Handle a delta publish.
static org.eclipse.core.runtime.IStatus[] publishFull(IModuleResource[] resources, org.eclipse.core.runtime.IPath path, org.eclipse.core.runtime.IProgressMonitor monitor)
          Publish the given module resources to the given path.
static org.eclipse.core.runtime.IStatus[] publishSmart(IModuleResource[] resources, org.eclipse.core.runtime.IPath path, org.eclipse.core.runtime.IProgressMonitor monitor)
          Smart copy the given module resources to the given path.
static org.eclipse.core.runtime.IStatus[] publishZip(IModuleResource[] resources, org.eclipse.core.runtime.IPath path, org.eclipse.core.runtime.IProgressMonitor monitor)
          Creates a new zip file containing the given module resources.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

deleteDirectory

public static org.eclipse.core.runtime.IStatus[] deleteDirectory(java.io.File dir,
                                                                 org.eclipse.core.runtime.IProgressMonitor monitor)
Utility method to recursively delete a directory.

Parameters:
dir - a directory
monitor - a progress monitor, or null if progress reporting and cancellation are not desired
Returns:
a possibly-empty array of error and warning status

publishSmart

public static org.eclipse.core.runtime.IStatus[] publishSmart(IModuleResource[] resources,
                                                              org.eclipse.core.runtime.IPath path,
                                                              org.eclipse.core.runtime.IProgressMonitor monitor)
Smart copy the given module resources to the given path.

Parameters:
resources - an array of module resources
path - an external path to copy to
monitor - a progress monitor, or null if progress reporting and cancellation are not desired
Returns:
a possibly-empty array of error and warning status

publishDelta

public static org.eclipse.core.runtime.IStatus[] publishDelta(IModuleResourceDelta[] delta,
                                                              org.eclipse.core.runtime.IPath path,
                                                              org.eclipse.core.runtime.IProgressMonitor monitor)
Handle a delta publish.

Parameters:
delta - a module resource delta
path - the path to publish to
monitor - a progress monitor, or null if progress reporting and cancellation are not desired
Returns:
a possibly-empty array of error and warning status

publishDelta

public static org.eclipse.core.runtime.IStatus[] publishDelta(IModuleResourceDelta delta,
                                                              org.eclipse.core.runtime.IPath path,
                                                              org.eclipse.core.runtime.IProgressMonitor monitor)
Handle a delta publish.

Parameters:
delta - a module resource delta
path - the path to publish to
monitor - a progress monitor, or null if progress reporting and cancellation are not desired
Returns:
a possibly-empty array of error and warning status

publishFull

public static org.eclipse.core.runtime.IStatus[] publishFull(IModuleResource[] resources,
                                                             org.eclipse.core.runtime.IPath path,
                                                             org.eclipse.core.runtime.IProgressMonitor monitor)
Publish the given module resources to the given path.

Parameters:
resources - an array of module resources
path - a path to publish to
monitor - a progress monitor, or null if progress reporting and cancellation are not desired
Returns:
a possibly-empty array of error and warning status

publishZip

public static org.eclipse.core.runtime.IStatus[] publishZip(IModuleResource[] resources,
                                                            org.eclipse.core.runtime.IPath path,
                                                            org.eclipse.core.runtime.IProgressMonitor monitor)
Creates a new zip file containing the given module resources. Deletes the existing file (and doesn't create a new one) if resources is null or empty.

Parameters:
resources - an array of module resources
path - the path where the zip file should be created
monitor - a progress monitor, or null if progress reporting and cancellation are not desired
Returns:
a possibly-empty array of error and warning status