Package se.despotify.client.protocol

Examples of se.despotify.client.protocol.ResponseUnmarshaller


//    System.out.println(new String(GZIP.inflate(data), UTF8));

    try {
      XMLStreamReader xmlr = ResponseUnmarshaller.createReader(new InputStreamReader(new GZIPInputStream(new ByteArrayInputStream(data)), Charset.forName("UTF-8")));
      ResponseUnmarshaller responseUnmarshaller = new ResponseUnmarshaller(store, xmlr);
      responseUnmarshaller.skip();
      if (!"result".equals(xmlr.getLocalName())) {
        throw new DespotifyException("Expected document root to be of type <result>");
      }

      Result result = responseUnmarshaller.unmarshallSearchResult();
      xmlr.close();
      return result;

    } catch (XMLStreamException e) {
      throw new DespotifyException(e);
View Full Code Here


//      timeUnmarshall.start();

      Reader reader = new InputStreamReader(new GZIPInputStream(new ByteArrayInputStream(compressedData)), UTF8);
      XMLStreamReader xmlr = ResponseUnmarshaller.createReader(reader);
      ResponseUnmarshaller unmarshaller = new ResponseUnmarshaller(store, xmlr);
      unmarshaller.skip();
      List<Track> tracks = unmarshaller.unmarshallLoadTracks();
      xmlr.close();
      for (Track track : tracks) {
        store.persist(track);
      }
     
View Full Code Here

//      timeUnmarshall.start();

      try {
        XMLStreamReader xmlr = ResponseUnmarshaller.createReader(new InputStreamReader(new GZIPInputStream(new ByteArrayInputStream(data)), Charset.forName("UTF-8")));
        ResponseUnmarshaller responseUnmarshaller = new ResponseUnmarshaller(store, xmlr);
        responseUnmarshaller.skip();
        if (!"artist".equals(xmlr.getLocalName())) {
          throw new DespotifyException("Expected document root to be of type <artist>");
        }

        artist = responseUnmarshaller.unmarshallArtist(new Date());
        if (!this.artist.equals(artist)) {
          throw new DespotifyException("Artist in response has different UUID than the requested artist!");
        }
        xmlr.close();
      } catch (XMLStreamException e) {
View Full Code Here

//      e.printStackTrace();
//    }

    try {
      XMLStreamReader xmlr = ResponseUnmarshaller.createReader(new InputStreamReader(new ByteArrayInputStream(data), Charset.forName("UTF-8")));
      ResponseUnmarshaller responseUnmarshaller = new ResponseUnmarshaller(store, xmlr);
      responseUnmarshaller.skip();
      if (!"album".equals(xmlr.getLocalName())) {
        throw new DespotifyException("Expected document root to be of type <album>");
      }
      album = responseUnmarshaller.unmarshallAlbum(new Date());
      xmlr.close();
    } catch (XMLStreamException e) {
      throw new DespotifyException(e);
    }
View Full Code Here

//      }


      try {
        XMLStreamReader xmlr = ResponseUnmarshaller.createReader(new InputStreamReader(new ByteArrayInputStream(data), Charset.forName("UTF-8")));
        ResponseUnmarshaller responseUnmarshaller = new ResponseUnmarshaller(store, xmlr);
        responseUnmarshaller.skip();
        if (!"artist".equals(xmlr.getLocalName())) {
          throw new DespotifyException("Expected document root to be of type <artist>");
        }
        Artist artist = responseUnmarshaller.unmarshallArtist(new Date());
        if (!this.artist.equals(artist)) {
          throw new DespotifyException("Artist in response has different UUID than the requested artist!");
        }
      } catch (XMLStreamException e) {
        throw new DespotifyException(e);
View Full Code Here

//      e.printStackTrace();
//    }

    try {
      XMLStreamReader xmlr = ResponseUnmarshaller.createReader(new InputStreamReader(new ByteArrayInputStream(data), Charset.forName("UTF-8")));
      ResponseUnmarshaller responseUnmarshaller = new ResponseUnmarshaller(store, xmlr);
      responseUnmarshaller.skip();
      if (!"album".equals(xmlr.getLocalName())) {
        throw new DespotifyException("Expected document root to be of type <album>");
      }
      album = responseUnmarshaller.unmarshallAlbum(new Date());
    } catch (XMLStreamException e) {
      throw new DespotifyException(e);
    }

    if (!this.album.equals(album)) {
View Full Code Here

TOP

Related Classes of se.despotify.client.protocol.ResponseUnmarshaller

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.