summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephan Schwär2020-11-06 12:25:10 +0100
committerStephan Schwär2020-11-06 12:25:10 +0100
commit0b9a7ebbc474256be1f308a22b226eff82061a60 (patch)
tree53355aebcfb069d91532a813f172362a3ca9911a
parentRemove unused libraries (diff)
downloadmaster-sync-shared-0b9a7ebbc474256be1f308a22b226eff82061a60.tar.gz
master-sync-shared-0b9a7ebbc474256be1f308a22b226eff82061a60.tar.xz
master-sync-shared-0b9a7ebbc474256be1f308a22b226eff82061a60.zip
Use master sync shared code formatting style
-rw-r--r--src/main/java/org/openslx/util/vm/OvfConfig.java32
-rw-r--r--src/main/java/org/openslx/util/vm/OvfMetaData.java95
2 files changed, 80 insertions, 47 deletions
diff --git a/src/main/java/org/openslx/util/vm/OvfConfig.java b/src/main/java/org/openslx/util/vm/OvfConfig.java
index 9e17c0c..4bb597c 100644
--- a/src/main/java/org/openslx/util/vm/OvfConfig.java
+++ b/src/main/java/org/openslx/util/vm/OvfConfig.java
@@ -18,8 +18,9 @@ import org.w3c.dom.Document;
* 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);
+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();
@@ -28,12 +29,13 @@ public class OvfConfig {
// 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)
+ 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!");
+ "Could not create DOM from given ovf machine configuration file!" );
init();
}
@@ -43,9 +45,10 @@ public class OvfConfig {
*
* @throws UnsupportedVirtualizerFormatException
*/
- private void init() throws UnsupportedVirtualizerFormatException {
- if (Util.isEmptyString(getDisplayName())) {
- throw new UnsupportedVirtualizerFormatException("Machine doesn't have a name");
+ private void init() throws UnsupportedVirtualizerFormatException
+ {
+ if ( Util.isEmptyString( getDisplayName() ) ) {
+ throw new UnsupportedVirtualizerFormatException( "Machine doesn't have a name" );
}
}
@@ -54,12 +57,13 @@ public class OvfConfig {
*
* @return the display name of this VM
*/
- public String getDisplayName() {
+ public String getDisplayName()
+ {
try {
- return XmlHelper.XPath.compile("/Envelope/VirtualSystem/Name").evaluate(this.doc);
- } catch (XPathExpressionException e) {
+ return XmlHelper.XPath.compile( "/Envelope/VirtualSystem/Name" ).evaluate( this.doc );
+ } catch ( XPathExpressionException e ) {
return "";
}
}
-} \ No newline at end of file
+}
diff --git a/src/main/java/org/openslx/util/vm/OvfMetaData.java b/src/main/java/org/openslx/util/vm/OvfMetaData.java
index a94a7bf..3c69c67 100644
--- a/src/main/java/org/openslx/util/vm/OvfMetaData.java
+++ b/src/main/java/org/openslx/util/vm/OvfMetaData.java
@@ -12,176 +12,205 @@ 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 {
+public class OvfMetaData extends VmMetaData
+{
- private static final Logger LOGGER = Logger.getLogger(OvfMetaData.class);
+ 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);
+ public OvfMetaData( List<OperatingSystem> osList, File file )
+ throws IOException, UnsupportedVirtualizerFormatException
+ {
+ super( osList );
+ this.config = new OvfConfig( file );
init();
}
- private void init() {
+ private void init()
+ {
registerVirtualHW();
displayName = config.getDisplayName();
}
@Override
- public byte[] getFilteredDefinitionArray() {
+ public byte[] getFilteredDefinitionArray()
+ {
// TODO Auto-generated method stub
return null;
}
@Override
- public void applySettingsForLocalEdit() {
+ public void applySettingsForLocalEdit()
+ {
// TODO Auto-generated method stub
}
@Override
- public boolean addHddTemplate(File diskImage, String hddMode, String redoDir) {
+ 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) {
+ public boolean addHddTemplate( String diskImagePath, String hddMode, String redoDir )
+ {
// TODO Auto-generated method stub
return false;
}
@Override
- public boolean addDefaultNat() {
+ public boolean addDefaultNat()
+ {
// TODO Auto-generated method stub
return false;
}
@Override
- public void setOs(String vendorOsId) {
+ public void setOs( String vendorOsId )
+ {
// TODO Auto-generated method stub
}
@Override
- public boolean addDisplayName(String name) {
+ public boolean addDisplayName( String name )
+ {
// TODO Auto-generated method stub
return false;
}
@Override
- public boolean addRam(int mem) {
+ public boolean addRam( int mem )
+ {
// TODO Auto-generated method stub
return false;
}
@Override
- public void addFloppy(int index, String image, boolean readOnly) {
+ public void addFloppy( int index, String image, boolean readOnly )
+ {
// TODO Auto-generated method stub
}
@Override
- public boolean addCdrom(String image) {
+ public boolean addCdrom( String image )
+ {
// TODO Auto-generated method stub
return false;
}
@Override
- public boolean addCpuCoreCount(int nrOfCores) {
+ public boolean addCpuCoreCount( int nrOfCores )
+ {
// TODO Auto-generated method stub
return false;
}
@Override
- public void setSoundCard(SoundCardType type) {
+ public void setSoundCard( SoundCardType type )
+ {
// TODO Auto-generated method stub
}
@Override
- public SoundCardType getSoundCard() {
+ public SoundCardType getSoundCard()
+ {
// TODO Auto-generated method stub
return null;
}
@Override
- public void setDDAcceleration(DDAcceleration type) {
+ public void setDDAcceleration( DDAcceleration type )
+ {
// TODO Auto-generated method stub
}
@Override
- public DDAcceleration getDDAcceleration() {
+ public DDAcceleration getDDAcceleration()
+ {
// TODO Auto-generated method stub
return null;
}
@Override
- public void setHWVersion(HWVersion type) {
+ public void setHWVersion( HWVersion type )
+ {
// TODO Auto-generated method stub
}
@Override
- public HWVersion getHWVersion() {
+ public HWVersion getHWVersion()
+ {
// TODO Auto-generated method stub
return null;
}
@Override
- public void setEthernetDevType(int cardIndex, EthernetDevType type) {
+ public void setEthernetDevType( int cardIndex, EthernetDevType type )
+ {
// TODO Auto-generated method stub
}
@Override
- public EthernetDevType getEthernetDevType(int cardIndex) {
+ public EthernetDevType getEthernetDevType( int cardIndex )
+ {
// TODO Auto-generated method stub
return null;
}
@Override
- public void setMaxUsbSpeed(UsbSpeed speed) {
+ public void setMaxUsbSpeed( UsbSpeed speed )
+ {
// TODO Auto-generated method stub
}
@Override
- public UsbSpeed getMaxUsbSpeed() {
+ public UsbSpeed getMaxUsbSpeed()
+ {
// TODO Auto-generated method stub
return null;
}
@Override
- public byte[] getDefinitionArray() {
+ public byte[] getDefinitionArray()
+ {
// TODO Auto-generated method stub
return null;
}
@Override
- public boolean addEthernet(EtherType type) {
+ public boolean addEthernet( EtherType type )
+ {
// TODO Auto-generated method stub
return false;
}
@Override
- public Virtualizer getVirtualizer() {
+ public Virtualizer getVirtualizer()
+ {
// TODO Auto-generated method stub
return null;
}
@Override
- public boolean tweakForNonPersistent() {
+ public boolean tweakForNonPersistent()
+ {
// TODO Auto-generated method stub
return false;
}
@Override
- public void registerVirtualHW() {
+ public void registerVirtualHW()
+ {
// TODO Auto-generated method stub
}