geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From de...@apache.org
Subject svn commit: r988386 - in /geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core: jaxb/JAXBUtils.java operations/GeronimoServerPluginManager.java
Date Tue, 24 Aug 2010 04:58:15 GMT
Author: delos
Date: Tue Aug 24 04:58:14 2010
New Revision: 988386

URL: http://svn.apache.org/viewvc?rev=988386&view=rev
Log:
GERONIMODEVTOOLS-668 fix issue in converting artifact to plugin

Modified:
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/jaxb/JAXBUtils.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/operations/GeronimoServerPluginManager.java

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/jaxb/JAXBUtils.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/jaxb/JAXBUtils.java?rev=988386&r1=988385&r2=988386&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/jaxb/JAXBUtils.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/jaxb/JAXBUtils.java
Tue Aug 24 04:58:14 2010
@@ -127,13 +127,13 @@ public class JAXBUtils {
     }
 
     public static void marshalPlugin(JAXBElement jaxbElement, OutputStream outputStream)
throws Exception {
-        //currently only JAXB21Utils provide this method,so invoke it directly
-        providers.get("2.1").marshalPlugin(jaxbElement, outputStream);
+        //for 3.0 jaxb provider,invoke it directly
+       providers.get("3.0").marshalPlugin(jaxbElement, outputStream);
     }
 
     public static JAXBElement unmarshalPlugin(InputStream inputStream) {
-        //currently only JAXB21Utils provide this method,so invoke it directly
-        return providers.get("2.1").unmarshalPlugin(inputStream);
+        //for 3.0 jaxb provider,invoke it directly
+    	return providers.get("3.0").unmarshalPlugin(inputStream);
     }
 
     public static Object getValue( Object element, String name ) throws Exception {

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/operations/GeronimoServerPluginManager.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/operations/GeronimoServerPluginManager.java?rev=988386&r1=988385&r2=988386&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/operations/GeronimoServerPluginManager.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/operations/GeronimoServerPluginManager.java
Tue Aug 24 04:58:14 2010
@@ -219,11 +219,12 @@ public class GeronimoServerPluginManager
 
         Artifact artifact = Artifact.create(configId);
         File dir = new File (getArtifactLocation(artifact));
+        File artifactFile = new File(addFilename(dir.getAbsolutePath(),artifact));
 
-        if (!dir.isDirectory()) { // must be a packed (JAR-formatted) plugin
+        if (!artifactFile.isDirectory()) { // must be a packed (JAR-formatted) plugin
             try {
                 File temp = new File(dir.getParentFile(), dir.getName() + ".temp");
-                JarFile input = new JarFile(dir);
+                JarFile input = new JarFile(artifactFile);
                 Manifest manifest = input.getManifest();
                 JarOutputStream out = manifest == null ? new JarOutputStream(
                         new BufferedOutputStream(new FileOutputStream(temp)))
@@ -252,13 +253,13 @@ public class GeronimoServerPluginManager
                 out.flush();
                 out.close();
                 input.close();
-                if (!dir.delete()) {
-                    String message = CommonMessages.bind(CommonMessages.errorDeletePlugin,
dir.getAbsolutePath());
+                if (!artifactFile.delete()) {
+                    String message = CommonMessages.bind(CommonMessages.errorDeletePlugin,
artifactFile.getAbsolutePath());
                     Trace.tracePoint("Throw", "GeronimoServerPluginManager.savePluginXML",
message);
                     throw new Exception(message);
                 }
-                if (!temp.renameTo(dir)) {
-                    String message = CommonMessages.bind(CommonMessages.errorMovePlugin,
temp.getAbsolutePath(), dir.getAbsolutePath());
+                if (!temp.renameTo(artifactFile)) {
+                    String message = CommonMessages.bind(CommonMessages.errorMovePlugin,
temp.getAbsolutePath(), artifactFile.getAbsolutePath());
                     Trace.tracePoint("Throw", "GeronimoServerPluginManager.savePluginXML",
message);
                     throw new Exception(message);
                 }



Mime
View raw message