diff options
author | Victor Mocanu | 2018-03-28 12:28:12 +0200 |
---|---|---|
committer | Victor Mocanu | 2018-03-28 12:28:12 +0200 |
commit | c79bc135bde56ca184e2552bb9d68578e4796ce3 (patch) | |
tree | 30d31add480ca9812d384772e46012be9fd62c1a /src/main/java/org/openslx/util/vm/VboxMetaData.java | |
parent | [vbox] ensure <hardware/> has a uuid (diff) | |
download | master-sync-shared-c79bc135bde56ca184e2552bb9d68578e4796ce3.tar.gz master-sync-shared-c79bc135bde56ca184e2552bb9d68578e4796ce3.tar.xz master-sync-shared-c79bc135bde56ca184e2552bb9d68578e4796ce3.zip |
[VBox] added new, more elegant way to add placeholders
Diffstat (limited to 'src/main/java/org/openslx/util/vm/VboxMetaData.java')
-rw-r--r-- | src/main/java/org/openslx/util/vm/VboxMetaData.java | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/main/java/org/openslx/util/vm/VboxMetaData.java b/src/main/java/org/openslx/util/vm/VboxMetaData.java index 01a4970..3aa7491 100644 --- a/src/main/java/org/openslx/util/vm/VboxMetaData.java +++ b/src/main/java/org/openslx/util/vm/VboxMetaData.java @@ -227,7 +227,7 @@ public class VboxMetaData extends VmMetaData<VBoxSoundCardMeta, VBoxDDAccelMeta, public void addFloppy( int index, String image, boolean readOnly ) { - Node somenode = config.findANode( "StorageController", "name", "Floppy" ); + Node somenode = config.findNode( "StorageController", "name", "Floppy" ); if ( somenode == null ) { Element controller = (Element)config.addNewNode( "StorageControllers", "StorageController", false ); controller.setAttribute( "name", "Floppy" ); @@ -246,11 +246,11 @@ public class VboxMetaData extends VmMetaData<VBoxSoundCardMeta, VBoxDDAccelMeta, attachedDev = (Element)config.addNewNode( "StorageController", "AttachedDevice", false, "name", "Floppy" ); Element imageTag = (Element)config.addNewNode( "AttachedDevice", "Image", true, "type", "Floppy" ); - imageTag.setAttribute( "uuid", "#OpenSLX_FloppyUUID_place_holder" ); + imageTag.setAttribute( "uuid", VboxConfig.PlaceHolder.FLOPPYUUID.holderName() ); config.addNewNode( "MediaRegistry", "FloppyImages", false ); Element floppyImageTag = (Element)config.addNewNode( "FloppyImages", "Image", true ); - floppyImageTag.setAttribute( "uuid", "#OpenSLX_FloppyUUID_place_holder" ); - floppyImageTag.setAttribute( "location", "#OpenSLX_FloppyImageLocation_place_holder" ); + floppyImageTag.setAttribute( "uuid", VboxConfig.PlaceHolder.FLOPPYUUID.holderName() ); + floppyImageTag.setAttribute( "location", VboxConfig.PlaceHolder.FLOPPYLOCATION.holderName() ); } attachedDev.setAttribute( "type", "Floppy" ); @@ -286,7 +286,7 @@ public class VboxMetaData extends VmMetaData<VBoxSoundCardMeta, VBoxDDAccelMeta, { // initialize here to type None to avoid all null pointer exceptions thrown for unknown user written sound cards VmMetaData.SoundCardType returnsct = VmMetaData.SoundCardType.NONE; - Element x = (Element)config.findANode( "AudioAdapter" ).item( 0 ); + Element x = (Element)config.findNodes( "AudioAdapter" ).item( 0 ); if ( !x.hasAttribute( "enabled" ) || ( x.hasAttribute( "enabled" ) && x.getAttribute( "enabled" ).equals( "false" ) ) ) { return returnsct; } else { @@ -320,7 +320,7 @@ public class VboxMetaData extends VmMetaData<VBoxSoundCardMeta, VBoxDDAccelMeta, public VmMetaData.DDAcceleration getDDAcceleration() { VmMetaData.DDAcceleration returndda = null; - Element x = (Element)config.findANode( "Display" ).item( 0 ); + Element x = (Element)config.findNodes( "Display" ).item( 0 ); if ( x.hasAttribute( "accelerate3D" ) ) { if ( x.getAttribute( "accelerate3D" ).equals( "true" ) ) { returndda = VmMetaData.DDAcceleration.ON; @@ -365,7 +365,7 @@ public class VboxMetaData extends VmMetaData<VBoxSoundCardMeta, VBoxDDAccelMeta, public VmMetaData.EthernetDevType getEthernetDevType( int cardIndex ) { VmMetaData.EthernetDevType returnedt = VmMetaData.EthernetDevType.NONE; - Element x = (Element)config.findANode( "Adapter" ).item( 0 ); + Element x = (Element)config.findNodes( "Adapter" ).item( 0 ); if ( !x.hasAttribute( "enabled" ) || ( x.hasAttribute( "enabled" ) && x.getAttribute( "enabled" ).equals( "false" ) ) ) { return returnedt; } else { |