From 33cfa639ff65f65798fef56d32716a630087cdff Mon Sep 17 00:00:00 2001 From: Stephan Schwär Date: Fri, 20 Nov 2020 08:19:55 +0900 Subject: Remove unused code and classes --- src/main/java/org/openslx/util/vm/OvfConfig.java | 69 ------------------------ 1 file changed, 69 deletions(-) delete mode 100644 src/main/java/org/openslx/util/vm/OvfConfig.java (limited to 'src/main/java/org/openslx/util/vm/OvfConfig.java') diff --git a/src/main/java/org/openslx/util/vm/OvfConfig.java b/src/main/java/org/openslx/util/vm/OvfConfig.java deleted file mode 100644 index 4bb597c..0000000 --- a/src/main/java/org/openslx/util/vm/OvfConfig.java +++ /dev/null @@ -1,69 +0,0 @@ -package org.openslx.util.vm; - -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.util.ArrayList; - -import javax.xml.xpath.XPathExpressionException; - -import org.apache.log4j.Logger; -import org.openslx.util.Util; -import org.openslx.util.XmlHelper; -import org.openslx.util.vm.VmMetaData.HardDisk; -import org.w3c.dom.Document; - -/** - * Class handling the parsing of a .ovf machine description file For now only a - * dummy for conversion and will be replaced in the image upload flow after - * converting the ovf to vmx. - */ -public class OvfConfig -{ - private static final Logger LOGGER = Logger.getLogger( OvfConfig.class ); - - // key information set during initial parsing of the XML file - private String osName = new String(); - private ArrayList hddsArray = new ArrayList(); - - // XPath and DOM parsing related members - private Document doc = null; - - public OvfConfig( File file ) throws IOException, UnsupportedVirtualizerFormatException - { - doc = XmlHelper.parseDocumentFromStream( new FileInputStream( file ) ); - doc = XmlHelper.removeFormattingNodes( doc ); - if ( doc == null ) - throw new UnsupportedVirtualizerFormatException( - "Could not create DOM from given ovf machine configuration file!" ); - init(); - } - - /** - * Main initialization functions parsing the document created during the - * constructor. - * - * @throws UnsupportedVirtualizerFormatException - */ - private void init() throws UnsupportedVirtualizerFormatException - { - if ( Util.isEmptyString( getDisplayName() ) ) { - throw new UnsupportedVirtualizerFormatException( "Machine doesn't have a name" ); - } - } - - /** - * Getter for the display name - * - * @return the display name of this VM - */ - public String getDisplayName() - { - try { - return XmlHelper.XPath.compile( "/Envelope/VirtualSystem/Name" ).evaluate( this.doc ); - } catch ( XPathExpressionException e ) { - return ""; - } - } - -} -- cgit v1.2.3-55-g7522