X-Git-Url: https://git.hedgecode.org/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fhedgecode%2Fxml%2Fxspf%2FXMLBindPlaylist.java;h=d554207b3cdfeb7b83fc1c66d13a9b92c1a6a50c;hb=HEAD;hp=161e4f51960637324ad14c1601f665af1d48673b;hpb=6310cd885e1db660feb7dc222c2e86cccb5c1fce;p=hespiff.git diff --git a/src/main/java/org/hedgecode/xml/xspf/XMLBindPlaylist.java b/src/main/java/org/hedgecode/xml/xspf/XMLBindPlaylist.java index 161e4f5..d554207 100644 --- a/src/main/java/org/hedgecode/xml/xspf/XMLBindPlaylist.java +++ b/src/main/java/org/hedgecode/xml/xspf/XMLBindPlaylist.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015. Developed by Hedgecode. + * Copyright (c) 2015-2019. Developed by Hedgecode. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -166,9 +166,7 @@ public class XMLBindPlaylist extends AbstractXMLBindElement implements Playlist public String getAsString() throws JAXBException, UnsupportedEncodingException { - Charset charset = (Charset) Properties.getProperty( - Properties.CHARSET, Charset.class - ); + Charset charset = XSPFProperties.getCharset(); ByteArrayOutputStream os = (ByteArrayOutputStream) getAsStream(); return os.toString( charset.name() @@ -178,17 +176,16 @@ public class XMLBindPlaylist extends AbstractXMLBindElement implements Playlist private Marshaller createMarshaller(Class xmlRootClass) throws JAXBException { JAXBContext jaxbContext = JAXBContext.newInstance(xmlRootClass); Marshaller marshaller = jaxbContext.createMarshaller(); - Charset charset = (Charset) Properties.getProperty(Properties.CHARSET, Charset.class); + Charset charset = XSPFProperties.getCharset(); marshaller.setProperty( Marshaller.JAXB_ENCODING, charset.name() ); marshaller.setProperty( Marshaller.JAXB_FORMATTED_OUTPUT, - Properties.getProperty(Properties.FORMATTED, Boolean.class) + XSPFProperties.getBoolean(XSPFProperties.FORMATTED) ); - Object standalone = Properties.getProperty(Properties.STANDALONE, Boolean.class); - if (Boolean.FALSE.equals(standalone)) { + if (Boolean.FALSE.equals(XSPFProperties.getBoolean(XSPFProperties.STANDALONE))) { marshaller.setProperty(Marshaller.JAXB_FRAGMENT, Boolean.TRUE); marshaller.setProperty( XSPFConstants.XML_HEADER_NAME,