Author: adietish
Date: 2011-06-01 11:52:54 -0400 (Wed, 01 Jun 2011)
New Revision: 31734
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/xpl/PublishCopyUtil.java
Log:
[JBIDE-9054] made code more readable (no functional change!)
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/xpl/PublishCopyUtil.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/xpl/PublishCopyUtil.java 2011-06-01
15:44:56 UTC (rev 31733)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/xpl/PublishCopyUtil.java 2011-06-01
15:52:54 UTC (rev 31734)
@@ -307,13 +307,17 @@
public IStatus[] deleteResource(IPath resource, IProgressMonitor monitor) {
resource = deployRootFolder.append(resource);
- if( resource.toFile().isDirectory())
- return deleteDirectory(resource.toFile(), monitor);
- if( !resource.toFile().delete()) {
- IStatus s = new Status(IStatus.ERROR, ServerPlugin.PLUGIN_ID, 0,
NLS.bind(Messages.errorDeleting, resource.toFile().getAbsolutePath()), null);
- return new IStatus[]{s};
+ File file = resource.toFile();
+ IStatus[] results = new IStatus[]{};
+ if( file.isDirectory()) {
+ results = deleteDirectory(resource.toFile(), monitor);
+ } else {
+ if( !file.delete()) {
+ IStatus s = new Status(IStatus.ERROR, ServerPlugin.PLUGIN_ID, 0,
NLS.bind(Messages.errorDeleting, resource.toFile().getAbsolutePath()), null);
+ results = new IStatus[]{s};
+ }
}
- return new IStatus[] {};
+ return results;
}
/**