summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephan Schwär2020-11-20 00:19:55 +0100
committerStephan Schwär2020-11-20 00:19:55 +0100
commit33cfa639ff65f65798fef56d32716a630087cdff (patch)
tree35f7538aea55dadc8dda4ec0abfd67d1b8be4d9c
parentMerge remote-tracking branch 'origin/feature/search-in-description' into ovf-... (diff)
downloadmaster-sync-shared-master.tar.gz
master-sync-shared-master.tar.xz
master-sync-shared-master.zip
Remove unused code and classesHEADovf-convertmaster
-rw-r--r--src/main/java/org/openslx/util/vm/OvfConfig.java69
-rw-r--r--src/main/java/org/openslx/util/vm/OvfMetaData.java218
-rw-r--r--src/main/java/org/openslx/util/vm/VmMetaData.java5
3 files changed, 0 insertions, 292 deletions
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<HardDisk> hddsArray = new ArrayList<HardDisk>();
-
- // 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 "";
- }
- }
-
-}
diff --git a/src/main/java/org/openslx/util/vm/OvfMetaData.java b/src/main/java/org/openslx/util/vm/OvfMetaData.java
deleted file mode 100644
index 3c69c67..0000000
--- a/src/main/java/org/openslx/util/vm/OvfMetaData.java
+++ /dev/null
@@ -1,218 +0,0 @@
-package org.openslx.util.vm;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.List;
-
-import org.apache.log4j.Logger;
-import org.openslx.bwlp.thrift.iface.OperatingSystem;
-import org.openslx.bwlp.thrift.iface.Virtualizer;
-
-/**
- * Class handling the metadata of ovf images. Only needed until the ovf has been
- * converted into a vmx.
- */
-public class OvfMetaData extends VmMetaData
-{
-
- private static final Logger LOGGER = Logger.getLogger( OvfMetaData.class );
-
- private final OvfConfig config;
-
- public OvfMetaData( List<OperatingSystem> osList, File file )
- throws IOException, UnsupportedVirtualizerFormatException
- {
- super( osList );
- this.config = new OvfConfig( file );
- init();
- }
-
- private void init()
- {
- registerVirtualHW();
- displayName = config.getDisplayName();
- }
-
- @Override
- public byte[] getFilteredDefinitionArray()
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public void applySettingsForLocalEdit()
- {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public boolean addHddTemplate( File diskImage, String hddMode, String redoDir )
- {
- // TODO Auto-generated method stub
- return false;
- }
-
- @Override
- public boolean addHddTemplate( String diskImagePath, String hddMode, String redoDir )
- {
- // TODO Auto-generated method stub
- return false;
- }
-
- @Override
- public boolean addDefaultNat()
- {
- // TODO Auto-generated method stub
- return false;
- }
-
- @Override
- public void setOs( String vendorOsId )
- {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public boolean addDisplayName( String name )
- {
- // TODO Auto-generated method stub
- return false;
- }
-
- @Override
- public boolean addRam( int mem )
- {
- // TODO Auto-generated method stub
- return false;
- }
-
- @Override
- public void addFloppy( int index, String image, boolean readOnly )
- {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public boolean addCdrom( String image )
- {
- // TODO Auto-generated method stub
- return false;
- }
-
- @Override
- public boolean addCpuCoreCount( int nrOfCores )
- {
- // TODO Auto-generated method stub
- return false;
- }
-
- @Override
- public void setSoundCard( SoundCardType type )
- {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public SoundCardType getSoundCard()
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public void setDDAcceleration( DDAcceleration type )
- {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public DDAcceleration getDDAcceleration()
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public void setHWVersion( HWVersion type )
- {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public HWVersion getHWVersion()
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public void setEthernetDevType( int cardIndex, EthernetDevType type )
- {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public EthernetDevType getEthernetDevType( int cardIndex )
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public void setMaxUsbSpeed( UsbSpeed speed )
- {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public UsbSpeed getMaxUsbSpeed()
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public byte[] getDefinitionArray()
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public boolean addEthernet( EtherType type )
- {
- // TODO Auto-generated method stub
- return false;
- }
-
- @Override
- public Virtualizer getVirtualizer()
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public boolean tweakForNonPersistent()
- {
- // TODO Auto-generated method stub
- return false;
- }
-
- @Override
- public void registerVirtualHW()
- {
- // TODO Auto-generated method stub
-
- }
-
-}
diff --git a/src/main/java/org/openslx/util/vm/VmMetaData.java b/src/main/java/org/openslx/util/vm/VmMetaData.java
index 1b9aff9..c836697 100644
--- a/src/main/java/org/openslx/util/vm/VmMetaData.java
+++ b/src/main/java/org/openslx/util/vm/VmMetaData.java
@@ -313,11 +313,6 @@ public abstract class VmMetaData<T, U, V, W, X>
LOGGER.info( "Not a QEmu file", e );
}
try {
- return new OvfMetaData( osList, file );
- } catch ( Exception e ) {
- LOGGER.info( "Not an OVF file", e );
- }
- try {
// TODO This will work for each file because simple read as byte array
// TODO No checks if file is a dockerfile --- THIS SHOOULD NOT BE IN PRODUCTION
return new DockerMetaDataDummy(osList, file);