summaryrefslogtreecommitdiffstats
path: root/src/main/java/org/openslx/util/vm/OvfConfig.java
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 /src/main/java/org/openslx/util/vm/OvfConfig.java
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
Diffstat (limited to 'src/main/java/org/openslx/util/vm/OvfConfig.java')
-rw-r--r--src/main/java/org/openslx/util/vm/OvfConfig.java32
1 files changed, 18 insertions, 14 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
+}