repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
partition
stringclasses
1 value
Omertron/api-themoviedb
src/main/java/com/omertron/themoviedbapi/methods/TmdbSeasons.java
TmdbSeasons.getSeasonCredits
public MediaCreditList getSeasonCredits(int tvID, int seasonNumber) throws MovieDbException { TmdbParameters parameters = new TmdbParameters(); parameters.add(Param.ID, tvID); parameters.add(Param.SEASON_NUMBER, seasonNumber); URL url = new ApiUrl(apiKey, MethodBase.SEASON).subMethod(Me...
java
public MediaCreditList getSeasonCredits(int tvID, int seasonNumber) throws MovieDbException { TmdbParameters parameters = new TmdbParameters(); parameters.add(Param.ID, tvID); parameters.add(Param.SEASON_NUMBER, seasonNumber); URL url = new ApiUrl(apiKey, MethodBase.SEASON).subMethod(Me...
[ "public", "MediaCreditList", "getSeasonCredits", "(", "int", "tvID", ",", "int", "seasonNumber", ")", "throws", "MovieDbException", "{", "TmdbParameters", "parameters", "=", "new", "TmdbParameters", "(", ")", ";", "parameters", ".", "add", "(", "Param", ".", "ID...
Get the cast & crew credits for a TV season by season number. @param tvID @param seasonNumber @return @throws MovieDbException
[ "Get", "the", "cast", "&", "crew", "credits", "for", "a", "TV", "season", "by", "season", "number", "." ]
bf132d7c7271734e13b58ba3bc92bba46f220118
https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/methods/TmdbSeasons.java#L134-L146
train
Omertron/api-themoviedb
src/main/java/com/omertron/themoviedbapi/tools/ApiUrl.java
ApiUrl.buildUrl
public URL buildUrl(final TmdbParameters params) { StringBuilder urlString = new StringBuilder(TMDB_API_BASE); LOG.trace("Method: '{}', Sub-method: '{}', Params: {}", method.getValue(), submethod.getValue(), ToStringBuilder.reflectionToString(params, ToStringStyle.SHORT_PREFIX_STYLE)); ...
java
public URL buildUrl(final TmdbParameters params) { StringBuilder urlString = new StringBuilder(TMDB_API_BASE); LOG.trace("Method: '{}', Sub-method: '{}', Params: {}", method.getValue(), submethod.getValue(), ToStringBuilder.reflectionToString(params, ToStringStyle.SHORT_PREFIX_STYLE)); ...
[ "public", "URL", "buildUrl", "(", "final", "TmdbParameters", "params", ")", "{", "StringBuilder", "urlString", "=", "new", "StringBuilder", "(", "TMDB_API_BASE", ")", ";", "LOG", ".", "trace", "(", "\"Method: '{}', Sub-method: '{}', Params: {}\"", ",", "method", "."...
Build the URL from the pre-created parameters. @param params The parameters for the method @return Builder object
[ "Build", "the", "URL", "from", "the", "pre", "-", "created", "parameters", "." ]
bf132d7c7271734e13b58ba3bc92bba46f220118
https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/tools/ApiUrl.java#L99-L128
train
Omertron/api-themoviedb
src/main/java/com/omertron/themoviedbapi/tools/ApiUrl.java
ApiUrl.queryProcessing
private StringBuilder queryProcessing(TmdbParameters params) { StringBuilder urlString = new StringBuilder(); // Append the suffix of the API URL if (submethod != MethodSub.NONE) { urlString.append("/").append(submethod.getValue()); } // Append the key information ...
java
private StringBuilder queryProcessing(TmdbParameters params) { StringBuilder urlString = new StringBuilder(); // Append the suffix of the API URL if (submethod != MethodSub.NONE) { urlString.append("/").append(submethod.getValue()); } // Append the key information ...
[ "private", "StringBuilder", "queryProcessing", "(", "TmdbParameters", "params", ")", "{", "StringBuilder", "urlString", "=", "new", "StringBuilder", "(", ")", ";", "// Append the suffix of the API URL", "if", "(", "submethod", "!=", "MethodSub", ".", "NONE", ")", "{...
Create the query based URL portion @param params The parameters for the method @return Builder object
[ "Create", "the", "query", "based", "URL", "portion" ]
bf132d7c7271734e13b58ba3bc92bba46f220118
https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/tools/ApiUrl.java#L136-L162
train
Omertron/api-themoviedb
src/main/java/com/omertron/themoviedbapi/tools/ApiUrl.java
ApiUrl.idProcessing
private StringBuilder idProcessing(final TmdbParameters params) { StringBuilder urlString = new StringBuilder(); // Append the ID if (params.has(Param.ID)) { urlString.append("/").append(params.get(Param.ID)); } if (params.has(Param.SEASON_NUMBER)) { url...
java
private StringBuilder idProcessing(final TmdbParameters params) { StringBuilder urlString = new StringBuilder(); // Append the ID if (params.has(Param.ID)) { urlString.append("/").append(params.get(Param.ID)); } if (params.has(Param.SEASON_NUMBER)) { url...
[ "private", "StringBuilder", "idProcessing", "(", "final", "TmdbParameters", "params", ")", "{", "StringBuilder", "urlString", "=", "new", "StringBuilder", "(", ")", ";", "// Append the ID", "if", "(", "params", ".", "has", "(", "Param", ".", "ID", ")", ")", ...
Create the ID based URL portion @param params The parameters for the method @return Builder object
[ "Create", "the", "ID", "based", "URL", "portion" ]
bf132d7c7271734e13b58ba3bc92bba46f220118
https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/tools/ApiUrl.java#L170-L196
train
Omertron/api-themoviedb
src/main/java/com/omertron/themoviedbapi/tools/ApiUrl.java
ApiUrl.otherProcessing
private StringBuilder otherProcessing(final TmdbParameters params) { StringBuilder urlString = new StringBuilder(); for (Map.Entry<Param, String> argEntry : params.getEntries()) { // Skip the ID an QUERY params if (IGNORE_PARAMS.contains(argEntry.getKey())) { con...
java
private StringBuilder otherProcessing(final TmdbParameters params) { StringBuilder urlString = new StringBuilder(); for (Map.Entry<Param, String> argEntry : params.getEntries()) { // Skip the ID an QUERY params if (IGNORE_PARAMS.contains(argEntry.getKey())) { con...
[ "private", "StringBuilder", "otherProcessing", "(", "final", "TmdbParameters", "params", ")", "{", "StringBuilder", "urlString", "=", "new", "StringBuilder", "(", ")", ";", "for", "(", "Map", ".", "Entry", "<", "Param", ",", "String", ">", "argEntry", ":", "...
Create a string of the remaining parameters @param params The parameters for the method @return Builder object
[ "Create", "a", "string", "of", "the", "remaining", "parameters" ]
bf132d7c7271734e13b58ba3bc92bba46f220118
https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/tools/ApiUrl.java#L204-L218
train
Omertron/api-themoviedb
src/main/java/com/omertron/themoviedbapi/methods/TmdbReviews.java
TmdbReviews.getReview
public Review getReview(String reviewId) throws MovieDbException { TmdbParameters parameters = new TmdbParameters(); parameters.add(Param.ID, reviewId); URL url = new ApiUrl(apiKey, MethodBase.REVIEW).buildUrl(parameters); String webpage = httpTools.getRequest(url); try { ...
java
public Review getReview(String reviewId) throws MovieDbException { TmdbParameters parameters = new TmdbParameters(); parameters.add(Param.ID, reviewId); URL url = new ApiUrl(apiKey, MethodBase.REVIEW).buildUrl(parameters); String webpage = httpTools.getRequest(url); try { ...
[ "public", "Review", "getReview", "(", "String", "reviewId", ")", "throws", "MovieDbException", "{", "TmdbParameters", "parameters", "=", "new", "TmdbParameters", "(", ")", ";", "parameters", ".", "add", "(", "Param", ".", "ID", ",", "reviewId", ")", ";", "UR...
Get the full details of a review by ID. @param reviewId @return @throws MovieDbException
[ "Get", "the", "full", "details", "of", "a", "review", "by", "ID", "." ]
bf132d7c7271734e13b58ba3bc92bba46f220118
https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/methods/TmdbReviews.java#L58-L70
train
Omertron/api-themoviedb
src/main/java/com/omertron/themoviedbapi/tools/PostTools.java
PostTools.convertToJson
private String convertToJson(Map<String, ?> map) throws MovieDbException { try { return MAPPER.writeValueAsString(map); } catch (JsonProcessingException ex) { throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, "JSON conversion failed", "", ex); } }
java
private String convertToJson(Map<String, ?> map) throws MovieDbException { try { return MAPPER.writeValueAsString(map); } catch (JsonProcessingException ex) { throw new MovieDbException(ApiExceptionType.MAPPING_FAILED, "JSON conversion failed", "", ex); } }
[ "private", "String", "convertToJson", "(", "Map", "<", "String", ",", "?", ">", "map", ")", "throws", "MovieDbException", "{", "try", "{", "return", "MAPPER", ".", "writeValueAsString", "(", "map", ")", ";", "}", "catch", "(", "JsonProcessingException", "ex"...
Use Jackson to convert Map to JSON string. @param map Map to convert to json @return json string @throws MovieDbException exception
[ "Use", "Jackson", "to", "convert", "Map", "to", "JSON", "string", "." ]
bf132d7c7271734e13b58ba3bc92bba46f220118
https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/tools/PostTools.java#L68-L74
train
Omertron/api-themoviedb
src/main/java/com/omertron/themoviedbapi/methods/TmdbChanges.java
TmdbChanges.getChangeList
public ResultList<ChangeListItem> getChangeList(MethodBase method, Integer page, String startDate, String endDate) throws MovieDbException { TmdbParameters params = new TmdbParameters(); params.add(Param.PAGE, page); params.add(Param.START_DATE, startDate); params.add(Param.END_DATE, end...
java
public ResultList<ChangeListItem> getChangeList(MethodBase method, Integer page, String startDate, String endDate) throws MovieDbException { TmdbParameters params = new TmdbParameters(); params.add(Param.PAGE, page); params.add(Param.START_DATE, startDate); params.add(Param.END_DATE, end...
[ "public", "ResultList", "<", "ChangeListItem", ">", "getChangeList", "(", "MethodBase", "method", ",", "Integer", "page", ",", "String", "startDate", ",", "String", "endDate", ")", "throws", "MovieDbException", "{", "TmdbParameters", "params", "=", "new", "TmdbPar...
Get a list of Media IDs that have been edited. You can then use the movie/TV/person changes API to get the actual data that has been changed. @param method The method base to get @param page @param startDate the start date of the changes, optional @param endDate the end date of the changes, optional @return List of c...
[ "Get", "a", "list", "of", "Media", "IDs", "that", "have", "been", "edited", "." ]
bf132d7c7271734e13b58ba3bc92bba46f220118
https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/methods/TmdbChanges.java#L63-L72
train
Omertron/api-themoviedb
src/main/java/com/omertron/themoviedbapi/model/discover/Discover.java
Discover.year
public Discover year(int year) { if (checkYear(year)) { params.add(Param.YEAR, year); } return this; }
java
public Discover year(int year) { if (checkYear(year)) { params.add(Param.YEAR, year); } return this; }
[ "public", "Discover", "year", "(", "int", "year", ")", "{", "if", "(", "checkYear", "(", "year", ")", ")", "{", "params", ".", "add", "(", "Param", ".", "YEAR", ",", "year", ")", ";", "}", "return", "this", ";", "}" ]
Filter the results release dates to matches that include this value. @param year @return
[ "Filter", "the", "results", "release", "dates", "to", "matches", "that", "include", "this", "value", "." ]
bf132d7c7271734e13b58ba3bc92bba46f220118
https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/model/discover/Discover.java#L120-L125
train
Omertron/api-themoviedb
src/main/java/com/omertron/themoviedbapi/model/discover/Discover.java
Discover.primaryReleaseYear
public Discover primaryReleaseYear(int primaryReleaseYear) { if (checkYear(primaryReleaseYear)) { params.add(Param.PRIMARY_RELEASE_YEAR, primaryReleaseYear); } return this; }
java
public Discover primaryReleaseYear(int primaryReleaseYear) { if (checkYear(primaryReleaseYear)) { params.add(Param.PRIMARY_RELEASE_YEAR, primaryReleaseYear); } return this; }
[ "public", "Discover", "primaryReleaseYear", "(", "int", "primaryReleaseYear", ")", "{", "if", "(", "checkYear", "(", "primaryReleaseYear", ")", ")", "{", "params", ".", "add", "(", "Param", ".", "PRIMARY_RELEASE_YEAR", ",", "primaryReleaseYear", ")", ";", "}", ...
Filter the results so that only the primary release date year has this value @param primaryReleaseYear @return
[ "Filter", "the", "results", "so", "that", "only", "the", "primary", "release", "date", "year", "has", "this", "value" ]
bf132d7c7271734e13b58ba3bc92bba46f220118
https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/model/discover/Discover.java#L133-L138
train
Omertron/api-themoviedb
src/main/java/com/omertron/themoviedbapi/model/discover/Discover.java
Discover.firstAirDateYear
public Discover firstAirDateYear(int year) { if (checkYear(year)) { params.add(Param.FIRST_AIR_DATE_YEAR, year); } return this; }
java
public Discover firstAirDateYear(int year) { if (checkYear(year)) { params.add(Param.FIRST_AIR_DATE_YEAR, year); } return this; }
[ "public", "Discover", "firstAirDateYear", "(", "int", "year", ")", "{", "if", "(", "checkYear", "(", "year", ")", ")", "{", "params", ".", "add", "(", "Param", ".", "FIRST_AIR_DATE_YEAR", ",", "year", ")", ";", "}", "return", "this", ";", "}" ]
Filter the air dates that match this year Expected value is a year. @param year @return
[ "Filter", "the", "air", "dates", "that", "match", "this", "year" ]
bf132d7c7271734e13b58ba3bc92bba46f220118
https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/model/discover/Discover.java#L462-L467
train
Omertron/api-themoviedb
src/main/java/com/omertron/themoviedbapi/model/discover/Discover.java
Discover.firstAirDateYearGte
public Discover firstAirDateYearGte(int year) { if (checkYear(year)) { params.add(Param.FIRST_AIR_DATE_GTE, year); } return this; }
java
public Discover firstAirDateYearGte(int year) { if (checkYear(year)) { params.add(Param.FIRST_AIR_DATE_GTE, year); } return this; }
[ "public", "Discover", "firstAirDateYearGte", "(", "int", "year", ")", "{", "if", "(", "checkYear", "(", "year", ")", ")", "{", "params", ".", "add", "(", "Param", ".", "FIRST_AIR_DATE_GTE", ",", "year", ")", ";", "}", "return", "this", ";", "}" ]
Filter the air dates to years that are greater than or equal to this year @param year @return
[ "Filter", "the", "air", "dates", "to", "years", "that", "are", "greater", "than", "or", "equal", "to", "this", "year" ]
bf132d7c7271734e13b58ba3bc92bba46f220118
https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/model/discover/Discover.java#L475-L480
train
Omertron/api-themoviedb
src/main/java/com/omertron/themoviedbapi/model/discover/Discover.java
Discover.firstAirDateYearLte
public Discover firstAirDateYearLte(int year) { if (checkYear(year)) { params.add(Param.FIRST_AIR_DATE_LTE, year); } return this; }
java
public Discover firstAirDateYearLte(int year) { if (checkYear(year)) { params.add(Param.FIRST_AIR_DATE_LTE, year); } return this; }
[ "public", "Discover", "firstAirDateYearLte", "(", "int", "year", ")", "{", "if", "(", "checkYear", "(", "year", ")", ")", "{", "params", ".", "add", "(", "Param", ".", "FIRST_AIR_DATE_LTE", ",", "year", ")", ";", "}", "return", "this", ";", "}" ]
Filter the air dates to years that are less than or equal to this year @param year @return
[ "Filter", "the", "air", "dates", "to", "years", "that", "are", "less", "than", "or", "equal", "to", "this", "year" ]
bf132d7c7271734e13b58ba3bc92bba46f220118
https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/model/discover/Discover.java#L488-L493
train
Omertron/api-themoviedb
src/main/java/com/omertron/themoviedbapi/model/config/Configuration.java
Configuration.isValidPosterSize
public boolean isValidPosterSize(String posterSize) { if (StringUtils.isBlank(posterSize) || posterSizes.isEmpty()) { return false; } return posterSizes.contains(posterSize); }
java
public boolean isValidPosterSize(String posterSize) { if (StringUtils.isBlank(posterSize) || posterSizes.isEmpty()) { return false; } return posterSizes.contains(posterSize); }
[ "public", "boolean", "isValidPosterSize", "(", "String", "posterSize", ")", "{", "if", "(", "StringUtils", ".", "isBlank", "(", "posterSize", ")", "||", "posterSizes", ".", "isEmpty", "(", ")", ")", "{", "return", "false", ";", "}", "return", "posterSizes", ...
Check that the poster size is valid @param posterSize @return
[ "Check", "that", "the", "poster", "size", "is", "valid" ]
bf132d7c7271734e13b58ba3bc92bba46f220118
https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/model/config/Configuration.java#L129-L134
train
Omertron/api-themoviedb
src/main/java/com/omertron/themoviedbapi/model/config/Configuration.java
Configuration.isValidBackdropSize
public boolean isValidBackdropSize(String backdropSize) { if (StringUtils.isBlank(backdropSize) || backdropSizes.isEmpty()) { return false; } return backdropSizes.contains(backdropSize); }
java
public boolean isValidBackdropSize(String backdropSize) { if (StringUtils.isBlank(backdropSize) || backdropSizes.isEmpty()) { return false; } return backdropSizes.contains(backdropSize); }
[ "public", "boolean", "isValidBackdropSize", "(", "String", "backdropSize", ")", "{", "if", "(", "StringUtils", ".", "isBlank", "(", "backdropSize", ")", "||", "backdropSizes", ".", "isEmpty", "(", ")", ")", "{", "return", "false", ";", "}", "return", "backdr...
Check that the backdrop size is valid @param backdropSize @return
[ "Check", "that", "the", "backdrop", "size", "is", "valid" ]
bf132d7c7271734e13b58ba3bc92bba46f220118
https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/model/config/Configuration.java#L142-L147
train
Omertron/api-themoviedb
src/main/java/com/omertron/themoviedbapi/model/config/Configuration.java
Configuration.isValidProfileSize
public boolean isValidProfileSize(String profileSize) { if (StringUtils.isBlank(profileSize) || profileSizes.isEmpty()) { return false; } return profileSizes.contains(profileSize); }
java
public boolean isValidProfileSize(String profileSize) { if (StringUtils.isBlank(profileSize) || profileSizes.isEmpty()) { return false; } return profileSizes.contains(profileSize); }
[ "public", "boolean", "isValidProfileSize", "(", "String", "profileSize", ")", "{", "if", "(", "StringUtils", ".", "isBlank", "(", "profileSize", ")", "||", "profileSizes", ".", "isEmpty", "(", ")", ")", "{", "return", "false", ";", "}", "return", "profileSiz...
Check that the profile size is valid @param profileSize @return
[ "Check", "that", "the", "profile", "size", "is", "valid" ]
bf132d7c7271734e13b58ba3bc92bba46f220118
https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/model/config/Configuration.java#L155-L160
train
Omertron/api-themoviedb
src/main/java/com/omertron/themoviedbapi/model/config/Configuration.java
Configuration.isValidLogoSize
public boolean isValidLogoSize(String logoSize) { if (StringUtils.isBlank(logoSize) || logoSizes.isEmpty()) { return false; } return logoSizes.contains(logoSize); }
java
public boolean isValidLogoSize(String logoSize) { if (StringUtils.isBlank(logoSize) || logoSizes.isEmpty()) { return false; } return logoSizes.contains(logoSize); }
[ "public", "boolean", "isValidLogoSize", "(", "String", "logoSize", ")", "{", "if", "(", "StringUtils", ".", "isBlank", "(", "logoSize", ")", "||", "logoSizes", ".", "isEmpty", "(", ")", ")", "{", "return", "false", ";", "}", "return", "logoSizes", ".", "...
Check that the logo size is valid @param logoSize @return
[ "Check", "that", "the", "logo", "size", "is", "valid" ]
bf132d7c7271734e13b58ba3bc92bba46f220118
https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/model/config/Configuration.java#L168-L173
train
Omertron/api-themoviedb
src/main/java/com/omertron/themoviedbapi/model/config/Configuration.java
Configuration.isValidSize
public boolean isValidSize(String sizeToCheck) { return isValidPosterSize(sizeToCheck) || isValidBackdropSize(sizeToCheck) || isValidProfileSize(sizeToCheck) || isValidLogoSize(sizeToCheck); }
java
public boolean isValidSize(String sizeToCheck) { return isValidPosterSize(sizeToCheck) || isValidBackdropSize(sizeToCheck) || isValidProfileSize(sizeToCheck) || isValidLogoSize(sizeToCheck); }
[ "public", "boolean", "isValidSize", "(", "String", "sizeToCheck", ")", "{", "return", "isValidPosterSize", "(", "sizeToCheck", ")", "||", "isValidBackdropSize", "(", "sizeToCheck", ")", "||", "isValidProfileSize", "(", "sizeToCheck", ")", "||", "isValidLogoSize", "(...
Check to see if the size is valid for any of the images types @param sizeToCheck @return
[ "Check", "to", "see", "if", "the", "size", "is", "valid", "for", "any", "of", "the", "images", "types" ]
bf132d7c7271734e13b58ba3bc92bba46f220118
https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/model/config/Configuration.java#L181-L186
train
Omertron/api-themoviedb
src/main/java/com/omertron/themoviedbapi/methods/TmdbLists.java
TmdbLists.getList
public ListItem<MovieInfo> getList(String listId) throws MovieDbException { TmdbParameters parameters = new TmdbParameters(); parameters.add(Param.ID, listId); URL url = new ApiUrl(apiKey, MethodBase.LIST).buildUrl(parameters); String webpage = httpTools.getRequest(url); try { ...
java
public ListItem<MovieInfo> getList(String listId) throws MovieDbException { TmdbParameters parameters = new TmdbParameters(); parameters.add(Param.ID, listId); URL url = new ApiUrl(apiKey, MethodBase.LIST).buildUrl(parameters); String webpage = httpTools.getRequest(url); try { ...
[ "public", "ListItem", "<", "MovieInfo", ">", "getList", "(", "String", "listId", ")", "throws", "MovieDbException", "{", "TmdbParameters", "parameters", "=", "new", "TmdbParameters", "(", ")", ";", "parameters", ".", "add", "(", "Param", ".", "ID", ",", "lis...
Get a list by its ID @param listId @return The list and its items @throws MovieDbException
[ "Get", "a", "list", "by", "its", "ID" ]
bf132d7c7271734e13b58ba3bc92bba46f220118
https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/methods/TmdbLists.java#L66-L79
train
Omertron/api-themoviedb
src/main/java/com/omertron/themoviedbapi/methods/TmdbLists.java
TmdbLists.checkItemStatus
public boolean checkItemStatus(String listId, int mediaId) throws MovieDbException { TmdbParameters parameters = new TmdbParameters(); parameters.add(Param.ID, listId); parameters.add(Param.MOVIE_ID, mediaId); URL url = new ApiUrl(apiKey, MethodBase.LIST).subMethod(MethodSub.ITEM_STATUS...
java
public boolean checkItemStatus(String listId, int mediaId) throws MovieDbException { TmdbParameters parameters = new TmdbParameters(); parameters.add(Param.ID, listId); parameters.add(Param.MOVIE_ID, mediaId); URL url = new ApiUrl(apiKey, MethodBase.LIST).subMethod(MethodSub.ITEM_STATUS...
[ "public", "boolean", "checkItemStatus", "(", "String", "listId", ",", "int", "mediaId", ")", "throws", "MovieDbException", "{", "TmdbParameters", "parameters", "=", "new", "TmdbParameters", "(", ")", ";", "parameters", ".", "add", "(", "Param", ".", "ID", ",",...
Check to see if an ID is already on a list. @param listId @param mediaId @return true if the movie is on the list @throws MovieDbException
[ "Check", "to", "see", "if", "an", "ID", "is", "already", "on", "a", "list", "." ]
bf132d7c7271734e13b58ba3bc92bba46f220118
https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/methods/TmdbLists.java#L89-L102
train
Omertron/api-themoviedb
src/main/java/com/omertron/themoviedbapi/methods/TmdbLists.java
TmdbLists.modifyMovieList
private StatusCode modifyMovieList(String sessionId, String listId, int movieId, MethodSub operation) throws MovieDbException { TmdbParameters parameters = new TmdbParameters(); parameters.add(Param.SESSION_ID, sessionId); parameters.add(Param.ID, listId); String jsonBody = new PostTool...
java
private StatusCode modifyMovieList(String sessionId, String listId, int movieId, MethodSub operation) throws MovieDbException { TmdbParameters parameters = new TmdbParameters(); parameters.add(Param.SESSION_ID, sessionId); parameters.add(Param.ID, listId); String jsonBody = new PostTool...
[ "private", "StatusCode", "modifyMovieList", "(", "String", "sessionId", ",", "String", "listId", ",", "int", "movieId", ",", "MethodSub", "operation", ")", "throws", "MovieDbException", "{", "TmdbParameters", "parameters", "=", "new", "TmdbParameters", "(", ")", "...
Modify a list This can be used to add or remove an item from the list @param sessionId @param listId @param movieId @param operation @return @throws MovieDbException
[ "Modify", "a", "list" ]
bf132d7c7271734e13b58ba3bc92bba46f220118
https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/methods/TmdbLists.java#L167-L184
train
Omertron/api-themoviedb
src/main/java/com/omertron/themoviedbapi/methods/TmdbLists.java
TmdbLists.removeItem
public StatusCode removeItem(String sessionId, String listId, int mediaId) throws MovieDbException { return modifyMovieList(sessionId, listId, mediaId, MethodSub.REMOVE_ITEM); }
java
public StatusCode removeItem(String sessionId, String listId, int mediaId) throws MovieDbException { return modifyMovieList(sessionId, listId, mediaId, MethodSub.REMOVE_ITEM); }
[ "public", "StatusCode", "removeItem", "(", "String", "sessionId", ",", "String", "listId", ",", "int", "mediaId", ")", "throws", "MovieDbException", "{", "return", "modifyMovieList", "(", "sessionId", ",", "listId", ",", "mediaId", ",", "MethodSub", ".", "REMOVE...
This method lets users delete items from a list that they created. A valid session id is required. @param sessionId @param listId @param mediaId @return @throws MovieDbException
[ "This", "method", "lets", "users", "delete", "items", "from", "a", "list", "that", "they", "created", "." ]
bf132d7c7271734e13b58ba3bc92bba46f220118
https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/methods/TmdbLists.java#L212-L214
train
Omertron/api-themoviedb
src/main/java/com/omertron/themoviedbapi/methods/TmdbLists.java
TmdbLists.clear
public StatusCode clear(String sessionId, String listId, boolean confirm) throws MovieDbException { TmdbParameters parameters = new TmdbParameters(); parameters.add(Param.SESSION_ID, sessionId); parameters.add(Param.ID, listId); parameters.add(Param.CONFIRM, confirm); URL url = ...
java
public StatusCode clear(String sessionId, String listId, boolean confirm) throws MovieDbException { TmdbParameters parameters = new TmdbParameters(); parameters.add(Param.SESSION_ID, sessionId); parameters.add(Param.ID, listId); parameters.add(Param.CONFIRM, confirm); URL url = ...
[ "public", "StatusCode", "clear", "(", "String", "sessionId", ",", "String", "listId", ",", "boolean", "confirm", ")", "throws", "MovieDbException", "{", "TmdbParameters", "parameters", "=", "new", "TmdbParameters", "(", ")", ";", "parameters", ".", "add", "(", ...
Clear all of the items within a list. This is a irreversible action and should be treated with caution. A valid session id is required. A call without confirm=true will return status code 29. @param sessionId @param listId @param confirm @return @throws MovieDbException
[ "Clear", "all", "of", "the", "items", "within", "a", "list", "." ]
bf132d7c7271734e13b58ba3bc92bba46f220118
https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/methods/TmdbLists.java#L229-L244
train
Omertron/api-themoviedb
src/main/java/com/omertron/themoviedbapi/methods/TmdbKeywords.java
TmdbKeywords.getKeyword
public Keyword getKeyword(String keywordId) throws MovieDbException { TmdbParameters parameters = new TmdbParameters(); parameters.add(Param.ID, keywordId); URL url = new ApiUrl(apiKey, MethodBase.KEYWORD).buildUrl(parameters); String webpage = httpTools.getRequest(url); try { ...
java
public Keyword getKeyword(String keywordId) throws MovieDbException { TmdbParameters parameters = new TmdbParameters(); parameters.add(Param.ID, keywordId); URL url = new ApiUrl(apiKey, MethodBase.KEYWORD).buildUrl(parameters); String webpage = httpTools.getRequest(url); try { ...
[ "public", "Keyword", "getKeyword", "(", "String", "keywordId", ")", "throws", "MovieDbException", "{", "TmdbParameters", "parameters", "=", "new", "TmdbParameters", "(", ")", ";", "parameters", ".", "add", "(", "Param", ".", "ID", ",", "keywordId", ")", ";", ...
Get the basic information for a specific keyword id. @param keywordId @return @throws MovieDbException
[ "Get", "the", "basic", "information", "for", "a", "specific", "keyword", "id", "." ]
bf132d7c7271734e13b58ba3bc92bba46f220118
https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/methods/TmdbKeywords.java#L61-L74
train
Omertron/api-themoviedb
src/main/java/com/omertron/themoviedbapi/tools/HttpTools.java
HttpTools.getRequest
public String getRequest(final URL url) throws MovieDbException { try { HttpGet httpGet = new HttpGet(url.toURI()); httpGet.addHeader(HttpHeaders.ACCEPT, APPLICATION_JSON); DigestedResponse response = DigestedResponseReader.requestContent(httpClient, httpGet, CHARSET); ...
java
public String getRequest(final URL url) throws MovieDbException { try { HttpGet httpGet = new HttpGet(url.toURI()); httpGet.addHeader(HttpHeaders.ACCEPT, APPLICATION_JSON); DigestedResponse response = DigestedResponseReader.requestContent(httpClient, httpGet, CHARSET); ...
[ "public", "String", "getRequest", "(", "final", "URL", "url", ")", "throws", "MovieDbException", "{", "try", "{", "HttpGet", "httpGet", "=", "new", "HttpGet", "(", "url", ".", "toURI", "(", ")", ")", ";", "httpGet", ".", "addHeader", "(", "HttpHeaders", ...
GET data from the URL @param url URL to use in the request @return String content @throws MovieDbException exception
[ "GET", "data", "from", "the", "URL" ]
bf132d7c7271734e13b58ba3bc92bba46f220118
https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/tools/HttpTools.java#L66-L87
train
Omertron/api-themoviedb
src/main/java/com/omertron/themoviedbapi/tools/HttpTools.java
HttpTools.delay
private void delay(long multiplier) { try { // Wait for the timeout to finish Thread.sleep(TimeUnit.SECONDS.toMillis(RETRY_DELAY * multiplier)); } catch (InterruptedException ex) { // Doesn't matter if we're interrupted } }
java
private void delay(long multiplier) { try { // Wait for the timeout to finish Thread.sleep(TimeUnit.SECONDS.toMillis(RETRY_DELAY * multiplier)); } catch (InterruptedException ex) { // Doesn't matter if we're interrupted } }
[ "private", "void", "delay", "(", "long", "multiplier", ")", "{", "try", "{", "// Wait for the timeout to finish", "Thread", ".", "sleep", "(", "TimeUnit", ".", "SECONDS", ".", "toMillis", "(", "RETRY_DELAY", "*", "multiplier", ")", ")", ";", "}", "catch", "(...
Sleep for a period of time @param multiplier number of seconds to use for delay
[ "Sleep", "for", "a", "period", "of", "time" ]
bf132d7c7271734e13b58ba3bc92bba46f220118
https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/tools/HttpTools.java#L94-L101
train
Omertron/api-themoviedb
src/main/java/com/omertron/themoviedbapi/tools/HttpTools.java
HttpTools.deleteRequest
public String deleteRequest(final URL url) throws MovieDbException { try { HttpDelete httpDel = new HttpDelete(url.toURI()); return validateResponse(DigestedResponseReader.deleteContent(httpClient, httpDel, CHARSET), url); } catch (URISyntaxException | IOException ex) { ...
java
public String deleteRequest(final URL url) throws MovieDbException { try { HttpDelete httpDel = new HttpDelete(url.toURI()); return validateResponse(DigestedResponseReader.deleteContent(httpClient, httpDel, CHARSET), url); } catch (URISyntaxException | IOException ex) { ...
[ "public", "String", "deleteRequest", "(", "final", "URL", "url", ")", "throws", "MovieDbException", "{", "try", "{", "HttpDelete", "httpDel", "=", "new", "HttpDelete", "(", "url", ".", "toURI", "(", ")", ")", ";", "return", "validateResponse", "(", "Digested...
Execute a DELETE on the URL @param url URL to use in the request @return String content @throws MovieDbException exception
[ "Execute", "a", "DELETE", "on", "the", "URL" ]
bf132d7c7271734e13b58ba3bc92bba46f220118
https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/tools/HttpTools.java#L110-L117
train
Omertron/api-themoviedb
src/main/java/com/omertron/themoviedbapi/tools/HttpTools.java
HttpTools.postRequest
public String postRequest(final URL url, final String jsonBody) throws MovieDbException { try { HttpPost httpPost = new HttpPost(url.toURI()); httpPost.addHeader(HTTP.CONTENT_TYPE, APPLICATION_JSON); httpPost.addHeader(HttpHeaders.ACCEPT, APPLICATION_JSON); String...
java
public String postRequest(final URL url, final String jsonBody) throws MovieDbException { try { HttpPost httpPost = new HttpPost(url.toURI()); httpPost.addHeader(HTTP.CONTENT_TYPE, APPLICATION_JSON); httpPost.addHeader(HttpHeaders.ACCEPT, APPLICATION_JSON); String...
[ "public", "String", "postRequest", "(", "final", "URL", "url", ",", "final", "String", "jsonBody", ")", "throws", "MovieDbException", "{", "try", "{", "HttpPost", "httpPost", "=", "new", "HttpPost", "(", "url", ".", "toURI", "(", ")", ")", ";", "httpPost",...
POST content to the URL with the specified body @param url URL to use in the request @param jsonBody Body to use in the request @return String content @throws MovieDbException exception
[ "POST", "content", "to", "the", "URL", "with", "the", "specified", "body" ]
bf132d7c7271734e13b58ba3bc92bba46f220118
https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/tools/HttpTools.java#L127-L139
train
Omertron/api-themoviedb
src/main/java/com/omertron/themoviedbapi/tools/HttpTools.java
HttpTools.validateResponse
private String validateResponse(final DigestedResponse response, final URL url) throws MovieDbException { if (response.getStatusCode() == 0) { throw new MovieDbException(ApiExceptionType.CONNECTION_ERROR, response.getContent(), response.getStatusCode(), url, null); } else if (response.getSta...
java
private String validateResponse(final DigestedResponse response, final URL url) throws MovieDbException { if (response.getStatusCode() == 0) { throw new MovieDbException(ApiExceptionType.CONNECTION_ERROR, response.getContent(), response.getStatusCode(), url, null); } else if (response.getSta...
[ "private", "String", "validateResponse", "(", "final", "DigestedResponse", "response", ",", "final", "URL", "url", ")", "throws", "MovieDbException", "{", "if", "(", "response", ".", "getStatusCode", "(", ")", "==", "0", ")", "{", "throw", "new", "MovieDbExcep...
Check the status codes of the response and throw exceptions if needed @param response DigestedResponse to process @param url URL for notification purposes @return String content @throws MovieDbException exception
[ "Check", "the", "status", "codes", "of", "the", "response", "and", "throw", "exceptions", "if", "needed" ]
bf132d7c7271734e13b58ba3bc92bba46f220118
https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/tools/HttpTools.java#L149-L159
train
Omertron/api-themoviedb
src/main/java/com/omertron/themoviedbapi/tools/TmdbParameters.java
TmdbParameters.add
public void add(final Param key, final String[] value) { if (value != null && value.length > 0) { parameters.put(key, toList(value)); } }
java
public void add(final Param key, final String[] value) { if (value != null && value.length > 0) { parameters.put(key, toList(value)); } }
[ "public", "void", "add", "(", "final", "Param", "key", ",", "final", "String", "[", "]", "value", ")", "{", "if", "(", "value", "!=", "null", "&&", "value", ".", "length", ">", "0", ")", "{", "parameters", ".", "put", "(", "key", ",", "toList", "...
Add an array parameter to the collection @param key Parameter to add @param value The array value to use (will be converted into a comma separated list)
[ "Add", "an", "array", "parameter", "to", "the", "collection" ]
bf132d7c7271734e13b58ba3bc92bba46f220118
https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/tools/TmdbParameters.java#L60-L64
train
Omertron/api-themoviedb
src/main/java/com/omertron/themoviedbapi/tools/TmdbParameters.java
TmdbParameters.add
public void add(final Param key, final String value) { if (StringUtils.isNotBlank(value)) { parameters.put(key, value); } }
java
public void add(final Param key, final String value) { if (StringUtils.isNotBlank(value)) { parameters.put(key, value); } }
[ "public", "void", "add", "(", "final", "Param", "key", ",", "final", "String", "value", ")", "{", "if", "(", "StringUtils", ".", "isNotBlank", "(", "value", ")", ")", "{", "parameters", ".", "put", "(", "key", ",", "value", ")", ";", "}", "}" ]
Add a string parameter to the collection @param key Parameter to add @param value The value to add (will be checked to ensure it's valid)
[ "Add", "a", "string", "parameter", "to", "the", "collection" ]
bf132d7c7271734e13b58ba3bc92bba46f220118
https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/tools/TmdbParameters.java#L72-L76
train
Omertron/api-themoviedb
src/main/java/com/omertron/themoviedbapi/tools/TmdbParameters.java
TmdbParameters.add
public void add(final Param key, final Integer value) { if (value != null && value > 0) { parameters.put(key, String.valueOf(value)); } }
java
public void add(final Param key, final Integer value) { if (value != null && value > 0) { parameters.put(key, String.valueOf(value)); } }
[ "public", "void", "add", "(", "final", "Param", "key", ",", "final", "Integer", "value", ")", "{", "if", "(", "value", "!=", "null", "&&", "value", ">", "0", ")", "{", "parameters", ".", "put", "(", "key", ",", "String", ".", "valueOf", "(", "value...
Add an integer parameter to the collection @param key Parameter to add @param value The value to add (will be checked to ensure greater than zero)
[ "Add", "an", "integer", "parameter", "to", "the", "collection" ]
bf132d7c7271734e13b58ba3bc92bba46f220118
https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/tools/TmdbParameters.java#L84-L88
train
Omertron/api-themoviedb
src/main/java/com/omertron/themoviedbapi/tools/TmdbParameters.java
TmdbParameters.toList
public String toList(final String[] appendToResponse) { StringBuilder sb = new StringBuilder(); boolean first = Boolean.TRUE; for (String append : appendToResponse) { if (first) { first = Boolean.FALSE; } else { sb.append(","); ...
java
public String toList(final String[] appendToResponse) { StringBuilder sb = new StringBuilder(); boolean first = Boolean.TRUE; for (String append : appendToResponse) { if (first) { first = Boolean.FALSE; } else { sb.append(","); ...
[ "public", "String", "toList", "(", "final", "String", "[", "]", "appendToResponse", ")", "{", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", ")", ";", "boolean", "first", "=", "Boolean", ".", "TRUE", ";", "for", "(", "String", "append", ":", "a...
Append any optional parameters to the URL @param appendToResponse String array to convert to a comma list @return comma separated list
[ "Append", "any", "optional", "parameters", "to", "the", "URL" ]
bf132d7c7271734e13b58ba3bc92bba46f220118
https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/tools/TmdbParameters.java#L167-L180
train
Omertron/api-themoviedb
src/main/java/com/omertron/themoviedbapi/methods/AbstractMethod.java
AbstractMethod.getTypeReference
protected static TypeReference getTypeReference(Class aClass) throws MovieDbException { if (TYPE_REFS.containsKey(aClass)) { return TYPE_REFS.get(aClass); } else { throw new MovieDbException(ApiExceptionType.UNKNOWN_CAUSE, "Class type reference for '" + aClass.getSimpleName() + "...
java
protected static TypeReference getTypeReference(Class aClass) throws MovieDbException { if (TYPE_REFS.containsKey(aClass)) { return TYPE_REFS.get(aClass); } else { throw new MovieDbException(ApiExceptionType.UNKNOWN_CAUSE, "Class type reference for '" + aClass.getSimpleName() + "...
[ "protected", "static", "TypeReference", "getTypeReference", "(", "Class", "aClass", ")", "throws", "MovieDbException", "{", "if", "(", "TYPE_REFS", ".", "containsKey", "(", "aClass", ")", ")", "{", "return", "TYPE_REFS", ".", "get", "(", "aClass", ")", ";", ...
Helper function to get a pre-generated TypeReference for a class @param aClass @return @throws MovieDbException
[ "Helper", "function", "to", "get", "a", "pre", "-", "generated", "TypeReference", "for", "a", "class" ]
bf132d7c7271734e13b58ba3bc92bba46f220118
https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/methods/AbstractMethod.java#L127-L133
train
Omertron/api-themoviedb
src/main/java/com/omertron/themoviedbapi/methods/AbstractMethod.java
AbstractMethod.processWrapperList
protected <T> List<T> processWrapperList(TypeReference typeRef, URL url, String errorMessageSuffix) throws MovieDbException { WrapperGenericList<T> val = processWrapper(typeRef, url, errorMessageSuffix); return val.getResults(); }
java
protected <T> List<T> processWrapperList(TypeReference typeRef, URL url, String errorMessageSuffix) throws MovieDbException { WrapperGenericList<T> val = processWrapper(typeRef, url, errorMessageSuffix); return val.getResults(); }
[ "protected", "<", "T", ">", "List", "<", "T", ">", "processWrapperList", "(", "TypeReference", "typeRef", ",", "URL", "url", ",", "String", "errorMessageSuffix", ")", "throws", "MovieDbException", "{", "WrapperGenericList", "<", "T", ">", "val", "=", "processW...
Process the wrapper list and return the results @param <T> Type of list to process @param typeRef @param url URL of the page (Error output only) @param errorMessageSuffix Error message to output (Error output only) @return @throws MovieDbException
[ "Process", "the", "wrapper", "list", "and", "return", "the", "results" ]
bf132d7c7271734e13b58ba3bc92bba46f220118
https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/methods/AbstractMethod.java#L145-L148
train
Omertron/api-themoviedb
src/main/java/com/omertron/themoviedbapi/methods/AbstractMethod.java
AbstractMethod.processWrapper
protected <T> WrapperGenericList<T> processWrapper(TypeReference typeRef, URL url, String errorMessageSuffix) throws MovieDbException { String webpage = httpTools.getRequest(url); try { // Due to type erasure, this doesn't work // TypeReference<WrapperGenericList<T>> typeRef = ne...
java
protected <T> WrapperGenericList<T> processWrapper(TypeReference typeRef, URL url, String errorMessageSuffix) throws MovieDbException { String webpage = httpTools.getRequest(url); try { // Due to type erasure, this doesn't work // TypeReference<WrapperGenericList<T>> typeRef = ne...
[ "protected", "<", "T", ">", "WrapperGenericList", "<", "T", ">", "processWrapper", "(", "TypeReference", "typeRef", ",", "URL", "url", ",", "String", "errorMessageSuffix", ")", "throws", "MovieDbException", "{", "String", "webpage", "=", "httpTools", ".", "getRe...
Process the wrapper list and return the whole wrapper @param <T> Type of list to process @param typeRef @param url URL of the page (Error output only) @param errorMessageSuffix Error message to output (Error output only) @return @throws MovieDbException
[ "Process", "the", "wrapper", "list", "and", "return", "the", "whole", "wrapper" ]
bf132d7c7271734e13b58ba3bc92bba46f220118
https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/methods/AbstractMethod.java#L160-L169
train
Omertron/api-themoviedb
src/main/java/com/omertron/themoviedbapi/methods/TmdbConfiguration.java
TmdbConfiguration.getJobs
public ResultList<JobDepartment> getJobs() throws MovieDbException { URL url = new ApiUrl(apiKey, MethodBase.JOB).subMethod(MethodSub.LIST).buildUrl(); String webpage = httpTools.getRequest(url); try { WrapperJobList wrapper = MAPPER.readValue(webpage, WrapperJobList.class); ...
java
public ResultList<JobDepartment> getJobs() throws MovieDbException { URL url = new ApiUrl(apiKey, MethodBase.JOB).subMethod(MethodSub.LIST).buildUrl(); String webpage = httpTools.getRequest(url); try { WrapperJobList wrapper = MAPPER.readValue(webpage, WrapperJobList.class); ...
[ "public", "ResultList", "<", "JobDepartment", ">", "getJobs", "(", ")", "throws", "MovieDbException", "{", "URL", "url", "=", "new", "ApiUrl", "(", "apiKey", ",", "MethodBase", ".", "JOB", ")", ".", "subMethod", "(", "MethodSub", ".", "LIST", ")", ".", "...
Get a list of valid jobs @return @throws MovieDbException
[ "Get", "a", "list", "of", "valid", "jobs" ]
bf132d7c7271734e13b58ba3bc92bba46f220118
https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/methods/TmdbConfiguration.java#L92-L104
train
Omertron/api-themoviedb
src/main/java/com/omertron/themoviedbapi/methods/TmdbConfiguration.java
TmdbConfiguration.getTimezones
public ResultsMap<String, List<String>> getTimezones() throws MovieDbException { URL url = new ApiUrl(apiKey, MethodBase.TIMEZONES).subMethod(MethodSub.LIST).buildUrl(); String webpage = httpTools.getRequest(url); List<Map<String, List<String>>> tzList; try { tzList = MAPPER...
java
public ResultsMap<String, List<String>> getTimezones() throws MovieDbException { URL url = new ApiUrl(apiKey, MethodBase.TIMEZONES).subMethod(MethodSub.LIST).buildUrl(); String webpage = httpTools.getRequest(url); List<Map<String, List<String>>> tzList; try { tzList = MAPPER...
[ "public", "ResultsMap", "<", "String", ",", "List", "<", "String", ">", ">", "getTimezones", "(", ")", "throws", "MovieDbException", "{", "URL", "url", "=", "new", "ApiUrl", "(", "apiKey", ",", "MethodBase", ".", "TIMEZONES", ")", ".", "subMethod", "(", ...
Get the list of supported timezones for the API methods that support them @return @throws MovieDbException
[ "Get", "the", "list", "of", "supported", "timezones", "for", "the", "API", "methods", "that", "support", "them" ]
bf132d7c7271734e13b58ba3bc92bba46f220118
https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/methods/TmdbConfiguration.java#L112-L133
train
Omertron/api-themoviedb
src/main/java/com/omertron/themoviedbapi/methods/TmdbGenres.java
TmdbGenres.getGenreMovieList
public ResultList<Genre> getGenreMovieList(String language) throws MovieDbException { return getGenreList(language, MethodSub.MOVIE_LIST); }
java
public ResultList<Genre> getGenreMovieList(String language) throws MovieDbException { return getGenreList(language, MethodSub.MOVIE_LIST); }
[ "public", "ResultList", "<", "Genre", ">", "getGenreMovieList", "(", "String", "language", ")", "throws", "MovieDbException", "{", "return", "getGenreList", "(", "language", ",", "MethodSub", ".", "MOVIE_LIST", ")", ";", "}" ]
Get the list of movie genres. @param language @return @throws MovieDbException
[ "Get", "the", "list", "of", "movie", "genres", "." ]
bf132d7c7271734e13b58ba3bc92bba46f220118
https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/methods/TmdbGenres.java#L62-L64
train
Omertron/api-themoviedb
src/main/java/com/omertron/themoviedbapi/methods/TmdbGenres.java
TmdbGenres.getGenreTVList
public ResultList<Genre> getGenreTVList(String language) throws MovieDbException { return getGenreList(language, MethodSub.TV_LIST); }
java
public ResultList<Genre> getGenreTVList(String language) throws MovieDbException { return getGenreList(language, MethodSub.TV_LIST); }
[ "public", "ResultList", "<", "Genre", ">", "getGenreTVList", "(", "String", "language", ")", "throws", "MovieDbException", "{", "return", "getGenreList", "(", "language", ",", "MethodSub", ".", "TV_LIST", ")", ";", "}" ]
Get the list of TV genres. @param language @return @throws MovieDbException
[ "Get", "the", "list", "of", "TV", "genres", "." ]
bf132d7c7271734e13b58ba3bc92bba46f220118
https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/methods/TmdbGenres.java#L73-L75
train
Omertron/api-themoviedb
src/main/java/com/omertron/themoviedbapi/methods/TmdbGenres.java
TmdbGenres.getGenreList
private ResultList<Genre> getGenreList(String language, MethodSub sub) throws MovieDbException { TmdbParameters parameters = new TmdbParameters(); parameters.add(Param.LANGUAGE, language); URL url = new ApiUrl(apiKey, MethodBase.GENRE).subMethod(sub).buildUrl(parameters); String webpage...
java
private ResultList<Genre> getGenreList(String language, MethodSub sub) throws MovieDbException { TmdbParameters parameters = new TmdbParameters(); parameters.add(Param.LANGUAGE, language); URL url = new ApiUrl(apiKey, MethodBase.GENRE).subMethod(sub).buildUrl(parameters); String webpage...
[ "private", "ResultList", "<", "Genre", ">", "getGenreList", "(", "String", "language", ",", "MethodSub", "sub", ")", "throws", "MovieDbException", "{", "TmdbParameters", "parameters", "=", "new", "TmdbParameters", "(", ")", ";", "parameters", ".", "add", "(", ...
Get the list of genres for movies or TV @param language @param sub @return @throws MovieDbException
[ "Get", "the", "list", "of", "genres", "for", "movies", "or", "TV" ]
bf132d7c7271734e13b58ba3bc92bba46f220118
https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/methods/TmdbGenres.java#L85-L100
train
Omertron/api-themoviedb
src/main/java/com/omertron/themoviedbapi/methods/TmdbGenres.java
TmdbGenres.getGenreMovies
public ResultList<MovieBasic> getGenreMovies(int genreId, String language, Integer page, Boolean includeAllMovies, Boolean includeAdult) throws MovieDbException { TmdbParameters parameters = new TmdbParameters(); parameters.add(Param.ID, genreId); parameters.add(Param.LANGUAGE, language); ...
java
public ResultList<MovieBasic> getGenreMovies(int genreId, String language, Integer page, Boolean includeAllMovies, Boolean includeAdult) throws MovieDbException { TmdbParameters parameters = new TmdbParameters(); parameters.add(Param.ID, genreId); parameters.add(Param.LANGUAGE, language); ...
[ "public", "ResultList", "<", "MovieBasic", ">", "getGenreMovies", "(", "int", "genreId", ",", "String", "language", ",", "Integer", "page", ",", "Boolean", "includeAllMovies", ",", "Boolean", "includeAdult", ")", "throws", "MovieDbException", "{", "TmdbParameters", ...
Get the list of movies for a particular genre by id. By default, only movies with 10 or more votes are included. @param genreId @param language @param page @param includeAllMovies @param includeAdult @return @throws MovieDbException
[ "Get", "the", "list", "of", "movies", "for", "a", "particular", "genre", "by", "id", "." ]
bf132d7c7271734e13b58ba3bc92bba46f220118
https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/methods/TmdbGenres.java#L115-L128
train
Omertron/api-themoviedb
src/main/java/com/omertron/themoviedbapi/methods/TmdbEpisodes.java
TmdbEpisodes.getEpisodeChanges
public ResultList<ChangeKeyItem> getEpisodeChanges(int episodeID, String startDate, String endDate) throws MovieDbException { return getMediaChanges(episodeID, startDate, endDate); }
java
public ResultList<ChangeKeyItem> getEpisodeChanges(int episodeID, String startDate, String endDate) throws MovieDbException { return getMediaChanges(episodeID, startDate, endDate); }
[ "public", "ResultList", "<", "ChangeKeyItem", ">", "getEpisodeChanges", "(", "int", "episodeID", ",", "String", "startDate", ",", "String", "endDate", ")", "throws", "MovieDbException", "{", "return", "getMediaChanges", "(", "episodeID", ",", "startDate", ",", "en...
Look up a TV episode's changes by episode ID @param episodeID @param startDate @param endDate @return @throws MovieDbException
[ "Look", "up", "a", "TV", "episode", "s", "changes", "by", "episode", "ID" ]
bf132d7c7271734e13b58ba3bc92bba46f220118
https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/methods/TmdbEpisodes.java#L105-L107
train
Omertron/api-themoviedb
src/main/java/com/omertron/themoviedbapi/methods/TmdbAccount.java
TmdbAccount.getAccount
public Account getAccount(String sessionId) throws MovieDbException { TmdbParameters parameters = new TmdbParameters(); parameters.add(Param.SESSION_ID, sessionId); URL url = new ApiUrl(apiKey, MethodBase.ACCOUNT).buildUrl(parameters); String webpage = httpTools.getRequest(url); ...
java
public Account getAccount(String sessionId) throws MovieDbException { TmdbParameters parameters = new TmdbParameters(); parameters.add(Param.SESSION_ID, sessionId); URL url = new ApiUrl(apiKey, MethodBase.ACCOUNT).buildUrl(parameters); String webpage = httpTools.getRequest(url); ...
[ "public", "Account", "getAccount", "(", "String", "sessionId", ")", "throws", "MovieDbException", "{", "TmdbParameters", "parameters", "=", "new", "TmdbParameters", "(", ")", ";", "parameters", ".", "add", "(", "Param", ".", "SESSION_ID", ",", "sessionId", ")", ...
Get the basic information for an account. You will need to have a valid session id. @param sessionId @return @throws MovieDbException
[ "Get", "the", "basic", "information", "for", "an", "account", ".", "You", "will", "need", "to", "have", "a", "valid", "session", "id", "." ]
bf132d7c7271734e13b58ba3bc92bba46f220118
https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/methods/TmdbAccount.java#L68-L80
train
Omertron/api-themoviedb
src/main/java/com/omertron/themoviedbapi/methods/TmdbAccount.java
TmdbAccount.modifyWatchList
public StatusCode modifyWatchList(String sessionId, int accountId, MediaType mediaType, Integer movieId, boolean addToWatchlist) throws MovieDbException { TmdbParameters parameters = new TmdbParameters(); parameters.add(Param.SESSION_ID, sessionId); parameters.add(Param.ID, accountId); ...
java
public StatusCode modifyWatchList(String sessionId, int accountId, MediaType mediaType, Integer movieId, boolean addToWatchlist) throws MovieDbException { TmdbParameters parameters = new TmdbParameters(); parameters.add(Param.SESSION_ID, sessionId); parameters.add(Param.ID, accountId); ...
[ "public", "StatusCode", "modifyWatchList", "(", "String", "sessionId", ",", "int", "accountId", ",", "MediaType", "mediaType", ",", "Integer", "movieId", ",", "boolean", "addToWatchlist", ")", "throws", "MovieDbException", "{", "TmdbParameters", "parameters", "=", "...
Add or remove a movie to an accounts watch list. @param sessionId @param accountId @param movieId @param mediaType @param addToWatchlist @return @throws MovieDbException
[ "Add", "or", "remove", "a", "movie", "to", "an", "accounts", "watch", "list", "." ]
bf132d7c7271734e13b58ba3bc92bba46f220118
https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/methods/TmdbAccount.java#L275-L294
train
Omertron/api-themoviedb
src/main/java/com/omertron/themoviedbapi/methods/TmdbCompanies.java
TmdbCompanies.getCompanyInfo
public Company getCompanyInfo(int companyId) throws MovieDbException { TmdbParameters parameters = new TmdbParameters(); parameters.add(Param.ID, companyId); URL url = new ApiUrl(apiKey, MethodBase.COMPANY).buildUrl(parameters); String webpage = httpTools.getRequest(url); try {...
java
public Company getCompanyInfo(int companyId) throws MovieDbException { TmdbParameters parameters = new TmdbParameters(); parameters.add(Param.ID, companyId); URL url = new ApiUrl(apiKey, MethodBase.COMPANY).buildUrl(parameters); String webpage = httpTools.getRequest(url); try {...
[ "public", "Company", "getCompanyInfo", "(", "int", "companyId", ")", "throws", "MovieDbException", "{", "TmdbParameters", "parameters", "=", "new", "TmdbParameters", "(", ")", ";", "parameters", ".", "add", "(", "Param", ".", "ID", ",", "companyId", ")", ";", ...
This method is used to retrieve the basic information about a production company on TMDb. @param companyId @return @throws MovieDbException
[ "This", "method", "is", "used", "to", "retrieve", "the", "basic", "information", "about", "a", "production", "company", "on", "TMDb", "." ]
bf132d7c7271734e13b58ba3bc92bba46f220118
https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/methods/TmdbCompanies.java#L61-L73
train
Omertron/api-themoviedb
src/main/java/com/omertron/themoviedbapi/methods/TmdbTV.java
TmdbTV.getTVAlternativeTitles
public ResultList<AlternativeTitle> getTVAlternativeTitles(int tvID) throws MovieDbException { TmdbParameters parameters = new TmdbParameters(); parameters.add(Param.ID, tvID); URL url = new ApiUrl(apiKey, MethodBase.TV).subMethod(MethodSub.ALT_TITLES).buildUrl(parameters); WrapperGener...
java
public ResultList<AlternativeTitle> getTVAlternativeTitles(int tvID) throws MovieDbException { TmdbParameters parameters = new TmdbParameters(); parameters.add(Param.ID, tvID); URL url = new ApiUrl(apiKey, MethodBase.TV).subMethod(MethodSub.ALT_TITLES).buildUrl(parameters); WrapperGener...
[ "public", "ResultList", "<", "AlternativeTitle", ">", "getTVAlternativeTitles", "(", "int", "tvID", ")", "throws", "MovieDbException", "{", "TmdbParameters", "parameters", "=", "new", "TmdbParameters", "(", ")", ";", "parameters", ".", "add", "(", "Param", ".", ...
Get the alternative titles for a specific show ID. @param tvID @return @throws com.omertron.themoviedbapi.MovieDbException
[ "Get", "the", "alternative", "titles", "for", "a", "specific", "show", "ID", "." ]
bf132d7c7271734e13b58ba3bc92bba46f220118
https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/methods/TmdbTV.java#L130-L137
train
Omertron/api-themoviedb
src/main/java/com/omertron/themoviedbapi/methods/TmdbTV.java
TmdbTV.getTVChanges
public ResultList<ChangeKeyItem> getTVChanges(int tvID, String startDate, String endDate) throws MovieDbException { return getMediaChanges(tvID, startDate, endDate); }
java
public ResultList<ChangeKeyItem> getTVChanges(int tvID, String startDate, String endDate) throws MovieDbException { return getMediaChanges(tvID, startDate, endDate); }
[ "public", "ResultList", "<", "ChangeKeyItem", ">", "getTVChanges", "(", "int", "tvID", ",", "String", "startDate", ",", "String", "endDate", ")", "throws", "MovieDbException", "{", "return", "getMediaChanges", "(", "tvID", ",", "startDate", ",", "endDate", ")", ...
Get the changes for a specific TV show id. @param tvID @param startDate @param endDate @return @throws com.omertron.themoviedbapi.MovieDbException
[ "Get", "the", "changes", "for", "a", "specific", "TV", "show", "id", "." ]
bf132d7c7271734e13b58ba3bc92bba46f220118
https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/methods/TmdbTV.java#L148-L150
train
Omertron/api-themoviedb
src/main/java/com/omertron/themoviedbapi/methods/TmdbTV.java
TmdbTV.getTVContentRatings
public ResultList<ContentRating> getTVContentRatings(int tvID) throws MovieDbException { TmdbParameters parameters = new TmdbParameters(); parameters.add(Param.ID, tvID); URL url = new ApiUrl(apiKey, MethodBase.TV).subMethod(MethodSub.CONTENT_RATINGS).buildUrl(parameters); WrapperGeneri...
java
public ResultList<ContentRating> getTVContentRatings(int tvID) throws MovieDbException { TmdbParameters parameters = new TmdbParameters(); parameters.add(Param.ID, tvID); URL url = new ApiUrl(apiKey, MethodBase.TV).subMethod(MethodSub.CONTENT_RATINGS).buildUrl(parameters); WrapperGeneri...
[ "public", "ResultList", "<", "ContentRating", ">", "getTVContentRatings", "(", "int", "tvID", ")", "throws", "MovieDbException", "{", "TmdbParameters", "parameters", "=", "new", "TmdbParameters", "(", ")", ";", "parameters", ".", "add", "(", "Param", ".", "ID", ...
Get the content ratings for a specific TV show id. @param tvID @return @throws com.omertron.themoviedbapi.MovieDbException
[ "Get", "the", "content", "ratings", "for", "a", "specific", "TV", "show", "id", "." ]
bf132d7c7271734e13b58ba3bc92bba46f220118
https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/methods/TmdbTV.java#L159-L166
train
Omertron/api-themoviedb
src/main/java/com/omertron/themoviedbapi/methods/TmdbTV.java
TmdbTV.getTVKeywords
public ResultList<Keyword> getTVKeywords(int tvID) throws MovieDbException { TmdbParameters parameters = new TmdbParameters(); parameters.add(Param.ID, tvID); URL url = new ApiUrl(apiKey, MethodBase.TV).subMethod(MethodSub.KEYWORDS).buildUrl(parameters); WrapperGenericList<Keyword> wrap...
java
public ResultList<Keyword> getTVKeywords(int tvID) throws MovieDbException { TmdbParameters parameters = new TmdbParameters(); parameters.add(Param.ID, tvID); URL url = new ApiUrl(apiKey, MethodBase.TV).subMethod(MethodSub.KEYWORDS).buildUrl(parameters); WrapperGenericList<Keyword> wrap...
[ "public", "ResultList", "<", "Keyword", ">", "getTVKeywords", "(", "int", "tvID", ")", "throws", "MovieDbException", "{", "TmdbParameters", "parameters", "=", "new", "TmdbParameters", "(", ")", ";", "parameters", ".", "add", "(", "Param", ".", "ID", ",", "tv...
Get the plot keywords for a specific TV show id. @param tvID @return @throws com.omertron.themoviedbapi.MovieDbException
[ "Get", "the", "plot", "keywords", "for", "a", "specific", "TV", "show", "id", "." ]
bf132d7c7271734e13b58ba3bc92bba46f220118
https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/methods/TmdbTV.java#L248-L255
train
rtoshiro/FullscreenVideoView
fullscreenvideoview/src/main/java/com/github/rtoshiro/view/video/FullscreenVideoView.java
FullscreenVideoView.init
protected void init() { Log.d(TAG, "init"); if (isInEditMode()) return; this.mediaPlayer = null; this.shouldAutoplay = false; this.fullscreen = false; this.initialConfigOrientation = -1; this.videoIsReady = false; this.surfaceIsReady = false;...
java
protected void init() { Log.d(TAG, "init"); if (isInEditMode()) return; this.mediaPlayer = null; this.shouldAutoplay = false; this.fullscreen = false; this.initialConfigOrientation = -1; this.videoIsReady = false; this.surfaceIsReady = false;...
[ "protected", "void", "init", "(", ")", "{", "Log", ".", "d", "(", "TAG", ",", "\"init\"", ")", ";", "if", "(", "isInEditMode", "(", ")", ")", "return", ";", "this", ".", "mediaPlayer", "=", "null", ";", "this", ".", "shouldAutoplay", "=", "false", ...
Initializes the default configuration
[ "Initializes", "the", "default", "configuration" ]
5af645832ab0eb179679536af079be49abc6205e
https://github.com/rtoshiro/FullscreenVideoView/blob/5af645832ab0eb179679536af079be49abc6205e/fullscreenvideoview/src/main/java/com/github/rtoshiro/view/video/FullscreenVideoView.java#L372-L389
train
rtoshiro/FullscreenVideoView
fullscreenvideoview/src/main/java/com/github/rtoshiro/view/video/FullscreenVideoView.java
FullscreenVideoView.release
protected void release() { Log.d(TAG, "release"); releaseObjects(); if (this.mediaPlayer != null) { this.mediaPlayer.setOnBufferingUpdateListener(null); this.mediaPlayer.setOnPreparedListener(null); this.mediaPlayer.setOnErrorListener(null); this....
java
protected void release() { Log.d(TAG, "release"); releaseObjects(); if (this.mediaPlayer != null) { this.mediaPlayer.setOnBufferingUpdateListener(null); this.mediaPlayer.setOnPreparedListener(null); this.mediaPlayer.setOnErrorListener(null); this....
[ "protected", "void", "release", "(", ")", "{", "Log", ".", "d", "(", "TAG", ",", "\"release\"", ")", ";", "releaseObjects", "(", ")", ";", "if", "(", "this", ".", "mediaPlayer", "!=", "null", ")", "{", "this", ".", "mediaPlayer", ".", "setOnBufferingUp...
Releases and ends the current Object
[ "Releases", "and", "ends", "the", "current", "Object" ]
5af645832ab0eb179679536af079be49abc6205e
https://github.com/rtoshiro/FullscreenVideoView/blob/5af645832ab0eb179679536af079be49abc6205e/fullscreenvideoview/src/main/java/com/github/rtoshiro/view/video/FullscreenVideoView.java#L394-L411
train
rtoshiro/FullscreenVideoView
fullscreenvideoview/src/main/java/com/github/rtoshiro/view/video/FullscreenVideoView.java
FullscreenVideoView.initObjects
protected void initObjects() { Log.d(TAG, "initObjects"); if (this.mediaPlayer == null) { this.mediaPlayer = new MediaPlayer(); this.mediaPlayer.setOnInfoListener(this); this.mediaPlayer.setOnErrorListener(this); this.mediaPlayer.setOnPreparedListener(thi...
java
protected void initObjects() { Log.d(TAG, "initObjects"); if (this.mediaPlayer == null) { this.mediaPlayer = new MediaPlayer(); this.mediaPlayer.setOnInfoListener(this); this.mediaPlayer.setOnErrorListener(this); this.mediaPlayer.setOnPreparedListener(thi...
[ "protected", "void", "initObjects", "(", ")", "{", "Log", ".", "d", "(", "TAG", ",", "\"initObjects\"", ")", ";", "if", "(", "this", ".", "mediaPlayer", "==", "null", ")", "{", "this", ".", "mediaPlayer", "=", "new", "MediaPlayer", "(", ")", ";", "th...
Initializes all objects FullscreenVideoView depends on It does not interfere with configuration properties because it is supposed to be called when this Object still exists
[ "Initializes", "all", "objects", "FullscreenVideoView", "depends", "on", "It", "does", "not", "interfere", "with", "configuration", "properties", "because", "it", "is", "supposed", "to", "be", "called", "when", "this", "Object", "still", "exists" ]
5af645832ab0eb179679536af079be49abc6205e
https://github.com/rtoshiro/FullscreenVideoView/blob/5af645832ab0eb179679536af079be49abc6205e/fullscreenvideoview/src/main/java/com/github/rtoshiro/view/video/FullscreenVideoView.java#L419-L474
train
rtoshiro/FullscreenVideoView
fullscreenvideoview/src/main/java/com/github/rtoshiro/view/video/FullscreenVideoView.java
FullscreenVideoView.releaseObjects
protected void releaseObjects() { Log.d(TAG, "releaseObjects"); if (this.mediaPlayer != null) { this.mediaPlayer.setSurface(null); this.mediaPlayer.reset(); } this.videoIsReady = false; this.surfaceIsReady = false; this.initialMovieHeight = -1; ...
java
protected void releaseObjects() { Log.d(TAG, "releaseObjects"); if (this.mediaPlayer != null) { this.mediaPlayer.setSurface(null); this.mediaPlayer.reset(); } this.videoIsReady = false; this.surfaceIsReady = false; this.initialMovieHeight = -1; ...
[ "protected", "void", "releaseObjects", "(", ")", "{", "Log", ".", "d", "(", "TAG", ",", "\"releaseObjects\"", ")", ";", "if", "(", "this", ".", "mediaPlayer", "!=", "null", ")", "{", "this", ".", "mediaPlayer", ".", "setSurface", "(", "null", ")", ";",...
Releases all objects FullscreenVideoView depends on It does not interfere with configuration properties because it is supposed to be called when this Object still exists
[ "Releases", "all", "objects", "FullscreenVideoView", "depends", "on", "It", "does", "not", "interfere", "with", "configuration", "properties", "because", "it", "is", "supposed", "to", "be", "called", "when", "this", "Object", "still", "exists" ]
5af645832ab0eb179679536af079be49abc6205e
https://github.com/rtoshiro/FullscreenVideoView/blob/5af645832ab0eb179679536af079be49abc6205e/fullscreenvideoview/src/main/java/com/github/rtoshiro/view/video/FullscreenVideoView.java#L482-L514
train
rtoshiro/FullscreenVideoView
fullscreenvideoview/src/main/java/com/github/rtoshiro/view/video/FullscreenVideoView.java
FullscreenVideoView.tryToPrepare
protected void tryToPrepare() { Log.d(TAG, "tryToPrepare"); if (this.surfaceIsReady && this.videoIsReady) { if (this.mediaPlayer != null && this.mediaPlayer.getVideoWidth() != 0 && this.mediaPlayer.getVideoHeight() != 0) { this.initialM...
java
protected void tryToPrepare() { Log.d(TAG, "tryToPrepare"); if (this.surfaceIsReady && this.videoIsReady) { if (this.mediaPlayer != null && this.mediaPlayer.getVideoWidth() != 0 && this.mediaPlayer.getVideoHeight() != 0) { this.initialM...
[ "protected", "void", "tryToPrepare", "(", ")", "{", "Log", ".", "d", "(", "TAG", ",", "\"tryToPrepare\"", ")", ";", "if", "(", "this", ".", "surfaceIsReady", "&&", "this", ".", "videoIsReady", ")", "{", "if", "(", "this", ".", "mediaPlayer", "!=", "nul...
Try to call state PREPARED Only if SurfaceView is already created and MediaPlayer is prepared Video is loaded and is ok to play.
[ "Try", "to", "call", "state", "PREPARED", "Only", "if", "SurfaceView", "is", "already", "created", "and", "MediaPlayer", "is", "prepared", "Video", "is", "loaded", "and", "is", "ok", "to", "play", "." ]
5af645832ab0eb179679536af079be49abc6205e
https://github.com/rtoshiro/FullscreenVideoView/blob/5af645832ab0eb179679536af079be49abc6205e/fullscreenvideoview/src/main/java/com/github/rtoshiro/view/video/FullscreenVideoView.java#L533-L553
train
rtoshiro/FullscreenVideoView
fullscreenvideoview/src/main/java/com/github/rtoshiro/view/video/FullscreenVideoView.java
FullscreenVideoView.setFullscreen
public void setFullscreen(final boolean fullscreen) throws RuntimeException { if (mediaPlayer == null) throw new RuntimeException("Media Player is not initialized"); if (this.currentState != State.ERROR) { if (FullscreenVideoView.this.fullscreen == fullscreen) return; ...
java
public void setFullscreen(final boolean fullscreen) throws RuntimeException { if (mediaPlayer == null) throw new RuntimeException("Media Player is not initialized"); if (this.currentState != State.ERROR) { if (FullscreenVideoView.this.fullscreen == fullscreen) return; ...
[ "public", "void", "setFullscreen", "(", "final", "boolean", "fullscreen", ")", "throws", "RuntimeException", "{", "if", "(", "mediaPlayer", "==", "null", ")", "throw", "new", "RuntimeException", "(", "\"Media Player is not initialized\"", ")", ";", "if", "(", "thi...
Turn VideoView fulllscreen mode on or off. @param fullscreen true to turn on fullscreen mode or false to turn off @throws RuntimeException In case of mediaPlayer doesn't exist or illegal state exception @since 1.1
[ "Turn", "VideoView", "fulllscreen", "mode", "on", "or", "off", "." ]
5af645832ab0eb179679536af079be49abc6205e
https://github.com/rtoshiro/FullscreenVideoView/blob/5af645832ab0eb179679536af079be49abc6205e/fullscreenvideoview/src/main/java/com/github/rtoshiro/view/video/FullscreenVideoView.java#L591-L661
train
rtoshiro/FullscreenVideoView
fullscreenvideoview/src/main/java/com/github/rtoshiro/view/video/FullscreenVideoLayout.java
FullscreenVideoLayout.onClick
@Override public void onClick(View v) { if (v.getId() == R.id.vcv_img_play) { if (isPlaying()) { pause(); } else { start(); } } else { setFullscreen(!isFullscreen()); } }
java
@Override public void onClick(View v) { if (v.getId() == R.id.vcv_img_play) { if (isPlaying()) { pause(); } else { start(); } } else { setFullscreen(!isFullscreen()); } }
[ "@", "Override", "public", "void", "onClick", "(", "View", "v", ")", "{", "if", "(", "v", ".", "getId", "(", ")", "==", "R", ".", "id", ".", "vcv_img_play", ")", "{", "if", "(", "isPlaying", "(", ")", ")", "{", "pause", "(", ")", ";", "}", "e...
Onclick action Controls play button and fullscreen button. @param v View defined in XML
[ "Onclick", "action", "Controls", "play", "button", "and", "fullscreen", "button", "." ]
5af645832ab0eb179679536af079be49abc6205e
https://github.com/rtoshiro/FullscreenVideoView/blob/5af645832ab0eb179679536af079be49abc6205e/fullscreenvideoview/src/main/java/com/github/rtoshiro/view/video/FullscreenVideoLayout.java#L330-L341
train
ragnor/simple-spring-memcached
simple-spring-memcached/src/main/java/com/google/code/ssm/aop/support/builder/AbstractDataBuilder.java
AbstractDataBuilder.populate
public void populate(final AnnotationData data, final Annotation annotation, final Class<? extends Annotation> expectedAnnotationClass, final Method targetMethod) throws Exception { if (support(expectedAnnotationClass)) { build(data, annotation, expectedAnnotationClass, targetMethod); ...
java
public void populate(final AnnotationData data, final Annotation annotation, final Class<? extends Annotation> expectedAnnotationClass, final Method targetMethod) throws Exception { if (support(expectedAnnotationClass)) { build(data, annotation, expectedAnnotationClass, targetMethod); ...
[ "public", "void", "populate", "(", "final", "AnnotationData", "data", ",", "final", "Annotation", "annotation", ",", "final", "Class", "<", "?", "extends", "Annotation", ">", "expectedAnnotationClass", ",", "final", "Method", "targetMethod", ")", "throws", "Except...
Populates additional data into annotation data. @param data the annotation data to fill in @param annotation the cache annotation @param expectedAnnotationClass the expected class of cache annotation @param targetMethod the intercepted (cached) method @throws Exception
[ "Populates", "additional", "data", "into", "annotation", "data", "." ]
83db68aa1af219397e132426e377d45f397d31e7
https://github.com/ragnor/simple-spring-memcached/blob/83db68aa1af219397e132426e377d45f397d31e7/simple-spring-memcached/src/main/java/com/google/code/ssm/aop/support/builder/AbstractDataBuilder.java#L50-L55
train
ragnor/simple-spring-memcached
simple-spring-memcached/src/main/java/com/google/code/ssm/CacheFactory.java
CacheFactory.createCache
protected Cache createCache() throws IOException { // this factory creates only one single cache and return it if someone invoked this method twice or // more if (cache != null) { throw new IllegalStateException(String.format("This factory has already created memcached client for cac...
java
protected Cache createCache() throws IOException { // this factory creates only one single cache and return it if someone invoked this method twice or // more if (cache != null) { throw new IllegalStateException(String.format("This factory has already created memcached client for cac...
[ "protected", "Cache", "createCache", "(", ")", "throws", "IOException", "{", "// this factory creates only one single cache and return it if someone invoked this method twice or", "// more", "if", "(", "cache", "!=", "null", ")", "{", "throw", "new", "IllegalStateException", ...
Only one cache is created. @return cache @throws IOException
[ "Only", "one", "cache", "is", "created", "." ]
83db68aa1af219397e132426e377d45f397d31e7
https://github.com/ragnor/simple-spring-memcached/blob/83db68aa1af219397e132426e377d45f397d31e7/simple-spring-memcached/src/main/java/com/google/code/ssm/CacheFactory.java#L182-L205
train
ragnor/simple-spring-memcached
simple-spring-memcached/src/main/java/com/google/code/ssm/aop/support/CacheKeyBuilderImpl.java
CacheKeyBuilderImpl.getCacheKey
@Override public String getCacheKey(final Object keyObject, final String namespace) { return namespace + SEPARATOR + defaultKeyProvider.generateKey(keyObject); }
java
@Override public String getCacheKey(final Object keyObject, final String namespace) { return namespace + SEPARATOR + defaultKeyProvider.generateKey(keyObject); }
[ "@", "Override", "public", "String", "getCacheKey", "(", "final", "Object", "keyObject", ",", "final", "String", "namespace", ")", "{", "return", "namespace", "+", "SEPARATOR", "+", "defaultKeyProvider", ".", "generateKey", "(", "keyObject", ")", ";", "}" ]
Builds cache key from one key object. @param keyObject @param namespace @return cache key (with namespace)
[ "Builds", "cache", "key", "from", "one", "key", "object", "." ]
83db68aa1af219397e132426e377d45f397d31e7
https://github.com/ragnor/simple-spring-memcached/blob/83db68aa1af219397e132426e377d45f397d31e7/simple-spring-memcached/src/main/java/com/google/code/ssm/aop/support/CacheKeyBuilderImpl.java#L61-L64
train
ragnor/simple-spring-memcached
simple-spring-memcached/src/main/java/com/google/code/ssm/aop/support/CacheKeyBuilderImpl.java
CacheKeyBuilderImpl.buildCacheKey
private String buildCacheKey(final String[] objectIds, final String namespace) { if (objectIds.length == 1) { checkKeyPart(objectIds[0]); return namespace + SEPARATOR + objectIds[0]; } StringBuilder cacheKey = new StringBuilder(namespace); cacheKey.append(SEPARAT...
java
private String buildCacheKey(final String[] objectIds, final String namespace) { if (objectIds.length == 1) { checkKeyPart(objectIds[0]); return namespace + SEPARATOR + objectIds[0]; } StringBuilder cacheKey = new StringBuilder(namespace); cacheKey.append(SEPARAT...
[ "private", "String", "buildCacheKey", "(", "final", "String", "[", "]", "objectIds", ",", "final", "String", "namespace", ")", "{", "if", "(", "objectIds", ".", "length", "==", "1", ")", "{", "checkKeyPart", "(", "objectIds", "[", "0", "]", ")", ";", "...
Build cache key. @param objectIds @param namespace @return
[ "Build", "cache", "key", "." ]
83db68aa1af219397e132426e377d45f397d31e7
https://github.com/ragnor/simple-spring-memcached/blob/83db68aa1af219397e132426e377d45f397d31e7/simple-spring-memcached/src/main/java/com/google/code/ssm/aop/support/CacheKeyBuilderImpl.java#L123-L139
train
ragnor/simple-spring-memcached
spring-cache/src/main/java/com/google/code/ssm/spring/SSMCacheManager.java
SSMCacheManager.removeCache
public void removeCache(final String nameOrAlias) { final Cache cache = cacheMap.get(nameOrAlias); if (cache == null) { return; } final SSMCache ssmCache = (SSMCache) cache; if (ssmCache.isRegisterAliases()) { ssmCache.getCache().getAliases().forE...
java
public void removeCache(final String nameOrAlias) { final Cache cache = cacheMap.get(nameOrAlias); if (cache == null) { return; } final SSMCache ssmCache = (SSMCache) cache; if (ssmCache.isRegisterAliases()) { ssmCache.getCache().getAliases().forE...
[ "public", "void", "removeCache", "(", "final", "String", "nameOrAlias", ")", "{", "final", "Cache", "cache", "=", "cacheMap", ".", "get", "(", "nameOrAlias", ")", ";", "if", "(", "cache", "==", "null", ")", "{", "return", ";", "}", "final", "SSMCache", ...
Removes given cache and related aliases. @param name the name or alias of a cache @since 4.1.0
[ "Removes", "given", "cache", "and", "related", "aliases", "." ]
83db68aa1af219397e132426e377d45f397d31e7
https://github.com/ragnor/simple-spring-memcached/blob/83db68aa1af219397e132426e377d45f397d31e7/spring-cache/src/main/java/com/google/code/ssm/spring/SSMCacheManager.java#L107-L121
train
ragnor/simple-spring-memcached
simple-spring-memcached/src/main/java/com/google/code/ssm/transcoders/JavaTranscoder.java
JavaTranscoder.deserialize
protected Object deserialize(final byte[] in) { Object o = null; ByteArrayInputStream bis = null; ConfigurableObjectInputStream is = null; try { if (in != null) { bis = new ByteArrayInputStream(in); is = new ConfigurableObjectInputStream(bis, ...
java
protected Object deserialize(final byte[] in) { Object o = null; ByteArrayInputStream bis = null; ConfigurableObjectInputStream is = null; try { if (in != null) { bis = new ByteArrayInputStream(in); is = new ConfigurableObjectInputStream(bis, ...
[ "protected", "Object", "deserialize", "(", "final", "byte", "[", "]", "in", ")", "{", "Object", "o", "=", "null", ";", "ByteArrayInputStream", "bis", "=", "null", ";", "ConfigurableObjectInputStream", "is", "=", "null", ";", "try", "{", "if", "(", "in", ...
Deserialize given stream using java deserialization. @param in data to deserialize @return deserialized object
[ "Deserialize", "given", "stream", "using", "java", "deserialization", "." ]
83db68aa1af219397e132426e377d45f397d31e7
https://github.com/ragnor/simple-spring-memcached/blob/83db68aa1af219397e132426e377d45f397d31e7/simple-spring-memcached/src/main/java/com/google/code/ssm/transcoders/JavaTranscoder.java#L146-L169
train
ragnor/simple-spring-memcached
spring-cache/src/main/java/com/google/code/ssm/spring/SSMCache.java
SSMCache.get
@Override @SuppressWarnings("unchecked") public <T> T get(final Object key, final Class<T> type) { if (!cache.isEnabled()) { LOGGER.warn("Cache {} is disabled. Cannot get {} from cache", cache.getName(), key); return null; } Object value = getValue(key); ...
java
@Override @SuppressWarnings("unchecked") public <T> T get(final Object key, final Class<T> type) { if (!cache.isEnabled()) { LOGGER.warn("Cache {} is disabled. Cannot get {} from cache", cache.getName(), key); return null; } Object value = getValue(key); ...
[ "@", "Override", "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "<", "T", ">", "T", "get", "(", "final", "Object", "key", ",", "final", "Class", "<", "T", ">", "type", ")", "{", "if", "(", "!", "cache", ".", "isEnabled", "(", ")", ")...
Required by Spring 4.0 @since 3.4.0
[ "Required", "by", "Spring", "4", ".", "0" ]
83db68aa1af219397e132426e377d45f397d31e7
https://github.com/ragnor/simple-spring-memcached/blob/83db68aa1af219397e132426e377d45f397d31e7/spring-cache/src/main/java/com/google/code/ssm/spring/SSMCache.java#L132-L160
train
ragnor/simple-spring-memcached
spring-cache/src/main/java/com/google/code/ssm/spring/SSMCache.java
SSMCache.get
@Override @SuppressWarnings("unchecked") public <T> T get(final Object key, final Callable<T> valueLoader) { if (!cache.isEnabled()) { LOGGER.warn("Cache {} is disabled. Cannot get {} from cache", cache.getName(), key); return loadValue(key, valueLoader); } final ...
java
@Override @SuppressWarnings("unchecked") public <T> T get(final Object key, final Callable<T> valueLoader) { if (!cache.isEnabled()) { LOGGER.warn("Cache {} is disabled. Cannot get {} from cache", cache.getName(), key); return loadValue(key, valueLoader); } final ...
[ "@", "Override", "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "<", "T", ">", "T", "get", "(", "final", "Object", "key", ",", "final", "Callable", "<", "T", ">", "valueLoader", ")", "{", "if", "(", "!", "cache", ".", "isEnabled", "(", ...
Required by Spring 4.3 @since 3.6.1
[ "Required", "by", "Spring", "4", ".", "3" ]
83db68aa1af219397e132426e377d45f397d31e7
https://github.com/ragnor/simple-spring-memcached/blob/83db68aa1af219397e132426e377d45f397d31e7/spring-cache/src/main/java/com/google/code/ssm/spring/SSMCache.java#L167-L183
train
ragnor/simple-spring-memcached
spring-cache/src/main/java/com/google/code/ssm/spring/SSMCache.java
SSMCache.putIfAbsent
@Override public ValueWrapper putIfAbsent(final Object key, final Object value) { if (!cache.isEnabled()) { LOGGER.warn("Cache {} is disabled. Cannot put value under key {}", cache.getName(), key); return null; } if (key != null) { final String cacheKey =...
java
@Override public ValueWrapper putIfAbsent(final Object key, final Object value) { if (!cache.isEnabled()) { LOGGER.warn("Cache {} is disabled. Cannot put value under key {}", cache.getName(), key); return null; } if (key != null) { final String cacheKey =...
[ "@", "Override", "public", "ValueWrapper", "putIfAbsent", "(", "final", "Object", "key", ",", "final", "Object", "value", ")", "{", "if", "(", "!", "cache", ".", "isEnabled", "(", ")", ")", "{", "LOGGER", ".", "warn", "(", "\"Cache {} is disabled. Cannot put...
Required by Spring 4.1 @since 3.6.0
[ "Required", "by", "Spring", "4", ".", "1" ]
83db68aa1af219397e132426e377d45f397d31e7
https://github.com/ragnor/simple-spring-memcached/blob/83db68aa1af219397e132426e377d45f397d31e7/spring-cache/src/main/java/com/google/code/ssm/spring/SSMCache.java#L212-L235
train
EclairJS/eclairjs-nashorn
src/main/java/org/eclairjs/nashorn/Utils.java
Utils.toScalaSeq
@SuppressWarnings({ "rawtypes", "unchecked" }) public static Seq toScalaSeq(Object[] o) { ArrayList list = new ArrayList(); for (int i = 0; i < o.length; i++) { list.add(o[i]); } return scala.collection.JavaConversions.asScalaBuffer(list).toList(); }
java
@SuppressWarnings({ "rawtypes", "unchecked" }) public static Seq toScalaSeq(Object[] o) { ArrayList list = new ArrayList(); for (int i = 0; i < o.length; i++) { list.add(o[i]); } return scala.collection.JavaConversions.asScalaBuffer(list).toList(); }
[ "@", "SuppressWarnings", "(", "{", "\"rawtypes\"", ",", "\"unchecked\"", "}", ")", "public", "static", "Seq", "toScalaSeq", "(", "Object", "[", "]", "o", ")", "{", "ArrayList", "list", "=", "new", "ArrayList", "(", ")", ";", "for", "(", "int", "i", "="...
Takes an array of objects and returns a scala Seq @param o {Object[]} @return scala.collection.Seq
[ "Takes", "an", "array", "of", "objects", "and", "returns", "a", "scala", "Seq" ]
6723b80d5a7b0c97fd72eb1bcd5c0fa46b493080
https://github.com/EclairJS/eclairjs-nashorn/blob/6723b80d5a7b0c97fd72eb1bcd5c0fa46b493080/src/main/java/org/eclairjs/nashorn/Utils.java#L403-L411
train
sshtools/j2ssh-maverick
j2ssh-maverick/src/main/java/com/sshtools/util/UnsignedInteger64.java
UnsignedInteger64.add
public static UnsignedInteger64 add(UnsignedInteger64 x, UnsignedInteger64 y) { return new UnsignedInteger64(x.bigInt.add(y.bigInt)); }
java
public static UnsignedInteger64 add(UnsignedInteger64 x, UnsignedInteger64 y) { return new UnsignedInteger64(x.bigInt.add(y.bigInt)); }
[ "public", "static", "UnsignedInteger64", "add", "(", "UnsignedInteger64", "x", ",", "UnsignedInteger64", "y", ")", "{", "return", "new", "UnsignedInteger64", "(", "x", ".", "bigInt", ".", "add", "(", "y", ".", "bigInt", ")", ")", ";", "}" ]
Add an unsigned integer to another unsigned integer. @param x @param y @return
[ "Add", "an", "unsigned", "integer", "to", "another", "unsigned", "integer", "." ]
ce11ceaf0aa0b129b54327a6891973e1e34689f7
https://github.com/sshtools/j2ssh-maverick/blob/ce11ceaf0aa0b129b54327a6891973e1e34689f7/j2ssh-maverick/src/main/java/com/sshtools/util/UnsignedInteger64.java#L158-L160
train
sshtools/j2ssh-maverick
j2ssh-maverick/src/main/java/com/sshtools/util/UnsignedInteger64.java
UnsignedInteger64.add
public static UnsignedInteger64 add(UnsignedInteger64 x, int y) { return new UnsignedInteger64(x.bigInt.add(BigInteger.valueOf(y))); }
java
public static UnsignedInteger64 add(UnsignedInteger64 x, int y) { return new UnsignedInteger64(x.bigInt.add(BigInteger.valueOf(y))); }
[ "public", "static", "UnsignedInteger64", "add", "(", "UnsignedInteger64", "x", ",", "int", "y", ")", "{", "return", "new", "UnsignedInteger64", "(", "x", ".", "bigInt", ".", "add", "(", "BigInteger", ".", "valueOf", "(", "y", ")", ")", ")", ";", "}" ]
Add an unsigned integer to an int. @param x @param y @return
[ "Add", "an", "unsigned", "integer", "to", "an", "int", "." ]
ce11ceaf0aa0b129b54327a6891973e1e34689f7
https://github.com/sshtools/j2ssh-maverick/blob/ce11ceaf0aa0b129b54327a6891973e1e34689f7/j2ssh-maverick/src/main/java/com/sshtools/util/UnsignedInteger64.java#L170-L172
train
sshtools/j2ssh-maverick
j2ssh-maverick/src/main/java/com/sshtools/util/UnsignedInteger64.java
UnsignedInteger64.toByteArray
public byte[] toByteArray() { byte[] raw = new byte[8]; byte[] bi = bigIntValue().toByteArray(); System.arraycopy(bi, 0, raw, raw.length - bi.length, bi.length); return raw; }
java
public byte[] toByteArray() { byte[] raw = new byte[8]; byte[] bi = bigIntValue().toByteArray(); System.arraycopy(bi, 0, raw, raw.length - bi.length, bi.length); return raw; }
[ "public", "byte", "[", "]", "toByteArray", "(", ")", "{", "byte", "[", "]", "raw", "=", "new", "byte", "[", "8", "]", ";", "byte", "[", "]", "bi", "=", "bigIntValue", "(", ")", ".", "toByteArray", "(", ")", ";", "System", ".", "arraycopy", "(", ...
Returns a byte array encoded with the unsigned integer. @return
[ "Returns", "a", "byte", "array", "encoded", "with", "the", "unsigned", "integer", "." ]
ce11ceaf0aa0b129b54327a6891973e1e34689f7
https://github.com/sshtools/j2ssh-maverick/blob/ce11ceaf0aa0b129b54327a6891973e1e34689f7/j2ssh-maverick/src/main/java/com/sshtools/util/UnsignedInteger64.java#L179-L184
train
sshtools/j2ssh-maverick
j2ssh-maverick/src/main/java/com/sshtools/publickey/PublicKeySubsystem.java
PublicKeySubsystem.remove
public void remove(SshPublicKey key) throws SshException, PublicKeySubsystemException { try { Packet msg = createPacket(); msg.writeString("remove"); msg.writeString(key.getAlgorithm()); msg.writeBinaryString(key.getEncoded()); sendMessage(msg); readStatusResponse(); } catch (IOException e...
java
public void remove(SshPublicKey key) throws SshException, PublicKeySubsystemException { try { Packet msg = createPacket(); msg.writeString("remove"); msg.writeString(key.getAlgorithm()); msg.writeBinaryString(key.getEncoded()); sendMessage(msg); readStatusResponse(); } catch (IOException e...
[ "public", "void", "remove", "(", "SshPublicKey", "key", ")", "throws", "SshException", ",", "PublicKeySubsystemException", "{", "try", "{", "Packet", "msg", "=", "createPacket", "(", ")", ";", "msg", ".", "writeString", "(", "\"remove\"", ")", ";", "msg", "....
Remove a public key from the users list of acceptable keys. @param key @throws SshException @throws PublicKeyStatusException
[ "Remove", "a", "public", "key", "from", "the", "users", "list", "of", "acceptable", "keys", "." ]
ce11ceaf0aa0b129b54327a6891973e1e34689f7
https://github.com/sshtools/j2ssh-maverick/blob/ce11ceaf0aa0b129b54327a6891973e1e34689f7/j2ssh-maverick/src/main/java/com/sshtools/publickey/PublicKeySubsystem.java#L126-L143
train
sshtools/j2ssh-maverick
j2ssh-maverick/src/main/java/com/sshtools/publickey/PublicKeySubsystem.java
PublicKeySubsystem.list
public SshPublicKey[] list() throws SshException, PublicKeySubsystemException { try { Packet msg = createPacket(); msg.writeString("list"); sendMessage(msg); Vector<SshPublicKey> keys = new Vector<SshPublicKey>(); while (true) { ByteArrayReader response = new ByteArrayReader(nextMessage());...
java
public SshPublicKey[] list() throws SshException, PublicKeySubsystemException { try { Packet msg = createPacket(); msg.writeString("list"); sendMessage(msg); Vector<SshPublicKey> keys = new Vector<SshPublicKey>(); while (true) { ByteArrayReader response = new ByteArrayReader(nextMessage());...
[ "public", "SshPublicKey", "[", "]", "list", "(", ")", "throws", "SshException", ",", "PublicKeySubsystemException", "{", "try", "{", "Packet", "msg", "=", "createPacket", "(", ")", ";", "msg", ".", "writeString", "(", "\"list\"", ")", ";", "sendMessage", "("...
List all of the users acceptable keys. @return SshPublicKey[]
[ "List", "all", "of", "the", "users", "acceptable", "keys", "." ]
ce11ceaf0aa0b129b54327a6891973e1e34689f7
https://github.com/sshtools/j2ssh-maverick/blob/ce11ceaf0aa0b129b54327a6891973e1e34689f7/j2ssh-maverick/src/main/java/com/sshtools/publickey/PublicKeySubsystem.java#L150-L204
train
sshtools/j2ssh-maverick
j2ssh-maverick/src/main/java/com/sshtools/publickey/PublicKeySubsystem.java
PublicKeySubsystem.associateCommand
public void associateCommand(SshPublicKey key, String command) throws SshException, PublicKeySubsystemException { try { Packet msg = createPacket(); msg.writeString("command"); msg.writeString(key.getAlgorithm()); msg.writeBinaryString(key.getEncoded()); msg.writeString(command); sendMessage(m...
java
public void associateCommand(SshPublicKey key, String command) throws SshException, PublicKeySubsystemException { try { Packet msg = createPacket(); msg.writeString("command"); msg.writeString(key.getAlgorithm()); msg.writeBinaryString(key.getEncoded()); msg.writeString(command); sendMessage(m...
[ "public", "void", "associateCommand", "(", "SshPublicKey", "key", ",", "String", "command", ")", "throws", "SshException", ",", "PublicKeySubsystemException", "{", "try", "{", "Packet", "msg", "=", "createPacket", "(", ")", ";", "msg", ".", "writeString", "(", ...
Associate a command with an accepted public key. The request will fail if the public key is not currently in the users acceptable list. Also some server implementations may choose not to support this feature. @param key @param command @throws SshException @throws PublicKeyStatusException
[ "Associate", "a", "command", "with", "an", "accepted", "public", "key", ".", "The", "request", "will", "fail", "if", "the", "public", "key", "is", "not", "currently", "in", "the", "users", "acceptable", "list", ".", "Also", "some", "server", "implementations...
ce11ceaf0aa0b129b54327a6891973e1e34689f7
https://github.com/sshtools/j2ssh-maverick/blob/ce11ceaf0aa0b129b54327a6891973e1e34689f7/j2ssh-maverick/src/main/java/com/sshtools/publickey/PublicKeySubsystem.java#L216-L235
train
sshtools/j2ssh-maverick
j2ssh-maverick/src/main/java/com/sshtools/publickey/PublicKeySubsystem.java
PublicKeySubsystem.readStatusResponse
void readStatusResponse() throws SshException, PublicKeySubsystemException { ByteArrayReader msg = new ByteArrayReader(nextMessage()); try { msg.readString(); int status = (int) msg.readInt(); String desc = msg.readString(); if (status != PublicKeySubsystemException.SUCCESS) { throw new PublicKe...
java
void readStatusResponse() throws SshException, PublicKeySubsystemException { ByteArrayReader msg = new ByteArrayReader(nextMessage()); try { msg.readString(); int status = (int) msg.readInt(); String desc = msg.readString(); if (status != PublicKeySubsystemException.SUCCESS) { throw new PublicKe...
[ "void", "readStatusResponse", "(", ")", "throws", "SshException", ",", "PublicKeySubsystemException", "{", "ByteArrayReader", "msg", "=", "new", "ByteArrayReader", "(", "nextMessage", "(", ")", ")", ";", "try", "{", "msg", ".", "readString", "(", ")", ";", "in...
Read a status response and throw an exception if an error has occurred. @throws SshException @throws PublicKeyStatusException
[ "Read", "a", "status", "response", "and", "throw", "an", "exception", "if", "an", "error", "has", "occurred", "." ]
ce11ceaf0aa0b129b54327a6891973e1e34689f7
https://github.com/sshtools/j2ssh-maverick/blob/ce11ceaf0aa0b129b54327a6891973e1e34689f7/j2ssh-maverick/src/main/java/com/sshtools/publickey/PublicKeySubsystem.java#L243-L264
train
sshtools/j2ssh-maverick
j2ssh-maverick/src/main/java/com/sshtools/ssh/PseudoTerminalModes.java
PseudoTerminalModes.setTerminalMode
public void setTerminalMode(int mode, int value) throws SshException { try { encodedModes.write(mode); if (version == 1 && mode <= 127) { encodedModes.write(value); } else { encodedModes.writeInt(value); } } catch (IOException ex) { throw new SshException(SshException.INTERNAL_ERROR, ex); ...
java
public void setTerminalMode(int mode, int value) throws SshException { try { encodedModes.write(mode); if (version == 1 && mode <= 127) { encodedModes.write(value); } else { encodedModes.writeInt(value); } } catch (IOException ex) { throw new SshException(SshException.INTERNAL_ERROR, ex); ...
[ "public", "void", "setTerminalMode", "(", "int", "mode", ",", "int", "value", ")", "throws", "SshException", "{", "try", "{", "encodedModes", ".", "write", "(", "mode", ")", ";", "if", "(", "version", "==", "1", "&&", "mode", "<=", "127", ")", "{", "...
Set an integer value mode @param mode int @param value int @throws SshException
[ "Set", "an", "integer", "value", "mode" ]
ce11ceaf0aa0b129b54327a6891973e1e34689f7
https://github.com/sshtools/j2ssh-maverick/blob/ce11ceaf0aa0b129b54327a6891973e1e34689f7/j2ssh-maverick/src/main/java/com/sshtools/ssh/PseudoTerminalModes.java#L372-L386
train
sshtools/j2ssh-maverick
j2ssh-maverick/src/main/java/socks/Proxy.java
Proxy.exchange
protected ProxyMessage exchange(ProxyMessage request) throws SocksException{ ProxyMessage reply; try{ request.write(out); reply = formMessage(in); }catch(SocksException s_ex){ throw s_ex; }catch(IOException ioe){ throw(new SocksExcep...
java
protected ProxyMessage exchange(ProxyMessage request) throws SocksException{ ProxyMessage reply; try{ request.write(out); reply = formMessage(in); }catch(SocksException s_ex){ throw s_ex; }catch(IOException ioe){ throw(new SocksExcep...
[ "protected", "ProxyMessage", "exchange", "(", "ProxyMessage", "request", ")", "throws", "SocksException", "{", "ProxyMessage", "reply", ";", "try", "{", "request", ".", "write", "(", "out", ")", ";", "reply", "=", "formMessage", "(", "in", ")", ";", "}", "...
Sends the request reads reply and returns it throws exception if something wrong with IO or the reply code is not zero
[ "Sends", "the", "request", "reads", "reply", "and", "returns", "it", "throws", "exception", "if", "something", "wrong", "with", "IO", "or", "the", "reply", "code", "is", "not", "zero" ]
ce11ceaf0aa0b129b54327a6891973e1e34689f7
https://github.com/sshtools/j2ssh-maverick/blob/ce11ceaf0aa0b129b54327a6891973e1e34689f7/j2ssh-maverick/src/main/java/socks/Proxy.java#L471-L483
train
sshtools/j2ssh-maverick
j2ssh-maverick/src/main/java/com/sshtools/sftp/NoRegExpMatching.java
NoRegExpMatching.matchFileNamesWithPattern
public String[] matchFileNamesWithPattern(File[] files, String fileNameRegExp) throws SshException, SftpStatusException { String[] thefile = new String[1]; thefile[0] = files[0].getName(); return thefile; }
java
public String[] matchFileNamesWithPattern(File[] files, String fileNameRegExp) throws SshException, SftpStatusException { String[] thefile = new String[1]; thefile[0] = files[0].getName(); return thefile; }
[ "public", "String", "[", "]", "matchFileNamesWithPattern", "(", "File", "[", "]", "files", ",", "String", "fileNameRegExp", ")", "throws", "SshException", ",", "SftpStatusException", "{", "String", "[", "]", "thefile", "=", "new", "String", "[", "1", "]", ";...
opens and returns the requested filename string @throws SftpStatusException
[ "opens", "and", "returns", "the", "requested", "filename", "string" ]
ce11ceaf0aa0b129b54327a6891973e1e34689f7
https://github.com/sshtools/j2ssh-maverick/blob/ce11ceaf0aa0b129b54327a6891973e1e34689f7/j2ssh-maverick/src/main/java/com/sshtools/sftp/NoRegExpMatching.java#L42-L47
train
sshtools/j2ssh-maverick
j2ssh-maverick/src/main/java/com/sshtools/events/EventServiceImplementation.java
EventServiceImplementation.addListener
public synchronized void addListener(String threadPrefix, EventListener listener) { if (threadPrefix.trim().equals("")) { globalListeners.addElement(listener); } else { keyedListeners.put(threadPrefix.trim(), listener); } }
java
public synchronized void addListener(String threadPrefix, EventListener listener) { if (threadPrefix.trim().equals("")) { globalListeners.addElement(listener); } else { keyedListeners.put(threadPrefix.trim(), listener); } }
[ "public", "synchronized", "void", "addListener", "(", "String", "threadPrefix", ",", "EventListener", "listener", ")", "{", "if", "(", "threadPrefix", ".", "trim", "(", ")", ".", "equals", "(", "\"\"", ")", ")", "{", "globalListeners", ".", "addElement", "("...
Add a J2SSH Listener to the list of listeners that will be sent events @param threadPrefix listen to threads whose name have this prefix, string must not contain any '-' except the final character which must be a '-'. @param listener
[ "Add", "a", "J2SSH", "Listener", "to", "the", "list", "of", "listeners", "that", "will", "be", "sent", "events" ]
ce11ceaf0aa0b129b54327a6891973e1e34689f7
https://github.com/sshtools/j2ssh-maverick/blob/ce11ceaf0aa0b129b54327a6891973e1e34689f7/j2ssh-maverick/src/main/java/com/sshtools/events/EventServiceImplementation.java#L61-L68
train
sshtools/j2ssh-maverick
j2ssh-maverick/src/main/java/com/sshtools/events/EventServiceImplementation.java
EventServiceImplementation.fireEvent
public synchronized void fireEvent(Event evt) { if (evt == null) { return; } // Process global listeners for (Enumeration<EventListener> keys = globalListeners.elements(); keys .hasMoreElements();) { EventListener mListener = keys.nextElement(); try { mListener.processEvent(evt); } catch (T...
java
public synchronized void fireEvent(Event evt) { if (evt == null) { return; } // Process global listeners for (Enumeration<EventListener> keys = globalListeners.elements(); keys .hasMoreElements();) { EventListener mListener = keys.nextElement(); try { mListener.processEvent(evt); } catch (T...
[ "public", "synchronized", "void", "fireEvent", "(", "Event", "evt", ")", "{", "if", "(", "evt", "==", "null", ")", "{", "return", ";", "}", "// Process global listeners", "for", "(", "Enumeration", "<", "EventListener", ">", "keys", "=", "globalListeners", "...
Send an SSH Event to each registered listener
[ "Send", "an", "SSH", "Event", "to", "each", "registered", "listener" ]
ce11ceaf0aa0b129b54327a6891973e1e34689f7
https://github.com/sshtools/j2ssh-maverick/blob/ce11ceaf0aa0b129b54327a6891973e1e34689f7/j2ssh-maverick/src/main/java/com/sshtools/events/EventServiceImplementation.java#L80-L118
train
sshtools/j2ssh-maverick
j2ssh-maverick/src/main/java/com/sshtools/sftp/SftpFileOutputStream.java
SftpFileOutputStream.close
public void close() throws IOException { try { while (processNextResponse(0)) ; file.close(); } catch (SshException ex) { throw new SshIOException(ex); } catch (SftpStatusException ex) { throw new IOException(ex.getMessage()); } }
java
public void close() throws IOException { try { while (processNextResponse(0)) ; file.close(); } catch (SshException ex) { throw new SshIOException(ex); } catch (SftpStatusException ex) { throw new IOException(ex.getMessage()); } }
[ "public", "void", "close", "(", ")", "throws", "IOException", "{", "try", "{", "while", "(", "processNextResponse", "(", "0", ")", ")", ";", "file", ".", "close", "(", ")", ";", "}", "catch", "(", "SshException", "ex", ")", "{", "throw", "new", "SshI...
Closes the file's handle
[ "Closes", "the", "file", "s", "handle" ]
ce11ceaf0aa0b129b54327a6891973e1e34689f7
https://github.com/sshtools/j2ssh-maverick/blob/ce11ceaf0aa0b129b54327a6891973e1e34689f7/j2ssh-maverick/src/main/java/com/sshtools/sftp/SftpFileOutputStream.java#L157-L167
train
sshtools/j2ssh-maverick
j2ssh-maverick/src/main/java/com/sshtools/util/ByteArrayReader.java
ByteArrayReader.setCharsetEncoding
public static void setCharsetEncoding(String charset) { try { String test = "123456890"; test.getBytes(charset); CHARSET_ENCODING = charset; encode = true; } catch (UnsupportedEncodingException ex) { // Reset the encoding to default CHARSET_ENCODING = ""; encode = false; } }
java
public static void setCharsetEncoding(String charset) { try { String test = "123456890"; test.getBytes(charset); CHARSET_ENCODING = charset; encode = true; } catch (UnsupportedEncodingException ex) { // Reset the encoding to default CHARSET_ENCODING = ""; encode = false; } }
[ "public", "static", "void", "setCharsetEncoding", "(", "String", "charset", ")", "{", "try", "{", "String", "test", "=", "\"123456890\"", ";", "test", ".", "getBytes", "(", "charset", ")", ";", "CHARSET_ENCODING", "=", "charset", ";", "encode", "=", "true", ...
Allows the default encoding to be overriden for String variables processed by the class. This currently defaults to UTF-8. @param charset @throws UnsupportedEncodingException
[ "Allows", "the", "default", "encoding", "to", "be", "overriden", "for", "String", "variables", "processed", "by", "the", "class", ".", "This", "currently", "defaults", "to", "UTF", "-", "8", "." ]
ce11ceaf0aa0b129b54327a6891973e1e34689f7
https://github.com/sshtools/j2ssh-maverick/blob/ce11ceaf0aa0b129b54327a6891973e1e34689f7/j2ssh-maverick/src/main/java/com/sshtools/util/ByteArrayReader.java#L78-L90
train
sshtools/j2ssh-maverick
j2ssh-maverick/src/main/java/com/sshtools/util/ByteArrayReader.java
ByteArrayReader.readBigInteger
public BigInteger readBigInteger() throws IOException { int len = (int) readInt(); byte[] raw = new byte[len]; readFully(raw); return new BigInteger(raw); }
java
public BigInteger readBigInteger() throws IOException { int len = (int) readInt(); byte[] raw = new byte[len]; readFully(raw); return new BigInteger(raw); }
[ "public", "BigInteger", "readBigInteger", "(", ")", "throws", "IOException", "{", "int", "len", "=", "(", "int", ")", "readInt", "(", ")", ";", "byte", "[", "]", "raw", "=", "new", "byte", "[", "len", "]", ";", "readFully", "(", "raw", ")", ";", "r...
Read a BigInteger from the array. @return the BigInteger value. @throws IOException
[ "Read", "a", "BigInteger", "from", "the", "array", "." ]
ce11ceaf0aa0b129b54327a6891973e1e34689f7
https://github.com/sshtools/j2ssh-maverick/blob/ce11ceaf0aa0b129b54327a6891973e1e34689f7/j2ssh-maverick/src/main/java/com/sshtools/util/ByteArrayReader.java#L144-L149
train
sshtools/j2ssh-maverick
j2ssh-maverick/src/main/java/com/sshtools/util/ByteArrayReader.java
ByteArrayReader.readString
public String readString(String charset) throws IOException { long len = readInt(); if (len > available()) throw new IOException("Cannot read string of length " + len + " bytes when only " + available() + " bytes are available"); byte[] raw = new byte[(int) len]; readFully(raw); if (encode) { ...
java
public String readString(String charset) throws IOException { long len = readInt(); if (len > available()) throw new IOException("Cannot read string of length " + len + " bytes when only " + available() + " bytes are available"); byte[] raw = new byte[(int) len]; readFully(raw); if (encode) { ...
[ "public", "String", "readString", "(", "String", "charset", ")", "throws", "IOException", "{", "long", "len", "=", "readInt", "(", ")", ";", "if", "(", "len", ">", "available", "(", ")", ")", "throw", "new", "IOException", "(", "\"Cannot read string of lengt...
Read a String from the array converting using the given character set. @param charset @return @throws IOException
[ "Read", "a", "String", "from", "the", "array", "converting", "using", "the", "given", "character", "set", "." ]
ce11ceaf0aa0b129b54327a6891973e1e34689f7
https://github.com/sshtools/j2ssh-maverick/blob/ce11ceaf0aa0b129b54327a6891973e1e34689f7/j2ssh-maverick/src/main/java/com/sshtools/util/ByteArrayReader.java#L249-L264
train
sshtools/j2ssh-maverick
j2ssh-maverick/src/main/java/com/sshtools/util/ByteArrayReader.java
ByteArrayReader.readMPINT32
public BigInteger readMPINT32() throws IOException { int bits = (int) readInt(); byte[] raw = new byte[(bits + 7) / 8 + 1]; raw[0] = 0; readFully(raw, 1, raw.length - 1); return new BigInteger(raw); }
java
public BigInteger readMPINT32() throws IOException { int bits = (int) readInt(); byte[] raw = new byte[(bits + 7) / 8 + 1]; raw[0] = 0; readFully(raw, 1, raw.length - 1); return new BigInteger(raw); }
[ "public", "BigInteger", "readMPINT32", "(", ")", "throws", "IOException", "{", "int", "bits", "=", "(", "int", ")", "readInt", "(", ")", ";", "byte", "[", "]", "raw", "=", "new", "byte", "[", "(", "bits", "+", "7", ")", "/", "8", "+", "1", "]", ...
Reads an MPINT using the first 32 bits as the length prefix @return @throws IOException
[ "Reads", "an", "MPINT", "using", "the", "first", "32", "bits", "as", "the", "length", "prefix" ]
ce11ceaf0aa0b129b54327a6891973e1e34689f7
https://github.com/sshtools/j2ssh-maverick/blob/ce11ceaf0aa0b129b54327a6891973e1e34689f7/j2ssh-maverick/src/main/java/com/sshtools/util/ByteArrayReader.java#L283-L293
train
sshtools/j2ssh-maverick
j2ssh-maverick/src/main/java/com/sshtools/util/ByteArrayReader.java
ByteArrayReader.readMPINT
public BigInteger readMPINT() throws IOException { short bits = readShort(); byte[] raw = new byte[(bits + 7) / 8 + 1]; raw[0] = 0; readFully(raw, 1, raw.length - 1); return new BigInteger(raw); }
java
public BigInteger readMPINT() throws IOException { short bits = readShort(); byte[] raw = new byte[(bits + 7) / 8 + 1]; raw[0] = 0; readFully(raw, 1, raw.length - 1); return new BigInteger(raw); }
[ "public", "BigInteger", "readMPINT", "(", ")", "throws", "IOException", "{", "short", "bits", "=", "readShort", "(", ")", ";", "byte", "[", "]", "raw", "=", "new", "byte", "[", "(", "bits", "+", "7", ")", "/", "8", "+", "1", "]", ";", "raw", "[",...
Reads a standard SSH1 MPINT using the first 16 bits as the length prefix @return @throws IOException
[ "Reads", "a", "standard", "SSH1", "MPINT", "using", "the", "first", "16", "bits", "as", "the", "length", "prefix" ]
ce11ceaf0aa0b129b54327a6891973e1e34689f7
https://github.com/sshtools/j2ssh-maverick/blob/ce11ceaf0aa0b129b54327a6891973e1e34689f7/j2ssh-maverick/src/main/java/com/sshtools/util/ByteArrayReader.java#L301-L310
train
sshtools/j2ssh-maverick
j2ssh-maverick/src/main/java/com/sshtools/net/SocksProxyTransport.java
SocksProxyTransport.connectViaSocks4Proxy
public static SocksProxyTransport connectViaSocks4Proxy(String remoteHost, int remotePort, String proxyHost, int proxyPort, String userId) throws IOException, UnknownHostException { SocksProxyTransport proxySocket = new SocksProxyTransport(remoteHost, remotePort, proxyHost, proxyPort, SOCKS4); proxySocket...
java
public static SocksProxyTransport connectViaSocks4Proxy(String remoteHost, int remotePort, String proxyHost, int proxyPort, String userId) throws IOException, UnknownHostException { SocksProxyTransport proxySocket = new SocksProxyTransport(remoteHost, remotePort, proxyHost, proxyPort, SOCKS4); proxySocket...
[ "public", "static", "SocksProxyTransport", "connectViaSocks4Proxy", "(", "String", "remoteHost", ",", "int", "remotePort", ",", "String", "proxyHost", ",", "int", "proxyPort", ",", "String", "userId", ")", "throws", "IOException", ",", "UnknownHostException", "{", "...
Connect the socket to a SOCKS 4 proxy and request forwarding to our remote host. @param remoteHost @param remotePort @param proxyHost @param proxyPort @param userId @return SocksProxyTransport @throws IOException @throws UnknownHostException
[ "Connect", "the", "socket", "to", "a", "SOCKS", "4", "proxy", "and", "request", "forwarding", "to", "our", "remote", "host", "." ]
ce11ceaf0aa0b129b54327a6891973e1e34689f7
https://github.com/sshtools/j2ssh-maverick/blob/ce11ceaf0aa0b129b54327a6891973e1e34689f7/j2ssh-maverick/src/main/java/com/sshtools/net/SocksProxyTransport.java#L91-L150
train
sshtools/j2ssh-maverick
j2ssh-maverick/src/main/java/com/sshtools/ssh/SubsystemChannel.java
SubsystemChannel.sendMessage
protected void sendMessage(byte[] msg) throws SshException { try { Packet pkt = createPacket(); pkt.write(msg); sendMessage(pkt); } catch (IOException ex) { throw new SshException(SshException.UNEXPECTED_TERMINATION, ex); } }
java
protected void sendMessage(byte[] msg) throws SshException { try { Packet pkt = createPacket(); pkt.write(msg); sendMessage(pkt); } catch (IOException ex) { throw new SshException(SshException.UNEXPECTED_TERMINATION, ex); } }
[ "protected", "void", "sendMessage", "(", "byte", "[", "]", "msg", ")", "throws", "SshException", "{", "try", "{", "Packet", "pkt", "=", "createPacket", "(", ")", ";", "pkt", ".", "write", "(", "msg", ")", ";", "sendMessage", "(", "pkt", ")", ";", "}"...
Send a byte array as a message. @param msg @throws SshException @deprecated This has changed internally to use a {@link com.sshtools.ssh.Packet} and it is recommended that all implementations change to use {@link com.sshtools.ssh.Packet}'s as they provide a more efficent way of sending data.
[ "Send", "a", "byte", "array", "as", "a", "message", "." ]
ce11ceaf0aa0b129b54327a6891973e1e34689f7
https://github.com/sshtools/j2ssh-maverick/blob/ce11ceaf0aa0b129b54327a6891973e1e34689f7/j2ssh-maverick/src/main/java/com/sshtools/ssh/SubsystemChannel.java#L141-L149
train
sshtools/j2ssh-maverick
j2ssh-maverick/src/main/java/com/sshtools/ssh/SubsystemChannel.java
SubsystemChannel.createPacket
protected Packet createPacket() throws IOException { synchronized (packets) { if (packets.size() == 0) return new Packet(); Packet p = (Packet) packets.elementAt(0); packets.removeElementAt(0); return p; } }
java
protected Packet createPacket() throws IOException { synchronized (packets) { if (packets.size() == 0) return new Packet(); Packet p = (Packet) packets.elementAt(0); packets.removeElementAt(0); return p; } }
[ "protected", "Packet", "createPacket", "(", ")", "throws", "IOException", "{", "synchronized", "(", "packets", ")", "{", "if", "(", "packets", ".", "size", "(", ")", "==", "0", ")", "return", "new", "Packet", "(", ")", ";", "Packet", "p", "=", "(", "...
Get a packet from the available pool or create if non available @return Packet @throws IOException
[ "Get", "a", "packet", "from", "the", "available", "pool", "or", "create", "if", "non", "available" ]
ce11ceaf0aa0b129b54327a6891973e1e34689f7
https://github.com/sshtools/j2ssh-maverick/blob/ce11ceaf0aa0b129b54327a6891973e1e34689f7/j2ssh-maverick/src/main/java/com/sshtools/ssh/SubsystemChannel.java#L157-L165
train
sshtools/j2ssh-maverick
j2ssh-maverick/src/main/java/com/sshtools/publickey/SshKeyPairGenerator.java
SshKeyPairGenerator.generateKeyPair
public static SshKeyPair generateKeyPair(String algorithm, int bits) throws IOException, SshException { if (!SSH2_RSA.equalsIgnoreCase(algorithm) && !SSH2_DSA.equalsIgnoreCase(algorithm)) { throw new IOException(algorithm + " is not a supported key algorithm!"); } SshKeyPair pair = new SshKeyPair...
java
public static SshKeyPair generateKeyPair(String algorithm, int bits) throws IOException, SshException { if (!SSH2_RSA.equalsIgnoreCase(algorithm) && !SSH2_DSA.equalsIgnoreCase(algorithm)) { throw new IOException(algorithm + " is not a supported key algorithm!"); } SshKeyPair pair = new SshKeyPair...
[ "public", "static", "SshKeyPair", "generateKeyPair", "(", "String", "algorithm", ",", "int", "bits", ")", "throws", "IOException", ",", "SshException", "{", "if", "(", "!", "SSH2_RSA", ".", "equalsIgnoreCase", "(", "algorithm", ")", "&&", "!", "SSH2_DSA", ".",...
Generates a new key pair. @param algorithm @param bits @return SshKeyPair @throws IOException
[ "Generates", "a", "new", "key", "pair", "." ]
ce11ceaf0aa0b129b54327a6891973e1e34689f7
https://github.com/sshtools/j2ssh-maverick/blob/ce11ceaf0aa0b129b54327a6891973e1e34689f7/j2ssh-maverick/src/main/java/com/sshtools/publickey/SshKeyPairGenerator.java#L83-L101
train
sshtools/j2ssh-maverick
j2ssh-maverick/src/main/java/com/sshtools/sftp/SftpFileAttributes.java
SftpFileAttributes.setUID
public void setUID(String uid) { if (version > 3) { flags |= SSH_FILEXFER_ATTR_OWNERGROUP; } else flags |= SSH_FILEXFER_ATTR_UIDGID; this.uid = uid; }
java
public void setUID(String uid) { if (version > 3) { flags |= SSH_FILEXFER_ATTR_OWNERGROUP; } else flags |= SSH_FILEXFER_ATTR_UIDGID; this.uid = uid; }
[ "public", "void", "setUID", "(", "String", "uid", ")", "{", "if", "(", "version", ">", "3", ")", "{", "flags", "|=", "SSH_FILEXFER_ATTR_OWNERGROUP", ";", "}", "else", "flags", "|=", "SSH_FILEXFER_ATTR_UIDGID", ";", "this", ".", "uid", "=", "uid", ";", "}...
Set the UID of the owner. @param uid
[ "Set", "the", "UID", "of", "the", "owner", "." ]
ce11ceaf0aa0b129b54327a6891973e1e34689f7
https://github.com/sshtools/j2ssh-maverick/blob/ce11ceaf0aa0b129b54327a6891973e1e34689f7/j2ssh-maverick/src/main/java/com/sshtools/sftp/SftpFileAttributes.java#L297-L303
train
sshtools/j2ssh-maverick
j2ssh-maverick/src/main/java/com/sshtools/sftp/SftpFileAttributes.java
SftpFileAttributes.setGID
public void setGID(String gid) { if (version > 3) { flags |= SSH_FILEXFER_ATTR_OWNERGROUP; } else flags |= SSH_FILEXFER_ATTR_UIDGID; this.gid = gid; }
java
public void setGID(String gid) { if (version > 3) { flags |= SSH_FILEXFER_ATTR_OWNERGROUP; } else flags |= SSH_FILEXFER_ATTR_UIDGID; this.gid = gid; }
[ "public", "void", "setGID", "(", "String", "gid", ")", "{", "if", "(", "version", ">", "3", ")", "{", "flags", "|=", "SSH_FILEXFER_ATTR_OWNERGROUP", ";", "}", "else", "flags", "|=", "SSH_FILEXFER_ATTR_UIDGID", ";", "this", ".", "gid", "=", "gid", ";", "}...
Set the GID of this file. @param gid
[ "Set", "the", "GID", "of", "this", "file", "." ]
ce11ceaf0aa0b129b54327a6891973e1e34689f7
https://github.com/sshtools/j2ssh-maverick/blob/ce11ceaf0aa0b129b54327a6891973e1e34689f7/j2ssh-maverick/src/main/java/com/sshtools/sftp/SftpFileAttributes.java#L310-L317
train
sshtools/j2ssh-maverick
j2ssh-maverick/src/main/java/com/sshtools/sftp/SftpFileAttributes.java
SftpFileAttributes.setSize
public void setSize(UnsignedInteger64 size) { this.size = size; // Set the flag if (size != null) { flags |= SSH_FILEXFER_ATTR_SIZE; } else { flags ^= SSH_FILEXFER_ATTR_SIZE; } }
java
public void setSize(UnsignedInteger64 size) { this.size = size; // Set the flag if (size != null) { flags |= SSH_FILEXFER_ATTR_SIZE; } else { flags ^= SSH_FILEXFER_ATTR_SIZE; } }
[ "public", "void", "setSize", "(", "UnsignedInteger64", "size", ")", "{", "this", ".", "size", "=", "size", ";", "// Set the flag", "if", "(", "size", "!=", "null", ")", "{", "flags", "|=", "SSH_FILEXFER_ATTR_SIZE", ";", "}", "else", "{", "flags", "^=", "...
Set the size of the file. @param size
[ "Set", "the", "size", "of", "the", "file", "." ]
ce11ceaf0aa0b129b54327a6891973e1e34689f7
https://github.com/sshtools/j2ssh-maverick/blob/ce11ceaf0aa0b129b54327a6891973e1e34689f7/j2ssh-maverick/src/main/java/com/sshtools/sftp/SftpFileAttributes.java#L347-L356
train
sshtools/j2ssh-maverick
j2ssh-maverick/src/main/java/com/sshtools/sftp/SftpFileAttributes.java
SftpFileAttributes.setPermissions
public void setPermissions(UnsignedInteger32 permissions) { this.permissions = permissions; // Set the flag if (permissions != null) { flags |= SSH_FILEXFER_ATTR_PERMISSIONS; } else { flags ^= SSH_FILEXFER_ATTR_PERMISSIONS; } }
java
public void setPermissions(UnsignedInteger32 permissions) { this.permissions = permissions; // Set the flag if (permissions != null) { flags |= SSH_FILEXFER_ATTR_PERMISSIONS; } else { flags ^= SSH_FILEXFER_ATTR_PERMISSIONS; } }
[ "public", "void", "setPermissions", "(", "UnsignedInteger32", "permissions", ")", "{", "this", ".", "permissions", "=", "permissions", ";", "// Set the flag", "if", "(", "permissions", "!=", "null", ")", "{", "flags", "|=", "SSH_FILEXFER_ATTR_PERMISSIONS", ";", "}...
Set the permissions of the file. This value should be a valid mask of the permissions flags defined within this class.
[ "Set", "the", "permissions", "of", "the", "file", ".", "This", "value", "should", "be", "a", "valid", "mask", "of", "the", "permissions", "flags", "defined", "within", "this", "class", "." ]
ce11ceaf0aa0b129b54327a6891973e1e34689f7
https://github.com/sshtools/j2ssh-maverick/blob/ce11ceaf0aa0b129b54327a6891973e1e34689f7/j2ssh-maverick/src/main/java/com/sshtools/sftp/SftpFileAttributes.java#L379-L388
train
sshtools/j2ssh-maverick
j2ssh-maverick/src/main/java/com/sshtools/sftp/SftpFileAttributes.java
SftpFileAttributes.setPermissionsFromMaskString
public void setPermissionsFromMaskString(String mask) { if (mask.length() != 4) { throw new IllegalArgumentException("Mask length must be 4"); } try { setPermissions(new UnsignedInteger32(String.valueOf(Integer .parseInt(mask, 8)))); } catch (NumberFormatException nfe) { throw new IllegalArgument...
java
public void setPermissionsFromMaskString(String mask) { if (mask.length() != 4) { throw new IllegalArgumentException("Mask length must be 4"); } try { setPermissions(new UnsignedInteger32(String.valueOf(Integer .parseInt(mask, 8)))); } catch (NumberFormatException nfe) { throw new IllegalArgument...
[ "public", "void", "setPermissionsFromMaskString", "(", "String", "mask", ")", "{", "if", "(", "mask", ".", "length", "(", ")", "!=", "4", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Mask length must be 4\"", ")", ";", "}", "try", "{", "setP...
Set permissions given a UNIX style mask, for example '0644' @param mask mask @throws IllegalArgumentException if badly formatted string
[ "Set", "permissions", "given", "a", "UNIX", "style", "mask", "for", "example", "0644" ]
ce11ceaf0aa0b129b54327a6891973e1e34689f7
https://github.com/sshtools/j2ssh-maverick/blob/ce11ceaf0aa0b129b54327a6891973e1e34689f7/j2ssh-maverick/src/main/java/com/sshtools/sftp/SftpFileAttributes.java#L399-L411
train
sshtools/j2ssh-maverick
j2ssh-maverick/src/main/java/com/sshtools/sftp/SftpFileAttributes.java
SftpFileAttributes.setPermissionsFromUmaskString
public void setPermissionsFromUmaskString(String umask) { if (umask.length() != 4) { throw new IllegalArgumentException("umask length must be 4"); } try { setPermissions(new UnsignedInteger32(String.valueOf(Integer .parseInt(umask, 8) ^ 0777))); } catch (NumberFormatException ex) { throw new Ille...
java
public void setPermissionsFromUmaskString(String umask) { if (umask.length() != 4) { throw new IllegalArgumentException("umask length must be 4"); } try { setPermissions(new UnsignedInteger32(String.valueOf(Integer .parseInt(umask, 8) ^ 0777))); } catch (NumberFormatException ex) { throw new Ille...
[ "public", "void", "setPermissionsFromUmaskString", "(", "String", "umask", ")", "{", "if", "(", "umask", ".", "length", "(", ")", "!=", "4", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"umask length must be 4\"", ")", ";", "}", "try", "{", "...
Set the permissions given a UNIX style umask, for example '0022' will result in 0022 ^ 0777. @param umask @throws IllegalArgumentException if badly formatted string
[ "Set", "the", "permissions", "given", "a", "UNIX", "style", "umask", "for", "example", "0022", "will", "result", "in", "0022", "^", "0777", "." ]
ce11ceaf0aa0b129b54327a6891973e1e34689f7
https://github.com/sshtools/j2ssh-maverick/blob/ce11ceaf0aa0b129b54327a6891973e1e34689f7/j2ssh-maverick/src/main/java/com/sshtools/sftp/SftpFileAttributes.java#L421-L433
train
sshtools/j2ssh-maverick
j2ssh-maverick/src/main/java/com/sshtools/sftp/SftpFileAttributes.java
SftpFileAttributes.getMaskString
public String getMaskString() { StringBuffer buf = new StringBuffer(); if (permissions != null) { int i = (int) permissions.longValue(); buf.append('0'); buf.append(octal(i, 6)); buf.append(octal(i, 3)); buf.append(octal(i, 0)); } else { buf.append("----"); } return buf.toString(); }
java
public String getMaskString() { StringBuffer buf = new StringBuffer(); if (permissions != null) { int i = (int) permissions.longValue(); buf.append('0'); buf.append(octal(i, 6)); buf.append(octal(i, 3)); buf.append(octal(i, 0)); } else { buf.append("----"); } return buf.toString(); }
[ "public", "String", "getMaskString", "(", ")", "{", "StringBuffer", "buf", "=", "new", "StringBuffer", "(", ")", ";", "if", "(", "permissions", "!=", "null", ")", "{", "int", "i", "=", "(", "int", ")", "permissions", ".", "longValue", "(", ")", ";", ...
Return the UNIX style mode mask @return mask
[ "Return", "the", "UNIX", "style", "mode", "mask" ]
ce11ceaf0aa0b129b54327a6891973e1e34689f7
https://github.com/sshtools/j2ssh-maverick/blob/ce11ceaf0aa0b129b54327a6891973e1e34689f7/j2ssh-maverick/src/main/java/com/sshtools/sftp/SftpFileAttributes.java#L854-L867
train
sshtools/j2ssh-maverick
j2ssh-maverick/src/main/java/com/sshtools/sftp/SftpFileAttributes.java
SftpFileAttributes.isDirectory
public boolean isDirectory() { if (sftp.getVersion() > 3) { return type == SSH_FILEXFER_TYPE_DIRECTORY; } else if (permissions != null && (permissions.longValue() & SftpFileAttributes.S_IFDIR) == SftpFileAttributes.S_IFDIR) { return true; } else { return false; } }
java
public boolean isDirectory() { if (sftp.getVersion() > 3) { return type == SSH_FILEXFER_TYPE_DIRECTORY; } else if (permissions != null && (permissions.longValue() & SftpFileAttributes.S_IFDIR) == SftpFileAttributes.S_IFDIR) { return true; } else { return false; } }
[ "public", "boolean", "isDirectory", "(", ")", "{", "if", "(", "sftp", ".", "getVersion", "(", ")", ">", "3", ")", "{", "return", "type", "==", "SSH_FILEXFER_TYPE_DIRECTORY", ";", "}", "else", "if", "(", "permissions", "!=", "null", "&&", "(", "permission...
Determine whether these attributes refer to a directory @return boolean
[ "Determine", "whether", "these", "attributes", "refer", "to", "a", "directory" ]
ce11ceaf0aa0b129b54327a6891973e1e34689f7
https://github.com/sshtools/j2ssh-maverick/blob/ce11ceaf0aa0b129b54327a6891973e1e34689f7/j2ssh-maverick/src/main/java/com/sshtools/sftp/SftpFileAttributes.java#L874-L883
train
sshtools/j2ssh-maverick
j2ssh-maverick/src/main/java/com/sshtools/sftp/SftpFileAttributes.java
SftpFileAttributes.isLink
public boolean isLink() { if (sftp.getVersion() > 3) { return type == SSH_FILEXFER_TYPE_SYMLINK; } else if (permissions != null && (permissions.longValue() & SftpFileAttributes.S_IFLNK) == SftpFileAttributes.S_IFLNK) { return true; } else { return false; } }
java
public boolean isLink() { if (sftp.getVersion() > 3) { return type == SSH_FILEXFER_TYPE_SYMLINK; } else if (permissions != null && (permissions.longValue() & SftpFileAttributes.S_IFLNK) == SftpFileAttributes.S_IFLNK) { return true; } else { return false; } }
[ "public", "boolean", "isLink", "(", ")", "{", "if", "(", "sftp", ".", "getVersion", "(", ")", ">", "3", ")", "{", "return", "type", "==", "SSH_FILEXFER_TYPE_SYMLINK", ";", "}", "else", "if", "(", "permissions", "!=", "null", "&&", "(", "permissions", "...
Determine whether these attributes refer to a symbolic link. @return boolean
[ "Determine", "whether", "these", "attributes", "refer", "to", "a", "symbolic", "link", "." ]
ce11ceaf0aa0b129b54327a6891973e1e34689f7
https://github.com/sshtools/j2ssh-maverick/blob/ce11ceaf0aa0b129b54327a6891973e1e34689f7/j2ssh-maverick/src/main/java/com/sshtools/sftp/SftpFileAttributes.java#L908-L918
train
sshtools/j2ssh-maverick
j2ssh-maverick/src/main/java/com/sshtools/sftp/SftpFileAttributes.java
SftpFileAttributes.isFifo
public boolean isFifo() { if (permissions != null && (permissions.longValue() & SftpFileAttributes.S_IFIFO) == SftpFileAttributes.S_IFIFO) { return true; } return false; }
java
public boolean isFifo() { if (permissions != null && (permissions.longValue() & SftpFileAttributes.S_IFIFO) == SftpFileAttributes.S_IFIFO) { return true; } return false; }
[ "public", "boolean", "isFifo", "(", ")", "{", "if", "(", "permissions", "!=", "null", "&&", "(", "permissions", ".", "longValue", "(", ")", "&", "SftpFileAttributes", ".", "S_IFIFO", ")", "==", "SftpFileAttributes", ".", "S_IFIFO", ")", "{", "return", "tru...
Determine whether these attributes refer to a pipe. @return boolean
[ "Determine", "whether", "these", "attributes", "refer", "to", "a", "pipe", "." ]
ce11ceaf0aa0b129b54327a6891973e1e34689f7
https://github.com/sshtools/j2ssh-maverick/blob/ce11ceaf0aa0b129b54327a6891973e1e34689f7/j2ssh-maverick/src/main/java/com/sshtools/sftp/SftpFileAttributes.java#L925-L931
train
sshtools/j2ssh-maverick
j2ssh-maverick/src/main/java/com/sshtools/sftp/SftpFileAttributes.java
SftpFileAttributes.isBlock
public boolean isBlock() { if (permissions != null && (permissions.longValue() & SftpFileAttributes.S_IFBLK) == SftpFileAttributes.S_IFBLK) { return true; } return false; }
java
public boolean isBlock() { if (permissions != null && (permissions.longValue() & SftpFileAttributes.S_IFBLK) == SftpFileAttributes.S_IFBLK) { return true; } return false; }
[ "public", "boolean", "isBlock", "(", ")", "{", "if", "(", "permissions", "!=", "null", "&&", "(", "permissions", ".", "longValue", "(", ")", "&", "SftpFileAttributes", ".", "S_IFBLK", ")", "==", "SftpFileAttributes", ".", "S_IFBLK", ")", "{", "return", "tr...
Determine whether these attributes refer to a block special file. @return boolean
[ "Determine", "whether", "these", "attributes", "refer", "to", "a", "block", "special", "file", "." ]
ce11ceaf0aa0b129b54327a6891973e1e34689f7
https://github.com/sshtools/j2ssh-maverick/blob/ce11ceaf0aa0b129b54327a6891973e1e34689f7/j2ssh-maverick/src/main/java/com/sshtools/sftp/SftpFileAttributes.java#L938-L944
train