Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id E99CC200D5E for ; Sat, 23 Dec 2017 11:52:05 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id E8254160C32; Sat, 23 Dec 2017 10:52:05 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 3793B160C2F for ; Sat, 23 Dec 2017 11:52:05 +0100 (CET) Received: (qmail 57928 invoked by uid 500); 23 Dec 2017 10:52:04 -0000 Mailing-List: contact commits-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list commits@cloudstack.apache.org Received: (qmail 57774 invoked by uid 99); 23 Dec 2017 10:52:04 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 23 Dec 2017 10:52:03 +0000 From: GitBox To: commits@cloudstack.apache.org Subject: [GitHub] rafaelweingartner commented on a change in pull request #2146: CLOUDSTACK-4757: Support OVA files with multiple disks for templates Message-ID: <151402632343.6247.16046061624982651474.gitbox@gitbox.apache.org> archived-at: Sat, 23 Dec 2017 10:52:06 -0000 rafaelweingartner commented on a change in pull request #2146: CLOUDSTACK-4757: Support OVA files with multiple disks for templates URL: https://github.com/apache/cloudstack/pull/2146#discussion_r158580381 ########## File path: api/src/com/cloud/agent/api/storage/OVFHelper.java ########## @@ -0,0 +1,333 @@ +// 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. +package com.cloud.agent.api.storage; + +import java.io.File; +import java.io.IOException; +import java.io.PrintWriter; +import java.io.StringWriter; +import java.util.ArrayList; +import java.util.List; + +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerException; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.stream.StreamResult; + +import org.apache.log4j.Logger; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.NodeList; +import org.xml.sax.SAXException; + +import com.cloud.agent.api.to.DatadiskTO; +import com.cloud.utils.exception.CloudRuntimeException; + +public class OVFHelper { + private static final Logger s_logger = Logger.getLogger(OVFHelper.class); + + public List getOVFVolumeInfo(final String ovfFilePath) { + if (ovfFilePath == null || ovfFilePath.isEmpty()) { + return null; Review comment: What about returning an empty list here? ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: users@infra.apache.org With regards, Apache Git Services