Author: adietish
Date: 2011-06-01 11:26:16 -0400 (Wed, 01 Jun 2011)
New Revision: 31732
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/LocalZippedPublisherUtil.java
Log:
[JBIDE-8920] extracted method to get better readable code (no functional change!)
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/LocalZippedPublisherUtil.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/LocalZippedPublisherUtil.java 2011-06-01
15:17:07 UTC (rev 31731)
+++
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/LocalZippedPublisherUtil.java 2011-06-01
15:26:16 UTC (rev 31732)
@@ -217,15 +217,11 @@
TrueZipUtil.createArchive(path);
de.schlichtherle.io.File root = TrueZipUtil.getFile(path,
TrueZipUtil.getJarArchiveDetector());
IModuleResource[] resources = getResources(module);
- results.addAll(Arrays.asList(copy(root, resources)));
+ IStatus[] copyResults = copy(root, resources);
+ results.addAll(Arrays.asList(copyResults));
IModule[] children = server.getChildModules(module, new NullProgressMonitor());
- for( int i = 0; i < children.length; i++ ) {
- if( ServerModelUtilities.isBinaryModule(children[i]))
- results.addAll(Arrays.asList(fullBinaryPublish(server, deployRoot, module,
children[i])));
- else
- results.addAll(Arrays.asList(fullPublish(server, deployRoot, combine(module,
children[i]))));
- }
+ publishChildren(server, deployRoot, module, results, children);
TrueZipUtil.umount();
hasBeenChanged = true;
return (IStatus[]) results.toArray(new IStatus[results.size()]);
@@ -234,6 +230,17 @@
return (IStatus[]) results.toArray(new IStatus[results.size()]);
}
}
+
+
+ private void publishChildren(IServer server, String deployRoot, IModule[] module,
ArrayList<IStatus> results,
+ IModule[] children) {
+ for( int i = 0; i < children.length; i++ ) {
+ if( ServerModelUtilities.isBinaryModule(children[i]))
+ results.addAll(Arrays.asList(fullBinaryPublish(server, deployRoot, module,
children[i])));
+ else
+ results.addAll(Arrays.asList(fullPublish(server, deployRoot, combine(module,
children[i]))));
+ }
+ }
protected IStatus[] publishChanges(IServer server, String deployRoot, IModule[] module)
{
IPath path = getOutputFilePath(module);
Show replies by date