mirror of
https://github.com/apache/cloudstack
synced 2026-08-31 09:08:00 +00:00
Virtualbox export creates an OVF file that is not compatible with VMware import functions. This causes import errors when the systemvm ova is imported into cloudstack. This patch fixes the issue by using an XSLT transformation to convert the generated ovf into a format this is compatible with vmware. This is a squashed commit Based on the following commits in master:794d47c5f2bf26efc5515d24843ef595a92ad2e3da8ee45a2450054fe06050054fe060ecf57c368a
35 lines
1.4 KiB
Java
35 lines
1.4 KiB
Java
// Licensed to the Apache Software Foundation (ASF) under one
|
|
// or more contributor license agreements. See the NOTICE file
|
|
// distributed with this work for additional information
|
|
// regarding copyright ownership. The ASF licenses this file
|
|
// to you under the Apache License, Version 2.0 (the
|
|
// "License"); you may not use this file except in compliance
|
|
// with the License. You may obtain a copy of the License at
|
|
//
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
//
|
|
// Unless required by applicable law or agreed to in writing,
|
|
// software distributed under the License is distributed on an
|
|
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
// KIND, either express or implied. See the License for the
|
|
// specific language governing permissions and limitations
|
|
// under the License.
|
|
|
|
import javax.xml.transform.*;
|
|
import javax.xml.transform.stream.StreamResult;
|
|
import javax.xml.transform.stream.StreamSource;
|
|
import java.io.File;
|
|
import java.io.IOException;
|
|
import java.net.URISyntaxException;
|
|
|
|
public class Convert {
|
|
public static void main(String[] args) throws IOException, URISyntaxException, TransformerException {
|
|
TransformerFactory factory = TransformerFactory.newInstance();
|
|
Source xslt = new StreamSource(new File(args[0]));
|
|
Transformer transformer = factory.newTransformer(xslt);
|
|
|
|
Source text = new StreamSource(new File(args[1]));
|
|
transformer.transform(text, new StreamResult(new File(args[2])));
|
|
}
|
|
}
|