Updated project structure

This commit is contained in:
Stuart Boston
2012-11-01 14:35:47 +00:00
parent 887a241248
commit e5e6b1d08e
47 changed files with 195 additions and 147 deletions
@@ -7,7 +7,7 @@
* For any reuse or distribution, you must make clear to others the
* license terms of this work.
*/
package com.moviejukebox.themoviedb;
package com.omertron.themoviedbapi;
public class MovieDbException extends Exception {
@@ -7,16 +7,47 @@
* For any reuse or distribution, you must make clear to others the
* license terms of this work.
*/
package com.moviejukebox.themoviedb;
package com.omertron.themoviedbapi;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.moviejukebox.themoviedb.MovieDbException.MovieDbExceptionType;
import com.moviejukebox.themoviedb.model.*;
import com.moviejukebox.themoviedb.tools.ApiUrl;
import static com.moviejukebox.themoviedb.tools.ApiUrl.*;
import com.moviejukebox.themoviedb.tools.FilteringLayout;
import com.moviejukebox.themoviedb.tools.WebBrowser;
import com.moviejukebox.themoviedb.wrapper.*;
import com.omertron.themoviedbapi.MovieDbException.MovieDbExceptionType;
import com.omertron.themoviedbapi.model.AlternativeTitle;
import com.omertron.themoviedbapi.model.Artwork;
import com.omertron.themoviedbapi.model.ArtworkType;
import com.omertron.themoviedbapi.model.CollectionInfo;
import com.omertron.themoviedbapi.model.Company;
import com.omertron.themoviedbapi.model.Genre;
import com.omertron.themoviedbapi.model.Keyword;
import com.omertron.themoviedbapi.model.MovieDb;
import com.omertron.themoviedbapi.model.Person;
import com.omertron.themoviedbapi.model.PersonCast;
import com.omertron.themoviedbapi.model.PersonCredit;
import com.omertron.themoviedbapi.model.PersonCrew;
import com.omertron.themoviedbapi.model.PersonType;
import com.omertron.themoviedbapi.model.ReleaseInfo;
import com.omertron.themoviedbapi.model.TmdbConfiguration;
import com.omertron.themoviedbapi.model.TokenAuthorisation;
import com.omertron.themoviedbapi.model.TokenSession;
import com.omertron.themoviedbapi.model.Trailer;
import com.omertron.themoviedbapi.model.Translation;
import com.omertron.themoviedbapi.tools.ApiUrl;
import static com.omertron.themoviedbapi.tools.ApiUrl.*;
import com.omertron.themoviedbapi.tools.FilteringLayout;
import com.omertron.themoviedbapi.tools.WebBrowser;
import com.omertron.themoviedbapi.wrapper.WrapperAlternativeTitles;
import com.omertron.themoviedbapi.wrapper.WrapperCompany;
import com.omertron.themoviedbapi.wrapper.WrapperCompanyMovies;
import com.omertron.themoviedbapi.wrapper.WrapperConfig;
import com.omertron.themoviedbapi.wrapper.WrapperGenres;
import com.omertron.themoviedbapi.wrapper.WrapperImages;
import com.omertron.themoviedbapi.wrapper.WrapperMovie;
import com.omertron.themoviedbapi.wrapper.WrapperMovieCasts;
import com.omertron.themoviedbapi.wrapper.WrapperMovieKeywords;
import com.omertron.themoviedbapi.wrapper.WrapperPerson;
import com.omertron.themoviedbapi.wrapper.WrapperPersonCredits;
import com.omertron.themoviedbapi.wrapper.WrapperReleaseInfo;
import com.omertron.themoviedbapi.wrapper.WrapperTrailers;
import com.omertron.themoviedbapi.wrapper.WrapperTranslations;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
@@ -32,9 +63,9 @@ import org.apache.log4j.Logger;
*
* @author stuart.boston
*/
public class TheMovieDb {
public class TheMovieDbApi {
private static final Logger LOGGER = Logger.getLogger(TheMovieDb.class);
private static final Logger LOGGER = Logger.getLogger(TheMovieDbApi.class);
private String apiKey;
private TmdbConfiguration tmdbConfig;
/*
@@ -73,7 +104,7 @@ public class TheMovieDb {
* @param apiKey
* @throws MovieDbException
*/
public TheMovieDb(String apiKey) throws MovieDbException {
public TheMovieDbApi(String apiKey) throws MovieDbException {
this.apiKey = apiKey;
ApiUrl apiUrl = new ApiUrl(this, "configuration");
URL configUrl = apiUrl.buildUrl();
@@ -92,11 +123,11 @@ public class TheMovieDb {
* Output the API version information to the debug log
*/
public static void showVersion() {
String apiTitle = TheMovieDb.class.getPackage().getSpecificationTitle();
String apiTitle = TheMovieDbApi.class.getPackage().getSpecificationTitle();
if (StringUtils.isNotBlank(apiTitle)) {
String apiVersion = TheMovieDb.class.getPackage().getSpecificationVersion();
String apiRevision = TheMovieDb.class.getPackage().getImplementationVersion();
String apiVersion = TheMovieDbApi.class.getPackage().getSpecificationVersion();
String apiRevision = TheMovieDbApi.class.getPackage().getImplementationVersion();
StringBuilder sv = new StringBuilder();
sv.append(apiTitle).append(" ");
sv.append(apiVersion).append(" r");
@@ -7,7 +7,7 @@
* For any reuse or distribution, you must make clear to others the
* license terms of this work.
*/
package com.moviejukebox.themoviedb.model;
package com.omertron.themoviedbapi.model;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
@@ -7,7 +7,7 @@
* For any reuse or distribution, you must make clear to others the
* license terms of this work.
*/
package com.moviejukebox.themoviedb.model;
package com.omertron.themoviedbapi.model;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
@@ -7,7 +7,7 @@
* For any reuse or distribution, you must make clear to others the
* license terms of this work.
*/
package com.moviejukebox.themoviedb.model;
package com.omertron.themoviedbapi.model;
/**
* ArtworkType enum List of the artwork types that are available
@@ -7,7 +7,7 @@
* For any reuse or distribution, you must make clear to others the
* license terms of this work.
*/
package com.moviejukebox.themoviedb.model;
package com.omertron.themoviedbapi.model;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
@@ -7,7 +7,7 @@
* For any reuse or distribution, you must make clear to others the
* license terms of this work.
*/
package com.moviejukebox.themoviedb.model;
package com.omertron.themoviedbapi.model;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
@@ -7,7 +7,7 @@
* For any reuse or distribution, you must make clear to others the
* license terms of this work.
*/
package com.moviejukebox.themoviedb.model;
package com.omertron.themoviedbapi.model;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
@@ -7,7 +7,7 @@
* For any reuse or distribution, you must make clear to others the
* license terms of this work.
*/
package com.moviejukebox.themoviedb.model;
package com.omertron.themoviedbapi.model;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
@@ -7,7 +7,7 @@
* For any reuse or distribution, you must make clear to others the
* license terms of this work.
*/
package com.moviejukebox.themoviedb.model;
package com.omertron.themoviedbapi.model;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
@@ -7,7 +7,7 @@
* For any reuse or distribution, you must make clear to others the
* license terms of this work.
*/
package com.moviejukebox.themoviedb.model;
package com.omertron.themoviedbapi.model;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
@@ -7,7 +7,7 @@
* For any reuse or distribution, you must make clear to others the
* license terms of this work.
*/
package com.moviejukebox.themoviedb.model;
package com.omertron.themoviedbapi.model;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
@@ -7,7 +7,7 @@
* For any reuse or distribution, you must make clear to others the
* license terms of this work.
*/
package com.moviejukebox.themoviedb.model;
package com.omertron.themoviedbapi.model;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
@@ -7,7 +7,7 @@
* For any reuse or distribution, you must make clear to others the
* license terms of this work.
*/
package com.moviejukebox.themoviedb.model;
package com.omertron.themoviedbapi.model;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
@@ -7,7 +7,7 @@
* For any reuse or distribution, you must make clear to others the
* license terms of this work.
*/
package com.moviejukebox.themoviedb.model;
package com.omertron.themoviedbapi.model;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
@@ -7,7 +7,7 @@
* For any reuse or distribution, you must make clear to others the
* license terms of this work.
*/
package com.moviejukebox.themoviedb.model;
package com.omertron.themoviedbapi.model;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
@@ -7,7 +7,7 @@
* For any reuse or distribution, you must make clear to others the
* license terms of this work.
*/
package com.moviejukebox.themoviedb.model;
package com.omertron.themoviedbapi.model;
/**
*
@@ -7,7 +7,7 @@
* For any reuse or distribution, you must make clear to others the
* license terms of this work.
*/
package com.moviejukebox.themoviedb.model;
package com.omertron.themoviedbapi.model;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
@@ -7,7 +7,7 @@
* For any reuse or distribution, you must make clear to others the
* license terms of this work.
*/
package com.moviejukebox.themoviedb.model;
package com.omertron.themoviedbapi.model;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
@@ -7,7 +7,7 @@
* For any reuse or distribution, you must make clear to others the
* license terms of this work.
*/
package com.moviejukebox.themoviedb.model;
package com.omertron.themoviedbapi.model;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
@@ -7,7 +7,7 @@
* For any reuse or distribution, you must make clear to others the
* license terms of this work.
*/
package com.moviejukebox.themoviedb.model;
package com.omertron.themoviedbapi.model;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
@@ -7,7 +7,7 @@
* For any reuse or distribution, you must make clear to others the
* license terms of this work.
*/
package com.moviejukebox.themoviedb.model;
package com.omertron.themoviedbapi.model;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
@@ -7,7 +7,7 @@
* For any reuse or distribution, you must make clear to others the
* license terms of this work.
*/
package com.moviejukebox.themoviedb.model;
package com.omertron.themoviedbapi.model;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
@@ -7,7 +7,7 @@
* For any reuse or distribution, you must make clear to others the
* license terms of this work.
*/
package com.moviejukebox.themoviedb.model;
package com.omertron.themoviedbapi.model;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
@@ -7,7 +7,7 @@
* For any reuse or distribution, you must make clear to others the
* license terms of this work.
*/
package com.moviejukebox.themoviedb.model;
package com.omertron.themoviedbapi.model;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import java.io.Serializable;
@@ -7,7 +7,7 @@
* For any reuse or distribution, you must make clear to others the
* license terms of this work.
*/
package com.moviejukebox.themoviedb.model;
package com.omertron.themoviedbapi.model;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
@@ -7,9 +7,9 @@
* For any reuse or distribution, you must make clear to others the
* license terms of this work.
*/
package com.moviejukebox.themoviedb.tools;
package com.omertron.themoviedbapi.tools;
import com.moviejukebox.themoviedb.TheMovieDb;
import com.omertron.themoviedbapi.TheMovieDbApi;
import java.io.UnsupportedEncodingException;
import java.net.MalformedURLException;
import java.net.URL;
@@ -30,7 +30,7 @@ public class ApiUrl {
*/
private static final Logger LOGGER = Logger.getLogger(ApiUrl.class);
/*
* TheMovieDb API Base URL
* TheMovieDbApi API Base URL
*/
private static final String TMDB_API_BASE = "http://api.themoviedb.org/3/";
// private static final String TMDB_API_BASE = "http://private-3aa3-themoviedb.apiary.io/3/";
@@ -43,7 +43,7 @@ public class ApiUrl {
/*
* Properties
*/
private TheMovieDb tmdb;
private TheMovieDbApi tmdb;
private String method;
private String submethod;
private Map<String, String> arguments = new HashMap<String, String>();
@@ -71,7 +71,7 @@ public class ApiUrl {
*
* @param method
*/
public ApiUrl(TheMovieDb tmdb, String method) {
public ApiUrl(TheMovieDbApi tmdb, String method) {
this.tmdb = tmdb;
this.method = method;
this.submethod = DEFAULT_STRING;
@@ -83,7 +83,7 @@ public class ApiUrl {
* @param method
* @param submethod
*/
public ApiUrl(TheMovieDb tmdb, String method, String submethod) {
public ApiUrl(TheMovieDbApi tmdb, String method, String submethod) {
this.tmdb = tmdb;
this.method = method;
this.submethod = submethod;
@@ -7,7 +7,7 @@
* For any reuse or distribution, you must make clear to others the
* license terms of this work.
*/
package com.moviejukebox.themoviedb.tools;
package com.omertron.themoviedbapi.tools;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -7,9 +7,9 @@
* For any reuse or distribution, you must make clear to others the
* license terms of this work.
*/
package com.moviejukebox.themoviedb.tools;
package com.omertron.themoviedbapi.tools;
import com.moviejukebox.themoviedb.MovieDbException;
import com.omertron.themoviedbapi.MovieDbException;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
@@ -7,11 +7,11 @@
* For any reuse or distribution, you must make clear to others the
* license terms of this work.
*/
package com.moviejukebox.themoviedb.wrapper;
package com.omertron.themoviedbapi.wrapper;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.moviejukebox.themoviedb.model.AlternativeTitle;
import com.omertron.themoviedbapi.model.AlternativeTitle;
import java.util.List;
import org.apache.log4j.Logger;
@@ -7,11 +7,11 @@
* For any reuse or distribution, you must make clear to others the
* license terms of this work.
*/
package com.moviejukebox.themoviedb.wrapper;
package com.omertron.themoviedbapi.wrapper;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.moviejukebox.themoviedb.model.Company;
import com.omertron.themoviedbapi.model.Company;
import java.util.List;
import org.apache.log4j.Logger;
@@ -7,11 +7,11 @@
* For any reuse or distribution, you must make clear to others the
* license terms of this work.
*/
package com.moviejukebox.themoviedb.wrapper;
package com.omertron.themoviedbapi.wrapper;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.moviejukebox.themoviedb.model.MovieDb;
import com.omertron.themoviedbapi.model.MovieDb;
import java.util.List;
import org.apache.log4j.Logger;
@@ -7,11 +7,11 @@
* For any reuse or distribution, you must make clear to others the
* license terms of this work.
*/
package com.moviejukebox.themoviedb.wrapper;
package com.omertron.themoviedbapi.wrapper;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.moviejukebox.themoviedb.model.TmdbConfiguration;
import com.omertron.themoviedbapi.model.TmdbConfiguration;
import org.apache.log4j.Logger;
/**
@@ -7,11 +7,11 @@
* For any reuse or distribution, you must make clear to others the
* license terms of this work.
*/
package com.moviejukebox.themoviedb.wrapper;
package com.omertron.themoviedbapi.wrapper;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.moviejukebox.themoviedb.model.Genre;
import com.omertron.themoviedbapi.model.Genre;
import java.util.List;
import org.apache.log4j.Logger;
@@ -7,11 +7,11 @@
* For any reuse or distribution, you must make clear to others the
* license terms of this work.
*/
package com.moviejukebox.themoviedb.wrapper;
package com.omertron.themoviedbapi.wrapper;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.moviejukebox.themoviedb.model.Artwork;
import com.omertron.themoviedbapi.model.Artwork;
import java.util.List;
import org.apache.log4j.Logger;
@@ -7,11 +7,11 @@
* For any reuse or distribution, you must make clear to others the
* license terms of this work.
*/
package com.moviejukebox.themoviedb.wrapper;
package com.omertron.themoviedbapi.wrapper;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.moviejukebox.themoviedb.model.MovieDb;
import com.omertron.themoviedbapi.model.MovieDb;
import java.util.List;
import org.apache.log4j.Logger;
@@ -7,12 +7,12 @@
* For any reuse or distribution, you must make clear to others the
* license terms of this work.
*/
package com.moviejukebox.themoviedb.wrapper;
package com.omertron.themoviedbapi.wrapper;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.moviejukebox.themoviedb.model.PersonCast;
import com.moviejukebox.themoviedb.model.PersonCrew;
import com.omertron.themoviedbapi.model.PersonCast;
import com.omertron.themoviedbapi.model.PersonCrew;
import java.util.List;
import org.apache.log4j.Logger;
@@ -7,11 +7,11 @@
* For any reuse or distribution, you must make clear to others the
* license terms of this work.
*/
package com.moviejukebox.themoviedb.wrapper;
package com.omertron.themoviedbapi.wrapper;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.moviejukebox.themoviedb.model.Keyword;
import com.omertron.themoviedbapi.model.Keyword;
import java.util.List;
import org.apache.log4j.Logger;
@@ -7,11 +7,11 @@
* For any reuse or distribution, you must make clear to others the
* license terms of this work.
*/
package com.moviejukebox.themoviedb.wrapper;
package com.omertron.themoviedbapi.wrapper;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.moviejukebox.themoviedb.model.Person;
import com.omertron.themoviedbapi.model.Person;
import java.util.List;
import org.apache.log4j.Logger;
@@ -7,11 +7,11 @@
* For any reuse or distribution, you must make clear to others the
* license terms of this work.
*/
package com.moviejukebox.themoviedb.wrapper;
package com.omertron.themoviedbapi.wrapper;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.moviejukebox.themoviedb.model.PersonCredit;
import com.omertron.themoviedbapi.model.PersonCredit;
import java.util.List;
import org.apache.log4j.Logger;
@@ -7,11 +7,11 @@
* For any reuse or distribution, you must make clear to others the
* license terms of this work.
*/
package com.moviejukebox.themoviedb.wrapper;
package com.omertron.themoviedbapi.wrapper;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.moviejukebox.themoviedb.model.ReleaseInfo;
import com.omertron.themoviedbapi.model.ReleaseInfo;
import java.util.List;
import org.apache.log4j.Logger;
@@ -7,11 +7,11 @@
* For any reuse or distribution, you must make clear to others the
* license terms of this work.
*/
package com.moviejukebox.themoviedb.wrapper;
package com.omertron.themoviedbapi.wrapper;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.moviejukebox.themoviedb.model.Trailer;
import com.omertron.themoviedbapi.model.Trailer;
import java.util.List;
import org.apache.log4j.Logger;
@@ -7,10 +7,10 @@
* For any reuse or distribution, you must make clear to others the
* license terms of this work.
*/
package com.moviejukebox.themoviedb.wrapper;
package com.omertron.themoviedbapi.wrapper;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.moviejukebox.themoviedb.model.Translation;
import com.omertron.themoviedbapi.model.Translation;
import java.util.List;
import org.apache.log4j.Logger;