Package com.github.hakko.musiccabinet.exception

Examples of com.github.hakko.musiccabinet.exception.ApplicationException


      LOG.debug("post responseBody: " + responseBody);
      wsResponse = (statusCode == 200) ?
          new WSResponse(responseBody) :
          new WSResponse(isHttpRecoverable(statusCode), statusCode, responseBody);
    } catch (ClientProtocolException e) {
      throw new ApplicationException(
          "The request to post data to Last.fm could not be completed!", e);
    } catch (IOException e) {
      LOG.warn("Could not post data to Last.fm!", e);
      wsResponse = new WSResponse(true, -1, "Call failed due to " + e.getMessage());
    }
View Full Code Here


      uriBuilder.setScheme(HTTP);
      uriBuilder.setHost(HOST);
      uriBuilder.setPath(PATH);
      uri = uriBuilder.build();
    } catch (URISyntaxException e) {
      throw new ApplicationException("Could not create Last.fm URI!", e);
    }
    return uri;
  }
View Full Code Here

    xmlEventReader = getXMLEventReader(source);
    this.callback = callback;
    try {
      loadItunesLibraryIndex();
    } catch (XMLStreamException e) {
      throw new ApplicationException("Could not parse input stream!", e);
    }
  }
View Full Code Here

  public InputStream getInputStream() throws ApplicationException {
    InputStream is;
    try {
      is = new ByteArrayInputStream(str.getBytes(UTF8));
    } catch (UnsupportedEncodingException e) {
      throw new ApplicationException("UTF-8 encoding not supported!", e);
    }
    return is;
  }
View Full Code Here

        AudioFile audioFile = AudioFileIO.read(file);
        tag = audioFile.getTag();
      } catch (CannotReadException | IOException | TagException
          | ReadOnlyFileException | InvalidAudioFrameException
          | RuntimeException e) {
        throw new ApplicationException("Failed reading artwork from file " + file, e);
      }
        return tag == null ? null : tag.getFirstArtwork();
    }
View Full Code Here

      }
      libraryPresenceChannel.send(FINISHED_MESSAGE);
      workerThreads.await();
      updateLibrary();
    } catch (IOException | InterruptedException e) {
      throw new ApplicationException("Scanning aborted due to error!", e);
    }
    isLibraryBeingScanned = false;
  }
View Full Code Here

      AuthSessionParser authSessionParser =
          new AuthSessionParserImpl(stringUtil.getInputStream());
      return authSessionParser.getLastFmUser();
    } else {
      LOG.debug("wsResponse: " + wsResponse.getResponseBody());
      throw new ApplicationException("Could not get session key for user! (code "
          + wsResponse.getErrorCode() + ", " + wsResponse.getErrorMessage() + ")");
    }
  }
View Full Code Here

        + " encoding='UTF8'"
        + " connection limit=-1;";
    try {
      initialJdbcTemplate.execute(createSql);
    } catch (DataAccessException e) {
      throw new ApplicationException("Could not create database!", e);
    }
  }
View Full Code Here

    initialDataSource.setPassword(password);
    try {
      dataSource.softResetDefaultUser();
      initialDataSource.softResetDefaultUser();
    } catch (SQLException e) {
      throw new ApplicationException("Password update failed!", e);
    }
    try {
      initialJdbcTemplate.execute("select 1");
    } catch (DataAccessException e) {
      throw new ApplicationException("Password update failed!", e);
    }
  }
View Full Code Here

TOP

Related Classes of com.github.hakko.musiccabinet.exception.ApplicationException

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.