diff --git a/doc/allclasses-frame.html b/doc/allclasses-frame.html deleted file mode 100644 index 36e9335..0000000 --- a/doc/allclasses-frame.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - -All Classes (wordpress-java 0.5.1 API) - - - - -

All Classes

-
- -
- - diff --git a/doc/allclasses-noframe.html b/doc/allclasses-noframe.html deleted file mode 100644 index 016671b..0000000 --- a/doc/allclasses-noframe.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - -All Classes (wordpress-java 0.5.1 API) - - - - -

All Classes

-
- -
- - diff --git a/doc/constant-values.html b/doc/constant-values.html deleted file mode 100644 index 4a2b12e..0000000 --- a/doc/constant-values.html +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - -Constant Field Values (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - -
-

Constant Field Values

-

Contents

-
- -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/deprecated-list.html b/doc/deprecated-list.html deleted file mode 100644 index 106d034..0000000 --- a/doc/deprecated-list.html +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - -Deprecated List (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - -
-

Deprecated API

-

Contents

-
- -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/help-doc.html b/doc/help-doc.html deleted file mode 100644 index def676d..0000000 --- a/doc/help-doc.html +++ /dev/null @@ -1,222 +0,0 @@ - - - - - - -API Help (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - -
-

How This API Document Is Organized

-
This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.
-
-
- -This help file applies to API documentation generated using the standard doclet.
- -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/index-files/index-1.html b/doc/index-files/index-1.html deleted file mode 100644 index aa7290e..0000000 --- a/doc/index-files/index-1.html +++ /dev/null @@ -1,136 +0,0 @@ - - - - - - -A-Index (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - -
A B C D E F G H I J K L M N O P Q R S T U W X  - - -

A

-
-
accumulate(String, Object) - Method in class org.json.JSONObject
-
-
Accumulate values under a key.
-
-
addTwoNumbers(double, double) - Method in class net.bican.wordpress.Wordpress
-
 
-
append(String, Object) - Method in class org.json.JSONObject
-
-
Append values to the array under a key.
-
-
Author - Class in net.bican.wordpress
-
-
Author object for a blog.
-
-
Author() - Constructor for class net.bican.wordpress.Author
-
 
-
-A B C D E F G H I J K L M N O P Q R S T U W X 
- -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/index-files/index-10.html b/doc/index-files/index-10.html deleted file mode 100644 index 5446c0d..0000000 --- a/doc/index-files/index-10.html +++ /dev/null @@ -1,215 +0,0 @@ - - - - - - -J-Index (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - -
A B C D E F G H I J K L M N O P Q R S T U W X  - - -

J

-
-
join(String) - Method in class org.json.JSONArray
-
-
Make a string from the contents of this JSONArray.
-
-
JSONArray - Class in org.json
-
-
A JSONArray is an ordered sequence of values.
-
-
JSONArray() - Constructor for class org.json.JSONArray
-
-
Construct an empty JSONArray.
-
-
JSONArray(JSONTokener) - Constructor for class org.json.JSONArray
-
-
Construct a JSONArray from a JSONTokener.
-
-
JSONArray(String) - Constructor for class org.json.JSONArray
-
-
Construct a JSONArray from a source JSON text.
-
-
JSONArray(Collection) - Constructor for class org.json.JSONArray
-
-
Construct a JSONArray from a Collection.
-
-
JSONArray(Object) - Constructor for class org.json.JSONArray
-
-
Construct a JSONArray from an array
-
-
JSONConvertable - Interface in net.bican.wordpress
-
-
Interface for objects that can be modified via JSON objects.
-
-
JSONException - Exception in org.json
-
-
The JSONException is thrown by the JSON.org classes when things are amiss.
-
-
JSONException(String) - Constructor for exception org.json.JSONException
-
-
Constructs a JSONException with an explanatory message.
-
-
JSONException(Throwable) - Constructor for exception org.json.JSONException
-
 
-
JSONObject - Class in org.json
-
-
A JSONObject is an unordered collection of name/value pairs.
-
-
JSONObject() - Constructor for class org.json.JSONObject
-
-
Construct an empty JSONObject.
-
-
JSONObject(JSONObject, String[]) - Constructor for class org.json.JSONObject
-
-
Construct a JSONObject from a subset of another JSONObject.
-
-
JSONObject(JSONTokener) - Constructor for class org.json.JSONObject
-
-
Construct a JSONObject from a JSONTokener.
-
-
JSONObject(Map) - Constructor for class org.json.JSONObject
-
-
Construct a JSONObject from a Map.
-
-
JSONObject(Object) - Constructor for class org.json.JSONObject
-
-
Construct a JSONObject from an Object using bean getters.
-
-
JSONObject(Object, String[]) - Constructor for class org.json.JSONObject
-
-
Construct a JSONObject from an Object, using reflection to find the public - members.
-
-
JSONObject(String) - Constructor for class org.json.JSONObject
-
-
Construct a JSONObject from a source JSON text string.
-
-
JSONString - Interface in org.json
-
-
The JSONString interface allows a toJSONString() - method so that a class can change the behavior of - JSONObject.toString(), JSONArray.toString(), and - JSONWriter.value(Object).
-
-
JSONTokener - Class in org.json
-
-
A JSONTokener takes a source string and extracts characters and tokens from - it.
-
-
JSONTokener(Reader) - Constructor for class org.json.JSONTokener
-
-
Construct a JSONTokener from a reader.
-
-
JSONTokener(String) - Constructor for class org.json.JSONTokener
-
-
Construct a JSONTokener from a string.
-
-
-A B C D E F G H I J K L M N O P Q R S T U W X 
- -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/index-files/index-11.html b/doc/index-files/index-11.html deleted file mode 100644 index 79a15c7..0000000 --- a/doc/index-files/index-11.html +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - -K-Index (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - -
A B C D E F G H I J K L M N O P Q R S T U W X  - - -

K

-
-
keys() - Method in class org.json.JSONObject
-
-
Get an enumeration of the keys of the JSONObject.
-
-
-A B C D E F G H I J K L M N O P Q R S T U W X 
- -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/index-files/index-12.html b/doc/index-files/index-12.html deleted file mode 100644 index c3c0597..0000000 --- a/doc/index-files/index-12.html +++ /dev/null @@ -1,128 +0,0 @@ - - - - - - -L-Index (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - -
A B C D E F G H I J K L M N O P Q R S T U W X  - - -

L

-
-
length() - Method in class org.json.JSONArray
-
-
Get the number of elements in the JSONArray, included nulls.
-
-
length() - Method in class org.json.JSONObject
-
-
Get the number of keys stored in the JSONObject.
-
-
-A B C D E F G H I J K L M N O P Q R S T U W X 
- -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/index-files/index-13.html b/doc/index-files/index-13.html deleted file mode 100644 index 7315d1b..0000000 --- a/doc/index-files/index-13.html +++ /dev/null @@ -1,150 +0,0 @@ - - - - - - -M-Index (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - -
A B C D E F G H I J K L M N O P Q R S T U W X  - - -

M

-
-
Main - Class in net.bican.wordpress.example
-
-
Example implementation - - Run this as java net.bican.wordpress.example.Main <username> - <password> <xmlrpc-url> for your blog.
-
-
Main() - Constructor for class net.bican.wordpress.example.Main
-
 
-
main(String[]) - Static method in class net.bican.wordpress.example.Main
-
 
-
Main - Class in net.bican.wordpress
-
-
Main Application class for the command line interface.
-
-
Main() - Constructor for class net.bican.wordpress.Main
-
 
-
main(String[]) - Static method in class net.bican.wordpress.Main
-
 
-
MediaObject - Class in net.bican.wordpress
-
-
Media Object, as the result of an upload;
-
-
MediaObject() - Constructor for class net.bican.wordpress.MediaObject
-
 
-
more() - Method in class org.json.JSONTokener
-
-
Determine if the source string still contains characters that next() can - consume.
-
-
-A B C D E F G H I J K L M N O P Q R S T U W X 
- -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/index-files/index-14.html b/doc/index-files/index-14.html deleted file mode 100644 index 5ef48dc..0000000 --- a/doc/index-files/index-14.html +++ /dev/null @@ -1,185 +0,0 @@ - - - - - - -N-Index (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - -
A B C D E F G H I J K L M N O P Q R S T U W X  - - -

N

-
-
names() - Method in class org.json.JSONObject
-
-
Produce a JSONArray containing the names of the elements of this - JSONObject.
-
-
net.bican.wordpress - package net.bican.wordpress
-
 
-
net.bican.wordpress.configuration - package net.bican.wordpress.configuration
-
 
-
net.bican.wordpress.example - package net.bican.wordpress.example
-
 
-
newCategory(String, String, int) - Method in class net.bican.wordpress.Wordpress
-
 
-
newComment(Integer, Integer, String, String, String, String) - Method in class net.bican.wordpress.Wordpress
-
 
-
newMediaObject(String, File, Boolean) - Method in class net.bican.wordpress.Wordpress
-
 
-
newPage(Page, String) - Method in class net.bican.wordpress.Wordpress
-
 
-
newPost(Page, boolean) - Method in class net.bican.wordpress.Wordpress
-
 
-
next() - Method in class org.json.JSONTokener
-
-
Get the next character in the source string.
-
-
next(char) - Method in class org.json.JSONTokener
-
-
Consume the next character, and check that it matches a specified - character.
-
-
next(int) - Method in class org.json.JSONTokener
-
-
Get the next n characters.
-
-
nextClean() - Method in class org.json.JSONTokener
-
-
Get the next char in the string, skipping whitespace.
-
-
nextString(char) - Method in class org.json.JSONTokener
-
-
Return the characters up to the next close quote character.
-
-
nextTo(char) - Method in class org.json.JSONTokener
-
-
Get the text up but not including the specified character or the end of - line, whichever comes first.
-
-
nextTo(String) - Method in class org.json.JSONTokener
-
-
Get the text up but not including one of the specified delimiter characters - or the end of line, whichever comes first.
-
-
nextValue() - Method in class org.json.JSONTokener
-
-
Get the next value.
-
-
NULL - Static variable in class org.json.JSONObject
-
-
It is sometimes more convenient and less ambiguous to have a - NULL object than to use Java's null value.
-
-
numberToString(Number) - Static method in class org.json.JSONObject
-
-
Produce a string from a Number.
-
-
-A B C D E F G H I J K L M N O P Q R S T U W X 
- -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/index-files/index-15.html b/doc/index-files/index-15.html deleted file mode 100644 index dd75460..0000000 --- a/doc/index-files/index-15.html +++ /dev/null @@ -1,232 +0,0 @@ - - - - - - -O-Index (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - -
A B C D E F G H I J K L M N O P Q R S T U W X  - - -

O

-
-
opt(int) - Method in class org.json.JSONArray
-
-
Get the optional object value associated with an index.
-
-
opt(String) - Method in class org.json.JSONObject
-
-
Get an optional value associated with a key.
-
-
optBoolean(int) - Method in class org.json.JSONArray
-
-
Get the optional boolean value associated with an index.
-
-
optBoolean(int, boolean) - Method in class org.json.JSONArray
-
-
Get the optional boolean value associated with an index.
-
-
optBoolean(String) - Method in class org.json.JSONObject
-
-
Get an optional boolean associated with a key.
-
-
optBoolean(String, boolean) - Method in class org.json.JSONObject
-
-
Get an optional boolean associated with a key.
-
-
optDouble(int) - Method in class org.json.JSONArray
-
-
Get the optional double value associated with an index.
-
-
optDouble(int, double) - Method in class org.json.JSONArray
-
-
Get the optional double value associated with an index.
-
-
optDouble(String) - Method in class org.json.JSONObject
-
-
Get an optional double associated with a key, or NaN if there is no such - key or if its value is not a number.
-
-
optDouble(String, double) - Method in class org.json.JSONObject
-
-
Get an optional double associated with a key, or the defaultValue if there - is no such key or if its value is not a number.
-
-
optInt(int) - Method in class org.json.JSONArray
-
-
Get the optional int value associated with an index.
-
-
optInt(int, int) - Method in class org.json.JSONArray
-
-
Get the optional int value associated with an index.
-
-
optInt(String) - Method in class org.json.JSONObject
-
-
Get an optional int value associated with a key, or zero if there is no - such key or if the value is not a number.
-
-
optInt(String, int) - Method in class org.json.JSONObject
-
-
Get an optional int value associated with a key, or the default if there is - no such key or if the value is not a number.
-
-
optJSONArray(int) - Method in class org.json.JSONArray
-
-
Get the optional JSONArray associated with an index.
-
-
optJSONArray(String) - Method in class org.json.JSONObject
-
-
Get an optional JSONArray associated with a key.
-
-
optJSONObject(int) - Method in class org.json.JSONArray
-
-
Get the optional JSONObject associated with an index.
-
-
optJSONObject(String) - Method in class org.json.JSONObject
-
-
Get an optional JSONObject associated with a key.
-
-
optLong(int) - Method in class org.json.JSONArray
-
-
Get the optional long value associated with an index.
-
-
optLong(int, long) - Method in class org.json.JSONArray
-
-
Get the optional long value associated with an index.
-
-
optLong(String) - Method in class org.json.JSONObject
-
-
Get an optional long value associated with a key, or zero if there is no - such key or if the value is not a number.
-
-
optLong(String, long) - Method in class org.json.JSONObject
-
-
Get an optional long value associated with a key, or the default if there - is no such key or if the value is not a number.
-
-
optString(int) - Method in class org.json.JSONArray
-
-
Get the optional string value associated with an index.
-
-
optString(int, String) - Method in class org.json.JSONArray
-
-
Get the optional string associated with an index.
-
-
optString(String) - Method in class org.json.JSONObject
-
-
Get an optional string associated with a key.
-
-
optString(String, String) - Method in class org.json.JSONObject
-
-
Get an optional string associated with a key.
-
-
org.json - package org.json
-
 
-
-A B C D E F G H I J K L M N O P Q R S T U W X 
- -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/index-files/index-16.html b/doc/index-files/index-16.html deleted file mode 100644 index 21a7433..0000000 --- a/doc/index-files/index-16.html +++ /dev/null @@ -1,259 +0,0 @@ - - - - - - -P-Index (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - -
A B C D E F G H I J K L M N O P Q R S T U W X  - - -

P

-
-
Page - Class in net.bican.wordpress
-
-
Page object for a blog.
-
-
Page() - Constructor for class net.bican.wordpress.Page
-
 
-
PageDefinition - Class in net.bican.wordpress
-
-
A trimmed version of Page object, that is returned in lists
-
-
PageDefinition() - Constructor for class net.bican.wordpress.PageDefinition
-
 
-
parseFile(BufferedReader) - Static method in class net.bican.wordpress.FileParser
-
-
Parses a file to create an xmlrpc compliant object
-
-
Ping - Class in net.bican.wordpress
-
-
Class that hold trackback information
-
-
Ping() - Constructor for class net.bican.wordpress.Ping
-
 
-
ping(String, String) - Method in class net.bican.wordpress.Wordpress
-
 
-
PostAndPageStatus - Class in net.bican.wordpress
-
-
Status values for posts and pages
-
-
PostAndPageStatus() - Constructor for class net.bican.wordpress.PostAndPageStatus
-
 
-
PreferencesConfiguration - Class in net.bican.wordpress.configuration
-
 
-
PreferencesConfiguration(Class<?>) - Constructor for class net.bican.wordpress.configuration.PreferencesConfiguration
-
 
-
put(boolean) - Method in class org.json.JSONArray
-
-
Append a boolean value.
-
-
put(Collection) - Method in class org.json.JSONArray
-
-
Put a value in the JSONArray, where the value will be a JSONArray which is - produced from a Collection.
-
-
put(double) - Method in class org.json.JSONArray
-
-
Append a double value.
-
-
put(int) - Method in class org.json.JSONArray
-
-
Append an int value.
-
-
put(long) - Method in class org.json.JSONArray
-
-
Append an long value.
-
-
put(Map) - Method in class org.json.JSONArray
-
-
Put a value in the JSONArray, where the value will be a JSONObject which is - produced from a Map.
-
-
put(Object) - Method in class org.json.JSONArray
-
-
Append an object value.
-
-
put(int, boolean) - Method in class org.json.JSONArray
-
-
Put or replace a boolean value in the JSONArray.
-
-
put(int, Collection) - Method in class org.json.JSONArray
-
-
Put a value in the JSONArray, where the value will be a JSONArray which is - produced from a Collection.
-
-
put(int, double) - Method in class org.json.JSONArray
-
-
Put or replace a double value.
-
-
put(int, int) - Method in class org.json.JSONArray
-
-
Put or replace an int value.
-
-
put(int, long) - Method in class org.json.JSONArray
-
-
Put or replace a long value.
-
-
put(int, Map) - Method in class org.json.JSONArray
-
-
Put a value in the JSONArray, where the value will be a JSONObject which is - produced from a Map.
-
-
put(int, Object) - Method in class org.json.JSONArray
-
-
Put or replace an object value in the JSONArray.
-
-
put(String, boolean) - Method in class org.json.JSONObject
-
-
Put a key/boolean pair in the JSONObject.
-
-
put(String, Collection) - Method in class org.json.JSONObject
-
-
Put a key/value pair in the JSONObject, where the value will be a JSONArray - which is produced from a Collection.
-
-
put(String, double) - Method in class org.json.JSONObject
-
-
Put a key/double pair in the JSONObject.
-
-
put(String, int) - Method in class org.json.JSONObject
-
-
Put a key/int pair in the JSONObject.
-
-
put(String, long) - Method in class org.json.JSONObject
-
-
Put a key/long pair in the JSONObject.
-
-
put(String, Map) - Method in class org.json.JSONObject
-
-
Put a key/value pair in the JSONObject, where the value will be a - JSONObject which is produced from a Map.
-
-
put(String, Object) - Method in class org.json.JSONObject
-
-
Put a key/value pair in the JSONObject.
-
-
putOnce(String, Object) - Method in class org.json.JSONObject
-
-
Put a key/value pair in the JSONObject, but only if the key and the value - are both non-null, and only if there is not already a member with that - name.
-
-
putOpt(String, Object) - Method in class org.json.JSONObject
-
-
Put a key/value pair in the JSONObject, but only if the key and the value - are both non-null.
-
-
putVal(XmlRpcStruct, String, String) - Static method in class net.bican.wordpress.FileParser
-
-
Fills values for an xmlrpc object
-
-
-A B C D E F G H I J K L M N O P Q R S T U W X 
- -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/index-files/index-17.html b/doc/index-files/index-17.html deleted file mode 100644 index 398018e..0000000 --- a/doc/index-files/index-17.html +++ /dev/null @@ -1,125 +0,0 @@ - - - - - - -Q-Index (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - -
A B C D E F G H I J K L M N O P Q R S T U W X  - - -

Q

-
-
quote(String) - Static method in class org.json.JSONObject
-
-
Produce a string in double quotes with backslash sequences in all the right - places.
-
-
-A B C D E F G H I J K L M N O P Q R S T U W X 
- -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/index-files/index-18.html b/doc/index-files/index-18.html deleted file mode 100644 index d0e4a09..0000000 --- a/doc/index-files/index-18.html +++ /dev/null @@ -1,128 +0,0 @@ - - - - - - -R-Index (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - -
A B C D E F G H I J K L M N O P Q R S T U W X  - - -

R

-
-
remove(int) - Method in class org.json.JSONArray
-
-
Remove an index and close the hole.
-
-
remove(String) - Method in class org.json.JSONObject
-
-
Remove a name and its value, if present.
-
-
-A B C D E F G H I J K L M N O P Q R S T U W X 
- -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/index-files/index-19.html b/doc/index-files/index-19.html deleted file mode 100644 index 7aa528c..0000000 --- a/doc/index-files/index-19.html +++ /dev/null @@ -1,314 +0,0 @@ - - - - - - -S-Index (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - -
A B C D E F G H I J K L M N O P Q R S T U W X  - - -

S

-
-
sayHello() - Method in class net.bican.wordpress.Wordpress
-
 
-
setApproved(Integer) - Method in class net.bican.wordpress.CommentCount
-
 
-
setAuthor(String) - Method in class net.bican.wordpress.Comment
-
 
-
setAuthor_email(String) - Method in class net.bican.wordpress.Comment
-
 
-
setAuthor_ip(String) - Method in class net.bican.wordpress.Comment
-
 
-
setAuthor_url(String) - Method in class net.bican.wordpress.Comment
-
 
-
setAwaiting_moderation(Integer) - Method in class net.bican.wordpress.CommentCount
-
 
-
setBlogid(String) - Method in class net.bican.wordpress.Blog
-
 
-
setBlogName(String) - Method in class net.bican.wordpress.Blog
-
 
-
setCategories(XmlRpcArray) - Method in class net.bican.wordpress.Page
-
 
-
setCategoryId(String) - Method in class net.bican.wordpress.Category
-
 
-
setCategoryName(String) - Method in class net.bican.wordpress.Category
-
 
-
setComment_id(Integer) - Method in class net.bican.wordpress.Comment
-
 
-
setContent(String) - Method in class net.bican.wordpress.Comment
-
 
-
setCustom_fields(XmlRpcArray) - Method in class net.bican.wordpress.Page
-
 
-
setDate_created_gmt(Date) - Method in class net.bican.wordpress.Comment
-
 
-
setDate_created_gmt(Date) - Method in class net.bican.wordpress.Page
-
 
-
setDate_created_gmt(Date) - Method in class net.bican.wordpress.PageDefinition
-
 
-
setDateCreated(Date) - Method in class net.bican.wordpress.Page
-
 
-
setDateCreated(Date) - Method in class net.bican.wordpress.PageDefinition
-
 
-
setDescription(String) - Method in class net.bican.wordpress.Category
-
 
-
setDescription(String) - Method in class net.bican.wordpress.Page
-
 
-
setDescription(String) - Method in class net.bican.wordpress.PostAndPageStatus
-
 
-
setDisplay_name(String) - Method in class net.bican.wordpress.Author
-
-
Display name of the author.
-
-
setExcerpt(String) - Method in class net.bican.wordpress.Page
-
 
-
setFile(String) - Method in class net.bican.wordpress.MediaObject
-
 
-
setFirstname(String) - Method in class net.bican.wordpress.User
-
 
-
setHtmlUrl(String) - Method in class net.bican.wordpress.Category
-
 
-
setId(String) - Method in class net.bican.wordpress.CustomField
-
 
-
setId(String) - Method in class net.bican.wordpress.MediaObject
-
 
-
setIsAdmin(Boolean) - Method in class net.bican.wordpress.Blog
-
 
-
setKey(String) - Method in class net.bican.wordpress.CustomField
-
 
-
setLastname(String) - Method in class net.bican.wordpress.User
-
 
-
setLink(String) - Method in class net.bican.wordpress.Comment
-
 
-
setLink(String) - Method in class net.bican.wordpress.Page
-
 
-
setMt_allow_comments(Integer) - Method in class net.bican.wordpress.Page
-
 
-
setMt_allow_pings(Integer) - Method in class net.bican.wordpress.Page
-
 
-
setMt_keywords(String) - Method in class net.bican.wordpress.Page
-
 
-
setMt_text_more(String) - Method in class net.bican.wordpress.Page
-
 
-
setNickname(String) - Method in class net.bican.wordpress.User
-
 
-
setPage_id(Integer) - Method in class net.bican.wordpress.Page
-
 
-
setPage_parent_id(String) - Method in class net.bican.wordpress.PageDefinition
-
 
-
setPage_status(String) - Method in class net.bican.wordpress.Page
-
 
-
setPage_title(String) - Method in class net.bican.wordpress.PageDefinition
-
 
-
setParent(Integer) - Method in class net.bican.wordpress.Comment
-
 
-
setParentId(String) - Method in class net.bican.wordpress.Category
-
 
-
setPermaLink(String) - Method in class net.bican.wordpress.Page
-
 
-
setPingIP(String) - Method in class net.bican.wordpress.Ping
-
 
-
setPingTitle(String) - Method in class net.bican.wordpress.Ping
-
 
-
setPingURL(String) - Method in class net.bican.wordpress.Ping
-
 
-
setPost_id(Integer) - Method in class net.bican.wordpress.Comment
-
 
-
setPost_status(String) - Method in class net.bican.wordpress.Page
-
 
-
setPost_title(String) - Method in class net.bican.wordpress.Comment
-
 
-
setPost_type(String) - Method in class net.bican.wordpress.Page
-
 
-
setPostid(Integer) - Method in class net.bican.wordpress.Page
-
 
-
setRssUrl(String) - Method in class net.bican.wordpress.Category
-
 
-
setSpam(Integer) - Method in class net.bican.wordpress.CommentCount
-
 
-
setStatus(String) - Method in class net.bican.wordpress.Comment
-
 
-
setStatus(String) - Method in class net.bican.wordpress.PostAndPageStatus
-
 
-
setTemplate(String) - Method in class net.bican.wordpress.Wordpress
-
 
-
setTitle(String) - Method in class net.bican.wordpress.Page
-
 
-
setTotal_comments(Integer) - Method in class net.bican.wordpress.CommentCount
-
 
-
setType(String) - Method in class net.bican.wordpress.MediaObject
-
 
-
setUrl(String) - Method in class net.bican.wordpress.Blog
-
 
-
setUrl(String) - Method in class net.bican.wordpress.MediaObject
-
 
-
setUrl(String) - Method in class net.bican.wordpress.User
-
 
-
setUser_id(String) - Method in class net.bican.wordpress.Author
-
-
User id of the author.
-
-
setUser_id(Integer) - Method in class net.bican.wordpress.Comment
-
 
-
setUser_login(String) - Method in class net.bican.wordpress.Author
-
-
Login name of the author.
-
-
setUserid(String) - Method in class net.bican.wordpress.Page
-
 
-
setUserid(Integer) - Method in class net.bican.wordpress.User
-
 
-
setValue(String) - Method in class net.bican.wordpress.CustomField
-
 
-
setWp_author(String) - Method in class net.bican.wordpress.Page
-
 
-
setWp_author_display_name(String) - Method in class net.bican.wordpress.Page
-
 
-
setWp_author_id(String) - Method in class net.bican.wordpress.Page
-
 
-
setWp_page_order(Integer) - Method in class net.bican.wordpress.Page
-
 
-
setWp_page_parent_id(Integer) - Method in class net.bican.wordpress.Page
-
 
-
setWp_page_parent_title(String) - Method in class net.bican.wordpress.Page
-
 
-
setWp_password(String) - Method in class net.bican.wordpress.Page
-
 
-
setWp_post_thumbnail(String) - Method in class net.bican.wordpress.Page
-
 
-
setWp_slug(String) - Method in class net.bican.wordpress.Page
-
 
-
skipTo(char) - Method in class org.json.JSONTokener
-
-
Skip characters until the next character is the requested character.
-
-
sortedKeys() - Method in class org.json.JSONObject
-
-
Get an enumeration of the keys of the JSONObject.
-
-
StringHeader - Interface in net.bican.wordpress
-
-
Interface for supplying a header for tabular output in toString()
-
-
stringToValue(String) - Static method in class org.json.JSONObject
-
-
Try to convert a string into a number, boolean, or null.
-
-
suggestCategories(String, Integer) - Method in class net.bican.wordpress.Wordpress
-
 
-
supportedMethods() - Method in class net.bican.wordpress.Wordpress
-
 
-
supportedTextFilters() - Method in class net.bican.wordpress.Wordpress
-
 
-
syntaxError(String) - Method in class org.json.JSONTokener
-
-
Make a JSONException to signal a syntax error.
-
-
-A B C D E F G H I J K L M N O P Q R S T U W X 
- -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/index-files/index-2.html b/doc/index-files/index-2.html deleted file mode 100644 index 76b9a1d..0000000 --- a/doc/index-files/index-2.html +++ /dev/null @@ -1,130 +0,0 @@ - - - - - - -B-Index (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - -
A B C D E F G H I J K L M N O P Q R S T U W X  - - -

B

-
-
back() - Method in class org.json.JSONTokener
-
-
Back up one character.
-
-
Blog - Class in net.bican.wordpress
-
-
Class that keeps the information on a blog for a user
-
-
Blog() - Constructor for class net.bican.wordpress.Blog
-
 
-
-A B C D E F G H I J K L M N O P Q R S T U W X 
- -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/index-files/index-20.html b/doc/index-files/index-20.html deleted file mode 100644 index dd7e4bd..0000000 --- a/doc/index-files/index-20.html +++ /dev/null @@ -1,167 +0,0 @@ - - - - - - -T-Index (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - -
A B C D E F G H I J K L M N O P Q R S T U W X  - - -

T

-
-
toJSONArray(JSONArray) - Method in class org.json.JSONObject
-
-
Produce a JSONArray containing the values of the members of this - JSONObject.
-
-
toJSONObject(JSONArray) - Method in class org.json.JSONArray
-
-
Produce a JSONObject by combining a JSONArray of names with the values of - this JSONArray.
-
-
toJSONString() - Method in interface org.json.JSONString
-
-
The toJSONString method allows a class to produce its own JSON - serialization.
-
-
toOneLinerString() - Method in class net.bican.wordpress.XmlRpcMapped
-
 
-
toString() - Method in class net.bican.wordpress.CustomField
-
-
(non-Javadoc)
-
-
toString() - Method in class net.bican.wordpress.XmlRpcMapped
-
-
(non-Javadoc)
-
-
toString() - Method in class org.json.JSONArray
-
-
Make a JSON text of this JSONArray.
-
-
toString(int) - Method in class org.json.JSONArray
-
-
Make a prettyprinted JSON text of this JSONArray.
-
-
toString() - Method in class org.json.JSONObject
-
-
Make a JSON text of this JSONObject.
-
-
toString(int) - Method in class org.json.JSONObject
-
-
Make a prettyprinted JSON text of this JSONObject.
-
-
toString() - Method in class org.json.JSONTokener
-
-
Make a printable string of this JSONTokener.
-
-
toXmlRpcStruct() - Method in class net.bican.wordpress.XmlRpcMapped
-
 
-
-A B C D E F G H I J K L M N O P Q R S T U W X 
- -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/index-files/index-21.html b/doc/index-files/index-21.html deleted file mode 100644 index b03da26..0000000 --- a/doc/index-files/index-21.html +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - -U-Index (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - -
A B C D E F G H I J K L M N O P Q R S T U W X  - - -

U

-
-
User - Class in net.bican.wordpress
-
-
Class that keeps user information from blogger style calls
-
-
User() - Constructor for class net.bican.wordpress.User
-
 
-
-A B C D E F G H I J K L M N O P Q R S T U W X 
- -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/index-files/index-22.html b/doc/index-files/index-22.html deleted file mode 100644 index 6af7406..0000000 --- a/doc/index-files/index-22.html +++ /dev/null @@ -1,140 +0,0 @@ - - - - - - -W-Index (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - -
A B C D E F G H I J K L M N O P Q R S T U W X  - - -

W

-
-
Wordpress - Class in net.bican.wordpress
-
-
The utility class that links xmlrpc calls to Java functions.
-
-
Wordpress(String, String, String) - Constructor for class net.bican.wordpress.Wordpress
-
 
-
WpCliConfiguration - Class in net.bican.wordpress.configuration
-
-
A composite configuration class that combines preferences and command line.
-
-
WpCliConfiguration(String[], Options, Class<?>) - Constructor for class net.bican.wordpress.configuration.WpCliConfiguration
-
 
-
write(Writer) - Method in class org.json.JSONArray
-
-
Write the contents of the JSONArray as JSON text to a writer.
-
-
write(Writer) - Method in class org.json.JSONObject
-
-
Write the contents of the JSONObject as JSON text to a writer.
-
-
-A B C D E F G H I J K L M N O P Q R S T U W X 
- -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/index-files/index-23.html b/doc/index-files/index-23.html deleted file mode 100644 index da3a44a..0000000 --- a/doc/index-files/index-23.html +++ /dev/null @@ -1,127 +0,0 @@ - - - - - - -X-Index (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - -
A B C D E F G H I J K L M N O P Q R S T U W X  - - -

X

-
-
XmlRpcMapped - Class in net.bican.wordpress
-
-
An object that has the capabilites of converting to/from - XmlRpcStruct.
-
-
XmlRpcMapped() - Constructor for class net.bican.wordpress.XmlRpcMapped
-
 
-
-A B C D E F G H I J K L M N O P Q R S T U W X 
- -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/index-files/index-3.html b/doc/index-files/index-3.html deleted file mode 100644 index a2e638c..0000000 --- a/doc/index-files/index-3.html +++ /dev/null @@ -1,158 +0,0 @@ - - - - - - -C-Index (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - -
A B C D E F G H I J K L M N O P Q R S T U W X  - - -

C

-
-
Category - Class in net.bican.wordpress
-
-
Category object for a blog.
-
-
Category() - Constructor for class net.bican.wordpress.Category
-
 
-
CliConfiguration - Class in net.bican.wordpress.configuration
-
-
Implement a simple CLI configuration in apache commons configuration style
-
-
CliConfiguration(String[], Options) - Constructor for class net.bican.wordpress.configuration.CliConfiguration
-
-
generates the configuration in terms of arguments and options
-
-
Comment - Class in net.bican.wordpress
-
-
A WordPress Comment object
-
-
Comment() - Constructor for class net.bican.wordpress.Comment
-
 
-
CommentCount - Class in net.bican.wordpress
-
-
Comment Count object for a blog post.
-
-
CommentCount() - Constructor for class net.bican.wordpress.CommentCount
-
 
-
CommentStatusList - Class in net.bican.wordpress
-
-
Comment status names for the blog
-
-
CommentStatusList() - Constructor for class net.bican.wordpress.CommentStatusList
-
 
-
CustomField - Class in net.bican.wordpress
-
-
This class represents custom fields in wordpress.
-
-
CustomField() - Constructor for class net.bican.wordpress.CustomField
-
 
-
-A B C D E F G H I J K L M N O P Q R S T U W X 
- -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/index-files/index-4.html b/doc/index-files/index-4.html deleted file mode 100644 index 8b53b41..0000000 --- a/doc/index-files/index-4.html +++ /dev/null @@ -1,136 +0,0 @@ - - - - - - -D-Index (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - -
A B C D E F G H I J K L M N O P Q R S T U W X  - - -

D

-
-
dehexchar(char) - Static method in class org.json.JSONTokener
-
-
Get the hex value of a character (base16).
-
-
deleteCategory(int) - Method in class net.bican.wordpress.Wordpress
-
 
-
deleteComment(int) - Method in class net.bican.wordpress.Wordpress
-
 
-
deletePage(int, String) - Method in class net.bican.wordpress.Wordpress
-
 
-
deletePost(int, String) - Method in class net.bican.wordpress.Wordpress
-
 
-
doubleToString(double) - Static method in class org.json.JSONObject
-
-
Produce a string from a double.
-
-
-A B C D E F G H I J K L M N O P Q R S T U W X 
- -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/index-files/index-5.html b/doc/index-files/index-5.html deleted file mode 100644 index f262b25..0000000 --- a/doc/index-files/index-5.html +++ /dev/null @@ -1,128 +0,0 @@ - - - - - - -E-Index (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - -
A B C D E F G H I J K L M N O P Q R S T U W X  - - -

E

-
-
editComment(Comment) - Method in class net.bican.wordpress.Wordpress
-
 
-
editPage(int, Page, String) - Method in class net.bican.wordpress.Wordpress
-
 
-
editPost(int, Page, String) - Method in class net.bican.wordpress.Wordpress
-
 
-
end() - Method in class org.json.JSONTokener
-
 
-
-A B C D E F G H I J K L M N O P Q R S T U W X 
- -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/index-files/index-6.html b/doc/index-files/index-6.html deleted file mode 100644 index cc60677..0000000 --- a/doc/index-files/index-6.html +++ /dev/null @@ -1,142 +0,0 @@ - - - - - - -F-Index (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - -
A B C D E F G H I J K L M N O P Q R S T U W X  - - -

F

-
-
FileParser - Class in net.bican.wordpress
-
-
Static methods for parsing files
-
-
FileParser() - Constructor for class net.bican.wordpress.FileParser
-
 
-
fromFile(File) - Static method in class net.bican.wordpress.Comment
-
-
Creates a comment object from file
-
-
fromFile(File) - Static method in class net.bican.wordpress.Page
-
-
Generates a new page class from the given file
-
-
fromJSONObject(JSONObject) - Method in class net.bican.wordpress.CustomField
-
-
(non-Javadoc)
-
-
fromJSONObject(JSONObject) - Method in interface net.bican.wordpress.JSONConvertable
-
 
-
fromXmlRpcStruct(XmlRpcStruct) - Method in class net.bican.wordpress.XmlRpcMapped
-
 
-
-A B C D E F G H I J K L M N O P Q R S T U W X 
- -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/index-files/index-7.html b/doc/index-files/index-7.html deleted file mode 100644 index ef81a03..0000000 --- a/doc/index-files/index-7.html +++ /dev/null @@ -1,446 +0,0 @@ - - - - - - -G-Index (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - -
A B C D E F G H I J K L M N O P Q R S T U W X  - - -

G

-
-
get(int) - Method in class org.json.JSONArray
-
-
Get the object value associated with an index.
-
-
get(String) - Method in class org.json.JSONObject
-
-
Get the value object associated with a key.
-
-
getApprove() - Method in class net.bican.wordpress.CommentStatusList
-
 
-
getApproved() - Method in class net.bican.wordpress.CommentCount
-
 
-
getAuthor() - Method in class net.bican.wordpress.Comment
-
 
-
getAuthor_email() - Method in class net.bican.wordpress.Comment
-
 
-
getAuthor_ip() - Method in class net.bican.wordpress.Comment
-
 
-
getAuthor_url() - Method in class net.bican.wordpress.Comment
-
 
-
getAuthors() - Method in class net.bican.wordpress.Wordpress
-
 
-
getAwaiting_moderation() - Method in class net.bican.wordpress.CommentCount
-
 
-
getBlogid() - Method in class net.bican.wordpress.Blog
-
 
-
getBlogName() - Method in class net.bican.wordpress.Blog
-
 
-
getBoolean(int) - Method in class org.json.JSONArray
-
-
Get the boolean value associated with an index.
-
-
getBoolean(String) - Method in class org.json.JSONObject
-
-
Get the boolean value associated with a key.
-
-
getCategories() - Method in class net.bican.wordpress.Page
-
 
-
getCategories() - Method in class net.bican.wordpress.Wordpress
-
 
-
getCategoryId() - Method in class net.bican.wordpress.Category
-
 
-
getCategoryName() - Method in class net.bican.wordpress.Category
-
 
-
getCause() - Method in exception org.json.JSONException
-
-
(non-Javadoc)
-
-
getComment(Integer) - Method in class net.bican.wordpress.Wordpress
-
 
-
getComment_id() - Method in class net.bican.wordpress.Comment
-
 
-
getComments(String, Integer, Integer, Integer) - Method in class net.bican.wordpress.Wordpress
-
 
-
getCommentsCount(Integer) - Method in class net.bican.wordpress.Wordpress
-
 
-
getCommentStatusList() - Method in class net.bican.wordpress.Wordpress
-
 
-
getContent() - Method in class net.bican.wordpress.Comment
-
 
-
getCustom_fields() - Method in class net.bican.wordpress.Page
-
 
-
getDate_created_gmt() - Method in class net.bican.wordpress.Comment
-
 
-
getDate_created_gmt() - Method in class net.bican.wordpress.Page
-
 
-
getDate_created_gmt() - Method in class net.bican.wordpress.PageDefinition
-
 
-
getDateCreated() - Method in class net.bican.wordpress.Page
-
 
-
getDateCreated() - Method in class net.bican.wordpress.PageDefinition
-
 
-
getDescription() - Method in class net.bican.wordpress.Category
-
 
-
getDescription() - Method in class net.bican.wordpress.Page
-
 
-
getDescription() - Method in class net.bican.wordpress.PostAndPageStatus
-
 
-
getDisplay_name() - Method in class net.bican.wordpress.Author
-
-
Display Name of the author.
-
-
getDouble(int) - Method in class org.json.JSONArray
-
-
Get the double value associated with an index.
-
-
getDouble(String) - Method in class org.json.JSONObject
-
-
Get the double value associated with a key.
-
-
getExcerpt() - Method in class net.bican.wordpress.Page
-
 
-
getFile() - Method in class net.bican.wordpress.MediaObject
-
 
-
getFirstname() - Method in class net.bican.wordpress.User
-
 
-
getHold() - Method in class net.bican.wordpress.CommentStatusList
-
 
-
getHtmlUrl() - Method in class net.bican.wordpress.Category
-
 
-
getId() - Method in class net.bican.wordpress.CustomField
-
 
-
getId() - Method in class net.bican.wordpress.MediaObject
-
 
-
getInt(int) - Method in class org.json.JSONArray
-
-
Get the int value associated with an index.
-
-
getInt(String) - Method in class org.json.JSONObject
-
-
Get the int value associated with a key.
-
-
getIsAdmin() - Method in class net.bican.wordpress.Blog
-
 
-
getJSONArray(int) - Method in class org.json.JSONArray
-
-
Get the JSONArray associated with an index.
-
-
getJSONArray(String) - Method in class org.json.JSONObject
-
-
Get the JSONArray value associated with a key.
-
-
getJSONObject(int) - Method in class org.json.JSONArray
-
-
Get the JSONObject associated with an index.
-
-
getJSONObject(String) - Method in class org.json.JSONObject
-
-
Get the JSONObject value associated with a key.
-
-
getKey() - Method in class net.bican.wordpress.CustomField
-
 
-
getLastname() - Method in class net.bican.wordpress.User
-
 
-
getLink() - Method in class net.bican.wordpress.Comment
-
 
-
getLink() - Method in class net.bican.wordpress.Page
-
 
-
getLong(int) - Method in class org.json.JSONArray
-
-
Get the long value associated with an index.
-
-
getLong(String) - Method in class org.json.JSONObject
-
-
Get the long value associated with a key.
-
-
getMt_allow_comments() - Method in class net.bican.wordpress.Page
-
 
-
getMt_allow_pings() - Method in class net.bican.wordpress.Page
-
 
-
getMt_keywords() - Method in class net.bican.wordpress.Page
-
 
-
getMt_text_more() - Method in class net.bican.wordpress.Page
-
 
-
getNames(JSONObject) - Static method in class org.json.JSONObject
-
-
Get an array of field names from a JSONObject.
-
-
getNames(Object) - Static method in class org.json.JSONObject
-
-
Get an array of field names from an Object.
-
-
getNickname() - Method in class net.bican.wordpress.User
-
 
-
getOptionValue(String) - Method in class net.bican.wordpress.configuration.WpCliConfiguration
-
 
-
getPage(int) - Method in class net.bican.wordpress.Wordpress
-
 
-
getPage_id() - Method in class net.bican.wordpress.Page
-
 
-
getPage_parent_id() - Method in class net.bican.wordpress.PageDefinition
-
 
-
getPage_status() - Method in class net.bican.wordpress.Page
-
 
-
getPage_title() - Method in class net.bican.wordpress.PageDefinition
-
 
-
getPageList() - Method in class net.bican.wordpress.Wordpress
-
 
-
getPages() - Method in class net.bican.wordpress.Wordpress
-
 
-
getPageStatusList() - Method in class net.bican.wordpress.Wordpress
-
 
-
getParent() - Method in class net.bican.wordpress.Comment
-
 
-
getParentId() - Method in class net.bican.wordpress.Category
-
 
-
getPermaLink() - Method in class net.bican.wordpress.Page
-
 
-
getPingbacks(String) - Method in class net.bican.wordpress.Wordpress
-
 
-
getPingIP() - Method in class net.bican.wordpress.Ping
-
 
-
getPingTitle() - Method in class net.bican.wordpress.Ping
-
 
-
getPingURL() - Method in class net.bican.wordpress.Ping
-
 
-
getPost(int) - Method in class net.bican.wordpress.Wordpress
-
 
-
getPost_id() - Method in class net.bican.wordpress.Comment
-
 
-
getPost_status() - Method in class net.bican.wordpress.Page
-
 
-
getPost_title() - Method in class net.bican.wordpress.Comment
-
 
-
getPost_type() - Method in class net.bican.wordpress.Page
-
 
-
getPostid() - Method in class net.bican.wordpress.Page
-
 
-
getPostStatusList() - Method in class net.bican.wordpress.Wordpress
-
 
-
getRecentPosts(int) - Method in class net.bican.wordpress.Wordpress
-
 
-
getRssUrl() - Method in class net.bican.wordpress.Category
-
 
-
getSpam() - Method in class net.bican.wordpress.CommentCount
-
 
-
getSpam() - Method in class net.bican.wordpress.CommentStatusList
-
 
-
getStatus() - Method in class net.bican.wordpress.Comment
-
 
-
getStatus() - Method in class net.bican.wordpress.PostAndPageStatus
-
 
-
getString(int) - Method in class org.json.JSONArray
-
-
Get the string associated with an index.
-
-
getString(String) - Method in class org.json.JSONObject
-
-
Get the string associated with a key.
-
-
getStringHeader() - Method in class net.bican.wordpress.Author
-
-
(non-Javadoc)
-
-
getStringHeader() - Method in class net.bican.wordpress.Category
-
-
(non-Javadoc)
-
-
getStringHeader() - Method in class net.bican.wordpress.Comment
-
-
(non-Javadoc)
-
-
getStringHeader() - Method in class net.bican.wordpress.CommentCount
-
-
(non-Javadoc)
-
-
getStringHeader() - Method in class net.bican.wordpress.CommentStatusList
-
-
(non-Javadoc)
-
-
getStringHeader() - Method in class net.bican.wordpress.CustomField
-
-
(non-Javadoc)
-
-
getStringHeader() - Method in class net.bican.wordpress.Page
-
-
(non-Javadoc)
-
-
getStringHeader() - Method in class net.bican.wordpress.PageDefinition
-
-
(non-Javadoc)
-
-
getStringHeader() - Method in class net.bican.wordpress.PostAndPageStatus
-
-
(non-Javadoc)
-
-
getStringHeader() - Method in interface net.bican.wordpress.StringHeader
-
 
-
getStringHeader() - Method in class net.bican.wordpress.User
-
-
(non-Javadoc)
-
-
getTemplate() - Method in class net.bican.wordpress.Wordpress
-
 
-
getTitle() - Method in class net.bican.wordpress.Page
-
 
-
getTotal_comments() - Method in class net.bican.wordpress.CommentCount
-
 
-
getTrackbackPings(int) - Method in class net.bican.wordpress.Wordpress
-
 
-
getType() - Method in class net.bican.wordpress.MediaObject
-
 
-
getUrl() - Method in class net.bican.wordpress.Blog
-
 
-
getUrl() - Method in class net.bican.wordpress.MediaObject
-
 
-
getUrl() - Method in class net.bican.wordpress.User
-
 
-
getUser_id() - Method in class net.bican.wordpress.Author
-
-
User id of the author.
-
-
getUser_id() - Method in class net.bican.wordpress.Comment
-
 
-
getUser_login() - Method in class net.bican.wordpress.Author
-
-
Login name of the author.
-
-
getUserid() - Method in class net.bican.wordpress.Page
-
 
-
getUserid() - Method in class net.bican.wordpress.User
-
 
-
getUserInfo() - Method in class net.bican.wordpress.Wordpress
-
 
-
getUsersBlogs() - Method in class net.bican.wordpress.Wordpress
-
 
-
getValue() - Method in class net.bican.wordpress.CustomField
-
 
-
getWp_author() - Method in class net.bican.wordpress.Page
-
 
-
getWp_author_display_name() - Method in class net.bican.wordpress.Page
-
 
-
getWp_author_id() - Method in class net.bican.wordpress.Page
-
 
-
getWp_page_order() - Method in class net.bican.wordpress.Page
-
 
-
getWp_page_parent_id() - Method in class net.bican.wordpress.Page
-
 
-
getWp_page_parent_title() - Method in class net.bican.wordpress.Page
-
 
-
getWp_password() - Method in class net.bican.wordpress.Page
-
 
-
getWp_post_thumbnail() - Method in class net.bican.wordpress.Page
-
 
-
getWp_slug() - Method in class net.bican.wordpress.Page
-
 
-
-A B C D E F G H I J K L M N O P Q R S T U W X 
- -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/index-files/index-8.html b/doc/index-files/index-8.html deleted file mode 100644 index 27e6957..0000000 --- a/doc/index-files/index-8.html +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - -H-Index (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - -
A B C D E F G H I J K L M N O P Q R S T U W X  - - -

H

-
-
has(String) - Method in class org.json.JSONObject
-
-
Determine if the JSONObject contains a specific key.
-
-
hasOption(String) - Method in class net.bican.wordpress.configuration.WpCliConfiguration
-
 
-
-A B C D E F G H I J K L M N O P Q R S T U W X 
- -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/index-files/index-9.html b/doc/index-files/index-9.html deleted file mode 100644 index b663075..0000000 --- a/doc/index-files/index-9.html +++ /dev/null @@ -1,139 +0,0 @@ - - - - - - -I-Index (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - -
A B C D E F G H I J K L M N O P Q R S T U W X  - - -

I

-
-
increment(String) - Method in class org.json.JSONObject
-
-
Increment a property of a JSONObject.
-
-
InvalidPostFormatException - Exception in net.bican.wordpress
-
-
Exception that is triggered via invalid input
-
-
InvalidPostFormatException() - Constructor for exception net.bican.wordpress.InvalidPostFormatException
-
 
-
isNull(int) - Method in class org.json.JSONArray
-
-
Determine if the value is null.
-
-
isNull(String) - Method in class org.json.JSONObject
-
-
Determine if the value associated with the key is null or if there is no - value.
-
-
-A B C D E F G H I J K L M N O P Q R S T U W X 
- -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/index.html b/doc/index.html deleted file mode 100644 index f7d64eb..0000000 --- a/doc/index.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - -wordpress-java 0.5.1 API - - - - - - - - - -<noscript> -<div>JavaScript is disabled on your browser.</div> -</noscript> -<h2>Frame Alert</h2> -<p>This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. Link to <a href="overview-summary.html">Non-frame version</a>.</p> - - - diff --git a/doc/net/bican/wordpress/Author.html b/doc/net/bican/wordpress/Author.html deleted file mode 100644 index e6442ea..0000000 --- a/doc/net/bican/wordpress/Author.html +++ /dev/null @@ -1,387 +0,0 @@ - - - - - - -Author (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - - -
-
net.bican.wordpress
-

Class Author

-
-
- -
- -
-
- -
-
- -
-
- - -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/net/bican/wordpress/Blog.html b/doc/net/bican/wordpress/Blog.html deleted file mode 100644 index b85b9f0..0000000 --- a/doc/net/bican/wordpress/Blog.html +++ /dev/null @@ -1,372 +0,0 @@ - - - - - - -Blog (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - - -
-
net.bican.wordpress
-

Class Blog

-
-
- -
- -
-
- -
-
- -
-
- - -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/net/bican/wordpress/Category.html b/doc/net/bican/wordpress/Category.html deleted file mode 100644 index c792053..0000000 --- a/doc/net/bican/wordpress/Category.html +++ /dev/null @@ -1,453 +0,0 @@ - - - - - - -Category (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - - -
-
net.bican.wordpress
-

Class Category

-
-
- -
- -
-
- -
-
- -
-
- - -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/net/bican/wordpress/Comment.html b/doc/net/bican/wordpress/Comment.html deleted file mode 100644 index 3aa5028..0000000 --- a/doc/net/bican/wordpress/Comment.html +++ /dev/null @@ -1,674 +0,0 @@ - - - - - - -Comment (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - - -
-
net.bican.wordpress
-

Class Comment

-
-
- -
- -
-
- -
-
- -
-
- - -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/net/bican/wordpress/CommentCount.html b/doc/net/bican/wordpress/CommentCount.html deleted file mode 100644 index 85ff94b..0000000 --- a/doc/net/bican/wordpress/CommentCount.html +++ /dev/null @@ -1,397 +0,0 @@ - - - - - - -CommentCount (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - - -
-
net.bican.wordpress
-

Class CommentCount

-
-
- -
- -
-
- -
-
- -
-
- - -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/net/bican/wordpress/CommentStatusList.html b/doc/net/bican/wordpress/CommentStatusList.html deleted file mode 100644 index 5d2833e..0000000 --- a/doc/net/bican/wordpress/CommentStatusList.html +++ /dev/null @@ -1,327 +0,0 @@ - - - - - - -CommentStatusList (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - - -
-
net.bican.wordpress
-

Class CommentStatusList

-
-
- -
- -
-
- -
-
- -
-
- - -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/net/bican/wordpress/CustomField.html b/doc/net/bican/wordpress/CustomField.html deleted file mode 100644 index 5fa3725..0000000 --- a/doc/net/bican/wordpress/CustomField.html +++ /dev/null @@ -1,409 +0,0 @@ - - - - - - -CustomField (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - - -
-
net.bican.wordpress
-

Class CustomField

-
-
- -
- -
-
- -
-
- -
-
- - -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/net/bican/wordpress/FileParser.html b/doc/net/bican/wordpress/FileParser.html deleted file mode 100644 index 4a54ea0..0000000 --- a/doc/net/bican/wordpress/FileParser.html +++ /dev/null @@ -1,292 +0,0 @@ - - - - - - -FileParser (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - - -
-
net.bican.wordpress
-

Class FileParser

-
-
- -
- -
-
- -
-
- -
-
- - -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/net/bican/wordpress/InvalidPostFormatException.html b/doc/net/bican/wordpress/InvalidPostFormatException.html deleted file mode 100644 index 11cad12..0000000 --- a/doc/net/bican/wordpress/InvalidPostFormatException.html +++ /dev/null @@ -1,255 +0,0 @@ - - - - - - -InvalidPostFormatException (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - - -
-
net.bican.wordpress
-

Class InvalidPostFormatException

-
-
- -
- -
-
- -
-
- -
-
- - -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/net/bican/wordpress/JSONConvertable.html b/doc/net/bican/wordpress/JSONConvertable.html deleted file mode 100644 index 8e7c526..0000000 --- a/doc/net/bican/wordpress/JSONConvertable.html +++ /dev/null @@ -1,216 +0,0 @@ - - - - - - -JSONConvertable (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - - -
-
net.bican.wordpress
-

Interface JSONConvertable

-
-
-
- -
-
- -
-
- -
-
- - -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/net/bican/wordpress/Main.html b/doc/net/bican/wordpress/Main.html deleted file mode 100644 index 75e845d..0000000 --- a/doc/net/bican/wordpress/Main.html +++ /dev/null @@ -1,265 +0,0 @@ - - - - - - -Main (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - - -
-
net.bican.wordpress
-

Class Main

-
-
- -
- -
-
- -
-
- -
-
- - -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/net/bican/wordpress/MediaObject.html b/doc/net/bican/wordpress/MediaObject.html deleted file mode 100644 index 752275a..0000000 --- a/doc/net/bican/wordpress/MediaObject.html +++ /dev/null @@ -1,372 +0,0 @@ - - - - - - -MediaObject (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - - -
-
net.bican.wordpress
-

Class MediaObject

-
-
- -
- -
-
- -
-
- -
-
- - -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/net/bican/wordpress/Page.html b/doc/net/bican/wordpress/Page.html deleted file mode 100644 index 52be74d..0000000 --- a/doc/net/bican/wordpress/Page.html +++ /dev/null @@ -1,1093 +0,0 @@ - - - - - - -Page (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - - -
-
net.bican.wordpress
-

Class Page

-
-
- -
- -
-
- -
-
- -
-
- - -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/net/bican/wordpress/PageDefinition.html b/doc/net/bican/wordpress/PageDefinition.html deleted file mode 100644 index bc3a96c..0000000 --- a/doc/net/bican/wordpress/PageDefinition.html +++ /dev/null @@ -1,397 +0,0 @@ - - - - - - -PageDefinition (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - - -
-
net.bican.wordpress
-

Class PageDefinition

-
-
- -
- -
-
- -
-
- -
-
- - -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/net/bican/wordpress/Ping.html b/doc/net/bican/wordpress/Ping.html deleted file mode 100644 index d666bd7..0000000 --- a/doc/net/bican/wordpress/Ping.html +++ /dev/null @@ -1,344 +0,0 @@ - - - - - - -Ping (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - - -
-
net.bican.wordpress
-

Class Ping

-
-
- -
- -
-
- -
-
- -
-
- - -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/net/bican/wordpress/PostAndPageStatus.html b/doc/net/bican/wordpress/PostAndPageStatus.html deleted file mode 100644 index 3100c73..0000000 --- a/doc/net/bican/wordpress/PostAndPageStatus.html +++ /dev/null @@ -1,341 +0,0 @@ - - - - - - -PostAndPageStatus (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - - -
-
net.bican.wordpress
-

Class PostAndPageStatus

-
-
- -
- -
-
- -
-
- -
-
- - -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/net/bican/wordpress/StringHeader.html b/doc/net/bican/wordpress/StringHeader.html deleted file mode 100644 index feaacf4..0000000 --- a/doc/net/bican/wordpress/StringHeader.html +++ /dev/null @@ -1,216 +0,0 @@ - - - - - - -StringHeader (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - - -
-
net.bican.wordpress
-

Interface StringHeader

-
-
-
- -
-
- -
-
- -
-
- - -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/net/bican/wordpress/User.html b/doc/net/bican/wordpress/User.html deleted file mode 100644 index 00ca8fc..0000000 --- a/doc/net/bican/wordpress/User.html +++ /dev/null @@ -1,425 +0,0 @@ - - - - - - -User (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - - -
-
net.bican.wordpress
-

Class User

-
-
- -
- -
-
- -
-
- -
-
- - -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/net/bican/wordpress/Wordpress.html b/doc/net/bican/wordpress/Wordpress.html deleted file mode 100644 index 33e137a..0000000 --- a/doc/net/bican/wordpress/Wordpress.html +++ /dev/null @@ -1,952 +0,0 @@ - - - - - - -Wordpress (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - - -
-
net.bican.wordpress
-

Class Wordpress

-
-
- -
- -
-
- -
-
- -
-
- - -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/net/bican/wordpress/XmlRpcMapped.html b/doc/net/bican/wordpress/XmlRpcMapped.html deleted file mode 100644 index 0efee68..0000000 --- a/doc/net/bican/wordpress/XmlRpcMapped.html +++ /dev/null @@ -1,315 +0,0 @@ - - - - - - -XmlRpcMapped (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - - -
-
net.bican.wordpress
-

Class XmlRpcMapped

-
-
- -
- -
-
- -
-
- -
-
- - -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/net/bican/wordpress/class-use/Author.html b/doc/net/bican/wordpress/class-use/Author.html deleted file mode 100644 index 09452dd..0000000 --- a/doc/net/bican/wordpress/class-use/Author.html +++ /dev/null @@ -1,157 +0,0 @@ - - - - - - -Uses of Class net.bican.wordpress.Author (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - -
-

Uses of Class
net.bican.wordpress.Author

-
-
- -
- -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/net/bican/wordpress/class-use/Blog.html b/doc/net/bican/wordpress/class-use/Blog.html deleted file mode 100644 index b52e6dd..0000000 --- a/doc/net/bican/wordpress/class-use/Blog.html +++ /dev/null @@ -1,157 +0,0 @@ - - - - - - -Uses of Class net.bican.wordpress.Blog (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - -
-

Uses of Class
net.bican.wordpress.Blog

-
-
- -
- -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/net/bican/wordpress/class-use/Category.html b/doc/net/bican/wordpress/class-use/Category.html deleted file mode 100644 index dffa709..0000000 --- a/doc/net/bican/wordpress/class-use/Category.html +++ /dev/null @@ -1,162 +0,0 @@ - - - - - - -Uses of Class net.bican.wordpress.Category (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - -
-

Uses of Class
net.bican.wordpress.Category

-
-
- -
- -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/net/bican/wordpress/class-use/Comment.html b/doc/net/bican/wordpress/class-use/Comment.html deleted file mode 100644 index 0d8cac4..0000000 --- a/doc/net/bican/wordpress/class-use/Comment.html +++ /dev/null @@ -1,192 +0,0 @@ - - - - - - -Uses of Class net.bican.wordpress.Comment (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - -
-

Uses of Class
net.bican.wordpress.Comment

-
-
- -
- -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/net/bican/wordpress/class-use/CommentCount.html b/doc/net/bican/wordpress/class-use/CommentCount.html deleted file mode 100644 index 0e07677..0000000 --- a/doc/net/bican/wordpress/class-use/CommentCount.html +++ /dev/null @@ -1,157 +0,0 @@ - - - - - - -Uses of Class net.bican.wordpress.CommentCount (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - -
-

Uses of Class
net.bican.wordpress.CommentCount

-
-
- -
- -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/net/bican/wordpress/class-use/CommentStatusList.html b/doc/net/bican/wordpress/class-use/CommentStatusList.html deleted file mode 100644 index d589353..0000000 --- a/doc/net/bican/wordpress/class-use/CommentStatusList.html +++ /dev/null @@ -1,157 +0,0 @@ - - - - - - -Uses of Class net.bican.wordpress.CommentStatusList (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - -
-

Uses of Class
net.bican.wordpress.CommentStatusList

-
-
- -
- -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/net/bican/wordpress/class-use/CustomField.html b/doc/net/bican/wordpress/class-use/CustomField.html deleted file mode 100644 index 544a635..0000000 --- a/doc/net/bican/wordpress/class-use/CustomField.html +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - -Uses of Class net.bican.wordpress.CustomField (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - -
-

Uses of Class
net.bican.wordpress.CustomField

-
-
No usage of net.bican.wordpress.CustomField
- -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/net/bican/wordpress/class-use/FileParser.html b/doc/net/bican/wordpress/class-use/FileParser.html deleted file mode 100644 index 527b7dd..0000000 --- a/doc/net/bican/wordpress/class-use/FileParser.html +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - -Uses of Class net.bican.wordpress.FileParser (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - -
-

Uses of Class
net.bican.wordpress.FileParser

-
-
No usage of net.bican.wordpress.FileParser
- -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/net/bican/wordpress/class-use/InvalidPostFormatException.html b/doc/net/bican/wordpress/class-use/InvalidPostFormatException.html deleted file mode 100644 index 8324661..0000000 --- a/doc/net/bican/wordpress/class-use/InvalidPostFormatException.html +++ /dev/null @@ -1,171 +0,0 @@ - - - - - - -Uses of Class net.bican.wordpress.InvalidPostFormatException (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - -
-

Uses of Class
net.bican.wordpress.InvalidPostFormatException

-
-
- -
- -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/net/bican/wordpress/class-use/JSONConvertable.html b/doc/net/bican/wordpress/class-use/JSONConvertable.html deleted file mode 100644 index acdb0de..0000000 --- a/doc/net/bican/wordpress/class-use/JSONConvertable.html +++ /dev/null @@ -1,159 +0,0 @@ - - - - - - -Uses of Interface net.bican.wordpress.JSONConvertable (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - -
-

Uses of Interface
net.bican.wordpress.JSONConvertable

-
-
- -
- -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/net/bican/wordpress/class-use/Main.html b/doc/net/bican/wordpress/class-use/Main.html deleted file mode 100644 index b2df004..0000000 --- a/doc/net/bican/wordpress/class-use/Main.html +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - -Uses of Class net.bican.wordpress.Main (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - -
-

Uses of Class
net.bican.wordpress.Main

-
-
No usage of net.bican.wordpress.Main
- -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/net/bican/wordpress/class-use/MediaObject.html b/doc/net/bican/wordpress/class-use/MediaObject.html deleted file mode 100644 index e7d92bf..0000000 --- a/doc/net/bican/wordpress/class-use/MediaObject.html +++ /dev/null @@ -1,159 +0,0 @@ - - - - - - -Uses of Class net.bican.wordpress.MediaObject (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - -
-

Uses of Class
net.bican.wordpress.MediaObject

-
-
- -
- -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/net/bican/wordpress/class-use/Page.html b/doc/net/bican/wordpress/class-use/Page.html deleted file mode 100644 index a386509..0000000 --- a/doc/net/bican/wordpress/class-use/Page.html +++ /dev/null @@ -1,215 +0,0 @@ - - - - - - -Uses of Class net.bican.wordpress.Page (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - -
-

Uses of Class
net.bican.wordpress.Page

-
-
- -
- -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/net/bican/wordpress/class-use/PageDefinition.html b/doc/net/bican/wordpress/class-use/PageDefinition.html deleted file mode 100644 index 6da5a37..0000000 --- a/doc/net/bican/wordpress/class-use/PageDefinition.html +++ /dev/null @@ -1,157 +0,0 @@ - - - - - - -Uses of Class net.bican.wordpress.PageDefinition (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - -
-

Uses of Class
net.bican.wordpress.PageDefinition

-
-
- -
- -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/net/bican/wordpress/class-use/Ping.html b/doc/net/bican/wordpress/class-use/Ping.html deleted file mode 100644 index 023fb80..0000000 --- a/doc/net/bican/wordpress/class-use/Ping.html +++ /dev/null @@ -1,157 +0,0 @@ - - - - - - -Uses of Class net.bican.wordpress.Ping (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - -
-

Uses of Class
net.bican.wordpress.Ping

-
-
- -
- -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/net/bican/wordpress/class-use/PostAndPageStatus.html b/doc/net/bican/wordpress/class-use/PostAndPageStatus.html deleted file mode 100644 index 9354b1b..0000000 --- a/doc/net/bican/wordpress/class-use/PostAndPageStatus.html +++ /dev/null @@ -1,161 +0,0 @@ - - - - - - -Uses of Class net.bican.wordpress.PostAndPageStatus (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - -
-

Uses of Class
net.bican.wordpress.PostAndPageStatus

-
-
- -
- -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/net/bican/wordpress/class-use/StringHeader.html b/doc/net/bican/wordpress/class-use/StringHeader.html deleted file mode 100644 index c18ae26..0000000 --- a/doc/net/bican/wordpress/class-use/StringHeader.html +++ /dev/null @@ -1,213 +0,0 @@ - - - - - - -Uses of Interface net.bican.wordpress.StringHeader (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - -
-

Uses of Interface
net.bican.wordpress.StringHeader

-
-
- -
- -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/net/bican/wordpress/class-use/User.html b/doc/net/bican/wordpress/class-use/User.html deleted file mode 100644 index e24334d..0000000 --- a/doc/net/bican/wordpress/class-use/User.html +++ /dev/null @@ -1,157 +0,0 @@ - - - - - - -Uses of Class net.bican.wordpress.User (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - -
-

Uses of Class
net.bican.wordpress.User

-
-
- -
- -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/net/bican/wordpress/class-use/Wordpress.html b/doc/net/bican/wordpress/class-use/Wordpress.html deleted file mode 100644 index 18a0548..0000000 --- a/doc/net/bican/wordpress/class-use/Wordpress.html +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - -Uses of Class net.bican.wordpress.Wordpress (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - -
-

Uses of Class
net.bican.wordpress.Wordpress

-
-
No usage of net.bican.wordpress.Wordpress
- -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/net/bican/wordpress/class-use/XmlRpcMapped.html b/doc/net/bican/wordpress/class-use/XmlRpcMapped.html deleted file mode 100644 index 93806a0..0000000 --- a/doc/net/bican/wordpress/class-use/XmlRpcMapped.html +++ /dev/null @@ -1,231 +0,0 @@ - - - - - - -Uses of Class net.bican.wordpress.XmlRpcMapped (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - -
-

Uses of Class
net.bican.wordpress.XmlRpcMapped

-
-
- -
- -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/net/bican/wordpress/configuration/CliConfiguration.html b/doc/net/bican/wordpress/configuration/CliConfiguration.html deleted file mode 100644 index 59d5f1e..0000000 --- a/doc/net/bican/wordpress/configuration/CliConfiguration.html +++ /dev/null @@ -1,297 +0,0 @@ - - - - - - -CliConfiguration (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - - -
-
net.bican.wordpress.configuration
-

Class CliConfiguration

-
-
- -
- -
-
- -
-
- -
-
- - -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/net/bican/wordpress/configuration/PreferencesConfiguration.html b/doc/net/bican/wordpress/configuration/PreferencesConfiguration.html deleted file mode 100644 index 1a0a5f3..0000000 --- a/doc/net/bican/wordpress/configuration/PreferencesConfiguration.html +++ /dev/null @@ -1,288 +0,0 @@ - - - - - - -PreferencesConfiguration (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - - -
-
net.bican.wordpress.configuration
-

Class PreferencesConfiguration

-
-
- -
- -
-
- -
-
- -
-
- - -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/net/bican/wordpress/configuration/WpCliConfiguration.html b/doc/net/bican/wordpress/configuration/WpCliConfiguration.html deleted file mode 100644 index 3b28e35..0000000 --- a/doc/net/bican/wordpress/configuration/WpCliConfiguration.html +++ /dev/null @@ -1,286 +0,0 @@ - - - - - - -WpCliConfiguration (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - - -
-
net.bican.wordpress.configuration
-

Class WpCliConfiguration

-
-
- -
- -
-
- -
-
- -
-
- - -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/net/bican/wordpress/configuration/class-use/CliConfiguration.html b/doc/net/bican/wordpress/configuration/class-use/CliConfiguration.html deleted file mode 100644 index f707640..0000000 --- a/doc/net/bican/wordpress/configuration/class-use/CliConfiguration.html +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - -Uses of Class net.bican.wordpress.configuration.CliConfiguration (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - -
-

Uses of Class
net.bican.wordpress.configuration.CliConfiguration

-
-
No usage of net.bican.wordpress.configuration.CliConfiguration
- -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/net/bican/wordpress/configuration/class-use/PreferencesConfiguration.html b/doc/net/bican/wordpress/configuration/class-use/PreferencesConfiguration.html deleted file mode 100644 index 85e277b..0000000 --- a/doc/net/bican/wordpress/configuration/class-use/PreferencesConfiguration.html +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - -Uses of Class net.bican.wordpress.configuration.PreferencesConfiguration (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - -
-

Uses of Class
net.bican.wordpress.configuration.PreferencesConfiguration

-
-
No usage of net.bican.wordpress.configuration.PreferencesConfiguration
- -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/net/bican/wordpress/configuration/class-use/WpCliConfiguration.html b/doc/net/bican/wordpress/configuration/class-use/WpCliConfiguration.html deleted file mode 100644 index 20b0106..0000000 --- a/doc/net/bican/wordpress/configuration/class-use/WpCliConfiguration.html +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - -Uses of Class net.bican.wordpress.configuration.WpCliConfiguration (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - -
-

Uses of Class
net.bican.wordpress.configuration.WpCliConfiguration

-
-
No usage of net.bican.wordpress.configuration.WpCliConfiguration
- -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/net/bican/wordpress/configuration/package-frame.html b/doc/net/bican/wordpress/configuration/package-frame.html deleted file mode 100644 index 2f02372..0000000 --- a/doc/net/bican/wordpress/configuration/package-frame.html +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - -net.bican.wordpress.configuration (wordpress-java 0.5.1 API) - - - - -

net.bican.wordpress.configuration

-
-

Classes

- -
- - diff --git a/doc/net/bican/wordpress/configuration/package-summary.html b/doc/net/bican/wordpress/configuration/package-summary.html deleted file mode 100644 index 15068a4..0000000 --- a/doc/net/bican/wordpress/configuration/package-summary.html +++ /dev/null @@ -1,147 +0,0 @@ - - - - - - -net.bican.wordpress.configuration (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - -
-

Package net.bican.wordpress.configuration

-
-
- -
- -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/net/bican/wordpress/configuration/package-tree.html b/doc/net/bican/wordpress/configuration/package-tree.html deleted file mode 100644 index 0df6c4d..0000000 --- a/doc/net/bican/wordpress/configuration/package-tree.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - -net.bican.wordpress.configuration Class Hierarchy (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - -
-

Hierarchy For Package net.bican.wordpress.configuration

-Package Hierarchies: - -
-
-

Class Hierarchy

- -
- -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/net/bican/wordpress/configuration/package-use.html b/doc/net/bican/wordpress/configuration/package-use.html deleted file mode 100644 index 453a2eb..0000000 --- a/doc/net/bican/wordpress/configuration/package-use.html +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - -Uses of Package net.bican.wordpress.configuration (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - -
-

Uses of Package
net.bican.wordpress.configuration

-
-
No usage of net.bican.wordpress.configuration
- -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/net/bican/wordpress/example/Main.html b/doc/net/bican/wordpress/example/Main.html deleted file mode 100644 index b5ffe15..0000000 --- a/doc/net/bican/wordpress/example/Main.html +++ /dev/null @@ -1,270 +0,0 @@ - - - - - - -Main (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - - -
-
net.bican.wordpress.example
-

Class Main

-
-
- -
- -
-
- -
-
- -
-
- - -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/net/bican/wordpress/example/class-use/Main.html b/doc/net/bican/wordpress/example/class-use/Main.html deleted file mode 100644 index 4f7455e..0000000 --- a/doc/net/bican/wordpress/example/class-use/Main.html +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - -Uses of Class net.bican.wordpress.example.Main (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - -
-

Uses of Class
net.bican.wordpress.example.Main

-
-
No usage of net.bican.wordpress.example.Main
- -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/net/bican/wordpress/example/package-frame.html b/doc/net/bican/wordpress/example/package-frame.html deleted file mode 100644 index 702ce22..0000000 --- a/doc/net/bican/wordpress/example/package-frame.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - -net.bican.wordpress.example (wordpress-java 0.5.1 API) - - - - -

net.bican.wordpress.example

-
-

Classes

- -
- - diff --git a/doc/net/bican/wordpress/example/package-summary.html b/doc/net/bican/wordpress/example/package-summary.html deleted file mode 100644 index 74fada6..0000000 --- a/doc/net/bican/wordpress/example/package-summary.html +++ /dev/null @@ -1,140 +0,0 @@ - - - - - - -net.bican.wordpress.example (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - -
-

Package net.bican.wordpress.example

-
-
- -
- -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/net/bican/wordpress/example/package-tree.html b/doc/net/bican/wordpress/example/package-tree.html deleted file mode 100644 index b659644..0000000 --- a/doc/net/bican/wordpress/example/package-tree.html +++ /dev/null @@ -1,130 +0,0 @@ - - - - - - -net.bican.wordpress.example Class Hierarchy (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - -
-

Hierarchy For Package net.bican.wordpress.example

-Package Hierarchies: - -
-
-

Class Hierarchy

- -
- -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/net/bican/wordpress/example/package-use.html b/doc/net/bican/wordpress/example/package-use.html deleted file mode 100644 index 9b47fb8..0000000 --- a/doc/net/bican/wordpress/example/package-use.html +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - -Uses of Package net.bican.wordpress.example (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - -
-

Uses of Package
net.bican.wordpress.example

-
-
No usage of net.bican.wordpress.example
- -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/net/bican/wordpress/package-frame.html b/doc/net/bican/wordpress/package-frame.html deleted file mode 100644 index 513aeee..0000000 --- a/doc/net/bican/wordpress/package-frame.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - -net.bican.wordpress (wordpress-java 0.5.1 API) - - - - -

net.bican.wordpress

-
-

Interfaces

- -

Classes

- -

Exceptions

- -
- - diff --git a/doc/net/bican/wordpress/package-summary.html b/doc/net/bican/wordpress/package-summary.html deleted file mode 100644 index b28d671..0000000 --- a/doc/net/bican/wordpress/package-summary.html +++ /dev/null @@ -1,274 +0,0 @@ - - - - - - -net.bican.wordpress (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - -
-

Package net.bican.wordpress

-
-
- -
- -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/net/bican/wordpress/package-tree.html b/doc/net/bican/wordpress/package-tree.html deleted file mode 100644 index 92d64e9..0000000 --- a/doc/net/bican/wordpress/package-tree.html +++ /dev/null @@ -1,163 +0,0 @@ - - - - - - -net.bican.wordpress Class Hierarchy (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - -
-

Hierarchy For Package net.bican.wordpress

-Package Hierarchies: - -
-
-

Class Hierarchy

- -

Interface Hierarchy

- -
- -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/net/bican/wordpress/package-use.html b/doc/net/bican/wordpress/package-use.html deleted file mode 100644 index 207d5a0..0000000 --- a/doc/net/bican/wordpress/package-use.html +++ /dev/null @@ -1,228 +0,0 @@ - - - - - - -Uses of Package net.bican.wordpress (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - -
-

Uses of Package
net.bican.wordpress

-
-
- -
- -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/org/json/JSONArray.html b/doc/org/json/JSONArray.html deleted file mode 100644 index 6842ea1..0000000 --- a/doc/org/json/JSONArray.html +++ /dev/null @@ -1,1301 +0,0 @@ - - - - - - -JSONArray (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - - -
-
org.json
-

Class JSONArray

-
-
- -
- -
-
- -
-
- -
-
- - -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/org/json/JSONException.html b/doc/org/json/JSONException.html deleted file mode 100644 index 847dd42..0000000 --- a/doc/org/json/JSONException.html +++ /dev/null @@ -1,309 +0,0 @@ - - - - - - -JSONException (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - - -
-
org.json
-

Class JSONException

-
-
- -
- -
-
- -
-
- -
-
- - -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/org/json/JSONObject.html b/doc/org/json/JSONObject.html deleted file mode 100644 index f778521..0000000 --- a/doc/org/json/JSONObject.html +++ /dev/null @@ -1,1574 +0,0 @@ - - - - - - -JSONObject (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - - -
-
org.json
-

Class JSONObject

-
-
- -
- -
-
- -
-
- -
-
- - -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/org/json/JSONString.html b/doc/org/json/JSONString.html deleted file mode 100644 index bdf3847..0000000 --- a/doc/org/json/JSONString.html +++ /dev/null @@ -1,220 +0,0 @@ - - - - - - -JSONString (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - - -
-
org.json
-

Interface JSONString

-
-
-
- -
-
- -
-
- -
-
- - -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/org/json/JSONTokener.html b/doc/org/json/JSONTokener.html deleted file mode 100644 index a42ed74..0000000 --- a/doc/org/json/JSONTokener.html +++ /dev/null @@ -1,585 +0,0 @@ - - - - - - -JSONTokener (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - - -
-
org.json
-

Class JSONTokener

-
-
- -
- -
-
- -
-
- -
-
- - -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/org/json/class-use/JSONArray.html b/doc/org/json/class-use/JSONArray.html deleted file mode 100644 index 2d6df36..0000000 --- a/doc/org/json/class-use/JSONArray.html +++ /dev/null @@ -1,309 +0,0 @@ - - - - - - -Uses of Class org.json.JSONArray (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - -
-

Uses of Class
org.json.JSONArray

-
-
- -
- -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/org/json/class-use/JSONException.html b/doc/org/json/class-use/JSONException.html deleted file mode 100644 index 7bcf82f..0000000 --- a/doc/org/json/class-use/JSONException.html +++ /dev/null @@ -1,562 +0,0 @@ - - - - - - -Uses of Class org.json.JSONException (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - -
-

Uses of Class
org.json.JSONException

-
-
- -
- -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/org/json/class-use/JSONObject.html b/doc/org/json/class-use/JSONObject.html deleted file mode 100644 index 613d187..0000000 --- a/doc/org/json/class-use/JSONObject.html +++ /dev/null @@ -1,329 +0,0 @@ - - - - - - -Uses of Class org.json.JSONObject (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - -
-

Uses of Class
org.json.JSONObject

-
-
- -
- -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/org/json/class-use/JSONString.html b/doc/org/json/class-use/JSONString.html deleted file mode 100644 index e567134..0000000 --- a/doc/org/json/class-use/JSONString.html +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - -Uses of Interface org.json.JSONString (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - -
-

Uses of Interface
org.json.JSONString

-
-
No usage of org.json.JSONString
- -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/org/json/class-use/JSONTokener.html b/doc/org/json/class-use/JSONTokener.html deleted file mode 100644 index 082fb47..0000000 --- a/doc/org/json/class-use/JSONTokener.html +++ /dev/null @@ -1,162 +0,0 @@ - - - - - - -Uses of Class org.json.JSONTokener (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - -
-

Uses of Class
org.json.JSONTokener

-
-
- -
- -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/org/json/package-frame.html b/doc/org/json/package-frame.html deleted file mode 100644 index 2747134..0000000 --- a/doc/org/json/package-frame.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - -org.json (wordpress-java 0.5.1 API) - - - - -

org.json

-
-

Interfaces

- -

Classes

- -

Exceptions

- -
- - diff --git a/doc/org/json/package-summary.html b/doc/org/json/package-summary.html deleted file mode 100644 index 99db4cc..0000000 --- a/doc/org/json/package-summary.html +++ /dev/null @@ -1,187 +0,0 @@ - - - - - - -org.json (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - -
-

Package org.json

-
-
- -
- -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/org/json/package-tree.html b/doc/org/json/package-tree.html deleted file mode 100644 index 4b45993..0000000 --- a/doc/org/json/package-tree.html +++ /dev/null @@ -1,145 +0,0 @@ - - - - - - -org.json Class Hierarchy (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - -
-

Hierarchy For Package org.json

-Package Hierarchies: - -
-
-

Class Hierarchy

- -

Interface Hierarchy

- -
- -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/org/json/package-use.html b/doc/org/json/package-use.html deleted file mode 100644 index aead4a4..0000000 --- a/doc/org/json/package-use.html +++ /dev/null @@ -1,189 +0,0 @@ - - - - - - -Uses of Package org.json (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - -
-

Uses of Package
org.json

-
-
- -
- -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/overview-frame.html b/doc/overview-frame.html deleted file mode 100644 index 888004e..0000000 --- a/doc/overview-frame.html +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - -Overview List (wordpress-java 0.5.1 API) - - - - -
All Classes
-
-

Packages

- -
-

 

- - diff --git a/doc/overview-summary.html b/doc/overview-summary.html deleted file mode 100644 index c19bc40..0000000 --- a/doc/overview-summary.html +++ /dev/null @@ -1,143 +0,0 @@ - - - - - - -Overview (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - -
-

Wordpress-java

-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
Packages 
PackageDescription
net.bican.wordpress 
net.bican.wordpress.configuration 
net.bican.wordpress.example 
org.json 
-
- -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/overview-tree.html b/doc/overview-tree.html deleted file mode 100644 index acc46b2..0000000 --- a/doc/overview-tree.html +++ /dev/null @@ -1,187 +0,0 @@ - - - - - - -Class Hierarchy (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - -
-

Hierarchy For All Packages

-Package Hierarchies: - -
-
-

Class Hierarchy

- -

Interface Hierarchy

- -
- -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/package-list b/doc/package-list deleted file mode 100644 index ccefa53..0000000 --- a/doc/package-list +++ /dev/null @@ -1,4 +0,0 @@ -net.bican.wordpress -net.bican.wordpress.configuration -net.bican.wordpress.example -org.json diff --git a/doc/resources/background.gif b/doc/resources/background.gif deleted file mode 100644 index f471940..0000000 Binary files a/doc/resources/background.gif and /dev/null differ diff --git a/doc/resources/tab.gif b/doc/resources/tab.gif deleted file mode 100644 index 1a73a83..0000000 Binary files a/doc/resources/tab.gif and /dev/null differ diff --git a/doc/resources/titlebar.gif b/doc/resources/titlebar.gif deleted file mode 100644 index 17443b3..0000000 Binary files a/doc/resources/titlebar.gif and /dev/null differ diff --git a/doc/resources/titlebar_end.gif b/doc/resources/titlebar_end.gif deleted file mode 100644 index 3ad78d4..0000000 Binary files a/doc/resources/titlebar_end.gif and /dev/null differ diff --git a/doc/serialized-form.html b/doc/serialized-form.html deleted file mode 100644 index 5954950..0000000 --- a/doc/serialized-form.html +++ /dev/null @@ -1,161 +0,0 @@ - - - - - - -Serialized Form (wordpress-java 0.5.1 API) - - - - - - - -
- - - - - -
- - -
-

Serialized Form

-
-
- -
- -
- - - - - -
- - -

Copyright © 2012-2015 Can Bican. All Rights Reserved.

- - diff --git a/doc/src-html/net/bican/wordpress/Author.html b/doc/src-html/net/bican/wordpress/Author.html deleted file mode 100644 index 47b2a17..0000000 --- a/doc/src-html/net/bican/wordpress/Author.html +++ /dev/null @@ -1,162 +0,0 @@ - - - -Source code - - - -
-
001/*
-002 * 
-003 * Wordpress-java
-004 * http://code.google.com/p/wordpress-java/
-005 * 
-006 * Copyright 2012 Can Bican <can@bican.net>
-007 * See the file 'COPYING' in the distribution for licensing terms.
-008 * 
-009 */
-010package net.bican.wordpress;
-011
-012/**
-013 * 
-014 * Author object for a blog.
-015 * 
-016 * @author Can Bican &lt;can@bican.net&gt;
-017 * 
-018 */
-019public class Author extends XmlRpcMapped implements StringHeader {
-020  String display_name;
-021
-022  String user_id;
-023
-024  String user_login;
-025
-026  /**
-027   * Display Name of the author.
-028   * 
-029   * @return the display_name
-030   */
-031  public String getDisplay_name() {
-032    return this.display_name;
-033  }
-034
-035  /**
-036   * User id of the author.
-037   * 
-038   * @return the user_id
-039   */
-040  public String getUser_id() {
-041    return this.user_id;
-042  }
-043
-044  /**
-045   * Login name of the author.
-046   * 
-047   * @return the user_login
-048   */
-049  public String getUser_login() {
-050    return this.user_login;
-051  }
-052
-053  /**
-054   * Display name of the author.
-055   * 
-056   * @param display_name the display_name to set
-057   */
-058  public void setDisplay_name(String display_name) {
-059    this.display_name = display_name;
-060  }
-061
-062  /**
-063   * User id of the author.
-064   * 
-065   * @param user_id the user_id to set
-066   */
-067  public void setUser_id(String user_id) {
-068    this.user_id = user_id;
-069  }
-070
-071  /**
-072   * Login name of the author.
-073   * 
-074   * @param user_login the user_login to set
-075   */
-076  public void setUser_login(String user_login) {
-077    this.user_login = user_login;
-078  }
-079
-080  /**
-081   * (non-Javadoc)
-082   * 
-083   * @see net.bican.wordpress.StringHeader#getStringHeader()
-084   */
-085  @Override
-086  @SuppressWarnings("nls")
-087  public String getStringHeader() {
-088    return "User_id:User_login:display_name";
-089  }
-090}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - diff --git a/doc/src-html/net/bican/wordpress/Blog.html b/doc/src-html/net/bican/wordpress/Blog.html deleted file mode 100644 index 351f60f..0000000 --- a/doc/src-html/net/bican/wordpress/Blog.html +++ /dev/null @@ -1,155 +0,0 @@ - - - -Source code - - - -
-
001/*
-002 * 
-003 * Wordpress-java
-004 * http://code.google.com/p/wordpress-java/
-005 * 
-006 * Copyright 2012 Can Bican <can@bican.net>
-007 * See the file 'COPYING' in the distribution for licensing terms.
-008 * 
-009 */
-010package net.bican.wordpress;
-011
-012/**
-013 * 
-014 * Class that keeps the information on a blog for a user
-015 * 
-016 * @author Can Bican &lt;can@bican.net&gt;
-017 * 
-018 */
-019public class Blog extends XmlRpcMapped {
-020  Boolean isAdmin;
-021
-022  String url;
-023
-024  String blogid;
-025
-026  String blogName;
-027
-028  /**
-029   * @return the isAdmin
-030   */
-031  public Boolean getIsAdmin() {
-032    return this.isAdmin;
-033  }
-034
-035  /**
-036   * @param isAdmin the isAdmin to set
-037   */
-038  public void setIsAdmin(Boolean isAdmin) {
-039    this.isAdmin = isAdmin;
-040  }
-041
-042  /**
-043   * @return the url
-044   */
-045  public String getUrl() {
-046    return this.url;
-047  }
-048
-049  /**
-050   * @param url the url to set
-051   */
-052  public void setUrl(String url) {
-053    this.url = url;
-054  }
-055
-056  /**
-057   * @return the blogid
-058   */
-059  public String getBlogid() {
-060    return this.blogid;
-061  }
-062
-063  /**
-064   * @param blogid the blogid to set
-065   */
-066  public void setBlogid(String blogid) {
-067    this.blogid = blogid;
-068  }
-069
-070  /**
-071   * @return the blogName
-072   */
-073  public String getBlogName() {
-074    return this.blogName;
-075  }
-076
-077  /**
-078   * @param blogName the blogName to set
-079   */
-080  public void setBlogName(String blogName) {
-081    this.blogName = blogName;
-082  }
-083}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - diff --git a/doc/src-html/net/bican/wordpress/Category.html b/doc/src-html/net/bican/wordpress/Category.html deleted file mode 100644 index db702a2..0000000 --- a/doc/src-html/net/bican/wordpress/Category.html +++ /dev/null @@ -1,200 +0,0 @@ - - - -Source code - - - -
-
001/*
-002 * 
-003 * Wordpress-java
-004 * http://code.google.com/p/wordpress-java/
-005 * 
-006 * Copyright 2012 Can Bican <can@bican.net>
-007 * See the file 'COPYING' in the distribution for licensing terms.
-008 * 
-009 */
-010package net.bican.wordpress;
-011
-012/**
-013 * 
-014 * Category object for a blog.
-015 * 
-016 * @author Can Bican &lt;can@bican.net&gt;
-017 * 
-018 */
-019public class Category extends XmlRpcMapped implements StringHeader {
-020  String categoryId = null;
-021
-022  String categoryName = null;
-023
-024  String description = null;
-025
-026  String htmlUrl = null;
-027
-028  String parentId = null;
-029
-030  String rssUrl = null;
-031
-032  /**
-033   * @return the categoryId
-034   */
-035  public String getCategoryId() {
-036    return this.categoryId;
-037  }
-038
-039  /**
-040   * @return the categoryName
-041   */
-042  public String getCategoryName() {
-043    return this.categoryName;
-044  }
-045
-046  /**
-047   * @return the description
-048   */
-049  public String getDescription() {
-050    return this.description;
-051  }
-052
-053  /**
-054   * @return the htmlUrl
-055   */
-056  public String getHtmlUrl() {
-057    return this.htmlUrl;
-058  }
-059
-060  /**
-061   * @return the parentId
-062   */
-063  public String getParentId() {
-064    return this.parentId;
-065  }
-066
-067  /**
-068   * @return the rssUrl
-069   */
-070  public String getRssUrl() {
-071    return this.rssUrl;
-072  }
-073
-074  /**
-075   * @param categoryId the categoryId to set
-076   */
-077  public void setCategoryId(String categoryId) {
-078    this.categoryId = categoryId;
-079  }
-080
-081  /**
-082   * @param categoryName the categoryName to set
-083   */
-084  public void setCategoryName(String categoryName) {
-085    this.categoryName = categoryName;
-086  }
-087
-088  /**
-089   * @param description the description to set
-090   */
-091  public void setDescription(String description) {
-092    this.description = description;
-093  }
-094
-095  /**
-096   * @param htmlUrl the htmlUrl to set
-097   */
-098  public void setHtmlUrl(String htmlUrl) {
-099    this.htmlUrl = htmlUrl;
-100  }
-101
-102  /**
-103   * @param parentId the parentId to set
-104   */
-105  public void setParentId(String parentId) {
-106    this.parentId = parentId;
-107  }
-108
-109  /**
-110   * @param rssUrl the rssUrl to set
-111   */
-112  public void setRssUrl(String rssUrl) {
-113    this.rssUrl = rssUrl;
-114  }
-115
-116  /**
-117   * (non-Javadoc)
-118   * 
-119   * @see net.bican.wordpress.StringHeader#getStringHeader()
-120   */
-121  @Override
-122  @SuppressWarnings("nls")
-123  public String getStringHeader() {
-124    final String TAB = ":";
-125    return "Category Id" + TAB + "Category Name" + TAB + "Description" + TAB
-126        + "Html Url" + TAB + "Parent Id" + TAB + "Rss Url";
-127  }
-128}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - diff --git a/doc/src-html/net/bican/wordpress/Comment.html b/doc/src-html/net/bican/wordpress/Comment.html deleted file mode 100644 index 994fda5..0000000 --- a/doc/src-html/net/bican/wordpress/Comment.html +++ /dev/null @@ -1,342 +0,0 @@ - - - -Source code - - - -
-
001/*
-002 * 
-003 * Wordpress-java
-004 * http://code.google.com/p/wordpress-java/
-005 * 
-006 * Copyright 2012 Can Bican <can@bican.net>
-007 * See the file 'COPYING' in the distribution for licensing terms.
-008 * 
-009 */
-010package net.bican.wordpress;
-011
-012import java.io.BufferedReader;
-013import java.io.File;
-014import java.io.FileNotFoundException;
-015import java.io.FileReader;
-016import java.io.IOException;
-017import java.util.Date;
-018
-019import redstone.xmlrpc.XmlRpcStruct;
-020
-021/**
-022 * A WordPress Comment object
-023 * 
-024 * @author Fred Potter &lt;fpoptter@gmail.com&gt;
-025 * 
-026 */
-027public class Comment extends XmlRpcMapped implements StringHeader {
-028
-029  Date date_created_gmt;
-030
-031  Integer user_id;
-032
-033  Integer comment_id;
-034
-035  Integer parent;
-036
-037  String status;
-038
-039  String content;
-040
-041  String link;
-042
-043  Integer post_id;
-044
-045  String post_title;
-046
-047  String author;
-048
-049  String author_url;
-050
-051  String author_email;
-052
-053  String author_ip;
-054
-055  /**
-056   * @return the date_created_gmt
-057   */
-058  public Date getDate_created_gmt() {
-059    return this.date_created_gmt;
-060  }
-061
-062  /**
-063   * @param dateCreatedGmt the date_created_gmt to set
-064   */
-065  public void setDate_created_gmt(Date dateCreatedGmt) {
-066    this.date_created_gmt = dateCreatedGmt;
-067  }
-068
-069  /**
-070   * @return the user_id
-071   */
-072  public Integer getUser_id() {
-073    return this.user_id;
-074  }
-075
-076  /**
-077   * @param userId the user_id to set
-078   */
-079  public void setUser_id(Integer userId) {
-080    this.user_id = userId;
-081  }
-082
-083  /**
-084   * @return the comment_id
-085   */
-086  public Integer getComment_id() {
-087    return this.comment_id;
-088  }
-089
-090  /**
-091   * @param commentId the comment_id to set
-092   */
-093  public void setComment_id(Integer commentId) {
-094    this.comment_id = commentId;
-095  }
-096
-097  /**
-098   * @return the parent
-099   */
-100  public Integer getParent() {
-101    return this.parent;
-102  }
-103
-104  /**
-105   * @param parent the parent to set
-106   */
-107  public void setParent(Integer parent) {
-108    this.parent = parent;
-109  }
-110
-111  /**
-112   * @return the status
-113   */
-114  public String getStatus() {
-115    return this.status;
-116  }
-117
-118  /**
-119   * @param status the status to set
-120   */
-121  public void setStatus(String status) {
-122    this.status = status;
-123  }
-124
-125  /**
-126   * @return the content
-127   */
-128  public String getContent() {
-129    return this.content;
-130  }
-131
-132  /**
-133   * @param content the content to set
-134   */
-135  public void setContent(String content) {
-136    this.content = content;
-137  }
-138
-139  /**
-140   * @return the link
-141   */
-142  public String getLink() {
-143    return this.link;
-144  }
-145
-146  /**
-147   * @param link the link to set
-148   */
-149  public void setLink(String link) {
-150    this.link = link;
-151  }
-152
-153  /**
-154   * @return the post_id
-155   */
-156  public Integer getPost_id() {
-157    return this.post_id;
-158  }
-159
-160  /**
-161   * @param postId the post_id to set
-162   */
-163  public void setPost_id(Integer postId) {
-164    this.post_id = postId;
-165  }
-166
-167  /**
-168   * @return the post_title
-169   */
-170  public String getPost_title() {
-171    return this.post_title;
-172  }
-173
-174  /**
-175   * @param postTitle the post_title to set
-176   */
-177  public void setPost_title(String postTitle) {
-178    this.post_title = postTitle;
-179  }
-180
-181  /**
-182   * @return the author
-183   */
-184  public String getAuthor() {
-185    return this.author;
-186  }
-187
-188  /**
-189   * @param author the author to set
-190   */
-191  public void setAuthor(String author) {
-192    this.author = author;
-193  }
-194
-195  /**
-196   * @return the author_url
-197   */
-198  public String getAuthor_url() {
-199    return this.author_url;
-200  }
-201
-202  /**
-203   * @param authorUrl the author_url to set
-204   */
-205  public void setAuthor_url(String authorUrl) {
-206    this.author_url = authorUrl;
-207  }
-208
-209  /**
-210   * @return the author_email
-211   */
-212  public String getAuthor_email() {
-213    return this.author_email;
-214  }
-215
-216  /**
-217   * @param authorEmail the author_email to set
-218   */
-219  public void setAuthor_email(String authorEmail) {
-220    this.author_email = authorEmail;
-221  }
-222
-223  /**
-224   * @return the author_ip
-225   */
-226  public String getAuthor_ip() {
-227    return this.author_ip;
-228  }
-229
-230  /**
-231   * @param authorIp the author_ip to set
-232   */
-233  public void setAuthor_ip(String authorIp) {
-234    this.author_ip = authorIp;
-235  }
-236
-237  /**
-238   * (non-Javadoc)
-239   * 
-240   * @see net.bican.wordpress.StringHeader#getStringHeader()
-241   */
-242  @Override
-243  @SuppressWarnings("nls")
-244  public String getStringHeader() {
-245    final String TAB = ":";
-246    return "Date Created GMT" + TAB + "User Id" + TAB + "Comment Id" + TAB
-247        + "Parent" + TAB + "Status" + TAB + "Content" + TAB + "Link" + TAB
-248        + "Post Id" + TAB + "Post Title" + TAB + "Author" + TAB + "Author URL "
-249        + TAB + "Author Email" + TAB + "Author IP";
-250  }
-251
-252  /**
-253   * 
-254   * Creates a comment object from file
-255   * 
-256   * @param file input file
-257   * @return new Comment object
-258   * @throws FileNotFoundException
-259   * @throws IOException
-260   * @throws InvalidPostFormatException
-261   */
-262  public static Comment fromFile(File file) throws FileNotFoundException,
-263      IOException, InvalidPostFormatException {
-264    XmlRpcStruct c = FileParser.parseFile(new BufferedReader(new FileReader(
-265        file)));
-266    Comment result = new Comment();
-267    result.fromXmlRpcStruct(c);
-268    return result;
-269  }
-270}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - diff --git a/doc/src-html/net/bican/wordpress/CommentCount.html b/doc/src-html/net/bican/wordpress/CommentCount.html deleted file mode 100644 index 054f642..0000000 --- a/doc/src-html/net/bican/wordpress/CommentCount.html +++ /dev/null @@ -1,167 +0,0 @@ - - - -Source code - - - -
-
001/*
-002 * 
-003 * Wordpress-java
-004 * http://code.google.com/p/wordpress-java/
-005 * 
-006 * Copyright 2012 Can Bican <can@bican.net>
-007 * See the file 'COPYING' in the distribution for licensing terms.
-008 * 
-009 */
-010package net.bican.wordpress;
-011
-012/**
-013 * Comment Count object for a blog post.
-014 * 
-015 * @author Fred Potter &lt;fpoptter@gmail.com&gt;
-016 *
-017 */
-018public class CommentCount extends XmlRpcMapped implements StringHeader {
-019  
-020  Integer approved;
-021  Integer awaiting_moderation;
-022  Integer spam;
-023  Integer total_comments;
-024  
-025  /**
-026   * @return Number of approved comments.
-027   */
-028  public Integer getApproved() {
-029    return this.approved;
-030  }
-031  
-032  /**
-033   * @param approved Sets number of approved comments.
-034   */
-035  public void setApproved(Integer approved) {
-036    this.approved = approved;
-037  }
-038
-039  /**
-040   * @return Number of comments awaiting moderation
-041   */
-042  public Integer getAwaiting_moderation() {
-043    return this.awaiting_moderation;
-044  }
-045
-046  /**
-047   * @param awaitingModeration Number of comments awaiting moderation.
-048   */
-049  public void setAwaiting_moderation(Integer awaitingModeration) {
-050    this.awaiting_moderation = awaitingModeration;
-051  }
-052
-053  /**
-054   * @return Number of comments marked as spam.
-055   */
-056  public Integer getSpam() {
-057    return this.spam;
-058  }
-059
-060  /**
-061   * @param spam Number of comments that are spam
-062   */
-063  public void setSpam(Integer spam) {
-064    this.spam = spam;
-065  }
-066
-067  /**
-068   * @return Total number of comments
-069   */
-070  public Integer getTotal_comments() {
-071    return this.total_comments;
-072  }
-073
-074  /**
-075   * @param totalComments Total number of comments.
-076   */
-077  public void setTotal_comments(Integer totalComments) {
-078    this.total_comments = totalComments;
-079  }
-080
-081  /**
-082   * (non-Javadoc)
-083   * 
-084   * @see net.bican.wordpress.StringHeader#getStringHeader()
-085   */
-086  @Override
-087  @SuppressWarnings("nls")
-088  public String getStringHeader() {
-089    final String TAB = ":";
-090    return "Approved" + TAB + "Awaiting Moderation" + TAB + "Spam" + TAB
-091        + "Total Comments";
-092  }
-093  
-094  
-095}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - diff --git a/doc/src-html/net/bican/wordpress/CommentStatusList.html b/doc/src-html/net/bican/wordpress/CommentStatusList.html deleted file mode 100644 index a7290b2..0000000 --- a/doc/src-html/net/bican/wordpress/CommentStatusList.html +++ /dev/null @@ -1,131 +0,0 @@ - - - -Source code - - - -
-
001/*
-002 * 
-003 * Wordpress-java
-004 * http://code.google.com/p/wordpress-java/
-005 * 
-006 * Copyright 2012 Can Bican <can@bican.net>
-007 * See the file 'COPYING' in the distribution for licensing terms.
-008 * 
-009 */
-010package net.bican.wordpress;
-011
-012/**
-013 * 
-014 * Comment status names for the blog
-015 * 
-016 * @author Can Bican <can@bican.net>
-017 *
-018 */
-019public class CommentStatusList extends XmlRpcMapped implements StringHeader {
-020
-021  String hold;
-022
-023  String approve;
-024
-025  String spam;
-026
-027  /**
-028   * @return hold description
-029   */
-030  public String getHold() {
-031    return this.hold;
-032  }
-033
-034  /**
-035   * @return approved description
-036   */
-037  public String getApprove() {
-038    return this.approve;
-039  }
-040
-041  /**
-042   * @return spam description
-043   */
-044  public String getSpam() {
-045    return this.spam;
-046  }
-047
-048  /**
-049   * (non-Javadoc)
-050   * @see net.bican.wordpress.StringHeader#getStringHeader()
-051   */
-052  @Override
-053  @SuppressWarnings("nls")
-054  public String getStringHeader() {
-055    final String TAB = ":";
-056    return "Name" + TAB + "Description";
-057  }
-058
-059}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - diff --git a/doc/src-html/net/bican/wordpress/CustomField.html b/doc/src-html/net/bican/wordpress/CustomField.html deleted file mode 100644 index 1808af1..0000000 --- a/doc/src-html/net/bican/wordpress/CustomField.html +++ /dev/null @@ -1,202 +0,0 @@ - - - -Source code - - - -
-
001/*
-002 * 
-003 * Wordpress-java
-004 * http://code.google.com/p/wordpress-java/
-005 * 
-006 * Copyright 2012 Can Bican <can@bican.net>
-007 * See the file 'COPYING' in the distribution for licensing terms.
-008 * 
-009 */
-010package net.bican.wordpress;
-011
-012import org.json.JSONException;
-013import org.json.JSONObject;
-014
-015/**
-016 * This class represents custom fields in wordpress.
-017 * 
-018 * @author alok
-019 * 
-020 */
-021public class CustomField extends XmlRpcMapped implements StringHeader,
-022    JSONConvertable {
-023  String id = null;
-024
-025  String key = null;
-026
-027  String value = null;
-028
-029  /**
-030   * (non-Javadoc)
-031   * 
-032   * @see net.bican.wordpress.StringHeader#getStringHeader()
-033   */
-034  @Override
-035  @SuppressWarnings("nls")
-036  public String getStringHeader() {
-037    final String TAB = ":";
-038    return "Id" + TAB + "Key" + TAB + "Value";
-039  }
-040
-041  /**
-042   * (non-Javadoc)
-043   * 
-044   * @see net.bican.wordpress.XmlRpcMapped#toString()
-045   */
-046  @SuppressWarnings("nls")
-047  @Override
-048  public String toString() {
-049    JSONObject o = new JSONObject();
-050    try {
-051      o.put("id", this.getId());
-052      o.put("key", this.getKey());
-053      o.put("value", this.getValue());
-054    } catch (JSONException e) {
-055      // TODO Auto-generated catch block
-056      e.printStackTrace();
-057    }
-058    return o.toString();
-059  }
-060
-061  /**
-062   * @return id of custom field
-063   */
-064  public String getId() {
-065    return this.id;
-066  }
-067
-068  /**
-069   * @param id
-070   */
-071  public void setId(String id) {
-072    this.id = id;
-073  }
-074
-075  /**
-076   * @return key of custom field
-077   */
-078  public String getKey() {
-079    return this.key;
-080  }
-081
-082  /**
-083   * @param key
-084   */
-085  public void setKey(String key) {
-086    this.key = key;
-087  }
-088
-089  /**
-090   * @return value of custom field
-091   */
-092  public String getValue() {
-093    return this.value;
-094  }
-095
-096  /**
-097   * @param value
-098   */
-099  public void setValue(String value) {
-100    this.value = value;
-101  }
-102
-103  /**
-104   * 
-105   * (non-Javadoc)
-106   * 
-107   * @see net.bican.wordpress.JSONConvertable#fromJSONObject(org.json.JSONObject)
-108   * 
-109   */
-110  @Override
-111  @SuppressWarnings("nls")
-112  public void fromJSONObject(JSONObject o) {
-113    try {
-114      this.setId(o.getString("id"));
-115    } catch (JSONException e) {
-116      this.setId(null);
-117    }
-118    try {
-119      this.setKey(o.getString("key"));
-120    } catch (JSONException e) {
-121      this.setKey(null);
-122    }
-123    try {
-124      this.setValue(o.getString("value"));
-125    } catch (JSONException e) {
-126      this.setValue(null);
-127    }
-128  }
-129
-130}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - diff --git a/doc/src-html/net/bican/wordpress/FileParser.html b/doc/src-html/net/bican/wordpress/FileParser.html deleted file mode 100644 index c4115f7..0000000 --- a/doc/src-html/net/bican/wordpress/FileParser.html +++ /dev/null @@ -1,219 +0,0 @@ - - - -Source code - - - -
-
001/*
-002 * 
-003 * Wordpress-java
-004 * http://code.google.com/p/wordpress-java/
-005 * 
-006 * Copyright 2012 Can Bican <can@bican.net>
-007 * See the file 'COPYING' in the distribution for licensing terms.
-008 * 
-009 */
-010package net.bican.wordpress;
-011
-012import java.io.BufferedReader;
-013import java.io.IOException;
-014import java.util.regex.Matcher;
-015import java.util.regex.Pattern;
-016
-017import org.json.JSONArray;
-018import org.json.JSONException;
-019
-020import redstone.xmlrpc.XmlRpcArray;
-021import redstone.xmlrpc.XmlRpcStruct;
-022
-023/**
-024 * 
-025 * Static methods for parsing files
-026 * 
-027 * @author Can Bican <can@bican.net>
-028 * 
-029 */
-030public class FileParser {
-031
-032  /**
-033   * 
-034   * Parses a file to create an xmlrpc compliant object
-035   * 
-036   * @param input
-037   *          reader for the file
-038   * @return New xmlrpc object
-039   * @throws IOException
-040   * @throws InvalidPostFormatException
-041   */
-042  @SuppressWarnings("nls")
-043  public static XmlRpcStruct parseFile(BufferedReader input)
-044      throws IOException, InvalidPostFormatException {
-045    XmlRpcStruct p = new XmlRpcStruct();
-046    String line;
-047    String prevKey = null;
-048    String prevValue = null;
-049    Pattern keyPattern;
-050    keyPattern = Pattern.compile("^[\\d\\w_]+:", Pattern.CASE_INSENSITIVE
-051        | Pattern.UNICODE_CASE);
-052    while ((line = input.readLine()) != null) {
-053      if ((!"".equals(line)) && (!line.startsWith("#"))) {
-054        Matcher m = keyPattern.matcher(line);
-055        if (m.find()) {
-056          if (prevKey != null) {
-057            FileParser.putVal(p, prevKey, prevValue);
-058          }
-059          String[] vals = line.split(":", 2);
-060          prevKey = vals[0];
-061          prevValue = vals[1];
-062        } else {
-063          if (prevValue != null) {
-064            prevValue += line;
-065          } else {
-066            throw new InvalidPostFormatException();
-067          }
-068        }
-069      }
-070    }
-071    if (prevKey != null)
-072      FileParser.putVal(p, prevKey, prevValue);
-073    return p;
-074  }
-075
-076  /**
-077   * 
-078   * Fills values for an xmlrpc object
-079   * 
-080   * @param s
-081   *          xmlrpc object itself
-082   * @param key
-083   *          field name
-084   * @param v
-085   *          field value
-086   */
-087  @SuppressWarnings({ "unchecked", "rawtypes", "nls" })
-088  public static void putVal(XmlRpcStruct s, String key, String v) {
-089    String value = v.trim();
-090    if (value.startsWith("[")) {
-091      try {
-092        JSONArray jArr = new JSONArray(value);
-093        if (jArr.length() > 0) {
-094          Class cType = jArr.get(0).getClass();
-095          XmlRpcArray vals = new XmlRpcArray();
-096          if (cType == String.class) {
-097            for (int i = 0; i < jArr.length(); i++) {
-098              vals.add(jArr.getString(i));
-099            }
-100          } else {
-101            String className = FileParser.getClassName(key);
-102            Class<?> cl = Class.forName(className);
-103            for (int i = 0; i < jArr.length(); i++) {
-104              JSONConvertable o = (JSONConvertable) cl.newInstance();
-105              o.fromJSONObject(jArr.getJSONObject(i));
-106              vals.add(o);
-107            }
-108          }
-109          s.put(key, vals);
-110        }
-111      } catch (JSONException e) {
-112        // TODO Auto-generated catch block
-113        e.printStackTrace();
-114      } catch (ClassNotFoundException e) {
-115        // TODO Auto-generated catch block
-116        e.printStackTrace();
-117      } catch (InstantiationException e) {
-118        // TODO Auto-generated catch block
-119        e.printStackTrace();
-120      } catch (IllegalAccessException e) {
-121        // TODO Auto-generated catch block
-122        e.printStackTrace();
-123      }
-124    } else {
-125      if (!"null".equalsIgnoreCase(value)) {
-126        s.put(key, value);
-127      }
-128    }
-129  }
-130
-131  @SuppressWarnings("nls")
-132  static String getClassName(String key) {
-133    String className = key;
-134    while (className.contains("_")) {
-135      int pos = className.indexOf("_");
-136      Character ch = Character.valueOf(className.charAt(pos + 1));
-137      char chNew = Character.toUpperCase(ch.charValue());
-138      className = className.replaceFirst("_" + ch, chNew + "");
-139    }
-140    className = className.replaceFirst("s$", "");
-141    Character ch = Character.valueOf(className.charAt(0));
-142    char chNew = Character.toUpperCase(ch.charValue());
-143    className = className.replaceFirst("^" + ch, chNew + "");
-144    return "net.bican.wordpress." + className;
-145  }
-146
-147}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - diff --git a/doc/src-html/net/bican/wordpress/InvalidPostFormatException.html b/doc/src-html/net/bican/wordpress/InvalidPostFormatException.html deleted file mode 100644 index 4f72445..0000000 --- a/doc/src-html/net/bican/wordpress/InvalidPostFormatException.html +++ /dev/null @@ -1,96 +0,0 @@ - - - -Source code - - - -
-
001/*
-002 * 
-003 * Wordpress-java
-004 * http://code.google.com/p/wordpress-java/
-005 * 
-006 * Copyright 2012 Can Bican <can@bican.net>
-007 * See the file 'COPYING' in the distribution for licensing terms.
-008 * 
-009 */
-010package net.bican.wordpress;
-011
-012/**
-013 * 
-014 * Exception that is triggered via invalid input
-015 * 
-016 * @author Can Bican &lt;can@bican.net&gt;
-017 * 
-018 */
-019public class InvalidPostFormatException extends Exception {
-020
-021  private static final long serialVersionUID = 1L;
-022
-023  // just a default exception
-024}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - diff --git a/doc/src-html/net/bican/wordpress/JSONConvertable.html b/doc/src-html/net/bican/wordpress/JSONConvertable.html deleted file mode 100644 index 10bdcf0..0000000 --- a/doc/src-html/net/bican/wordpress/JSONConvertable.html +++ /dev/null @@ -1,98 +0,0 @@ - - - -Source code - - - -
-
001/*
-002 * 
-003 * Wordpress-java
-004 * http://code.google.com/p/wordpress-java/
-005 * 
-006 * Copyright 2012 Can Bican <can@bican.net>
-007 * See the file 'COPYING' in the distribution for licensing terms.
-008 * 
-009 */
-010package net.bican.wordpress;
-011
-012import org.json.JSONObject;
-013
-014/**
-015 * 
-016 * Interface for objects that can be modified via JSON objects.
-017 * 
-018 * @author Can Bican &lt;can@bican.net&gt;
-019 * 
-020 */
-021public interface JSONConvertable {
-022  /**
-023   * @param jsonObject JSON object to get values from
-024   */
-025  public void fromJSONObject(JSONObject jsonObject);
-026}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - diff --git a/doc/src-html/net/bican/wordpress/Main.html b/doc/src-html/net/bican/wordpress/Main.html deleted file mode 100644 index 13623cf..0000000 --- a/doc/src-html/net/bican/wordpress/Main.html +++ /dev/null @@ -1,464 +0,0 @@ - - - -Source code - - - -
-
001/*
-002 * 
-003 * Wordpress-java
-004 * http://code.google.com/p/wordpress-java/
-005 * 
-006 * Copyright 2012 Can Bican <can@bican.net>
-007 * See the file 'COPYING' in the distribution for licensing terms.
-008 * 
-009 */
-010package net.bican.wordpress;
-011
-012import java.io.File;
-013import java.io.FileNotFoundException;
-014import java.io.IOException;
-015import java.net.MalformedURLException;
-016import java.util.List;
-017
-018import javax.activation.MimetypesFileTypeMap;
-019
-020import net.bican.wordpress.configuration.WpCliConfiguration;
-021
-022import org.apache.commons.cli.HelpFormatter;
-023import org.apache.commons.cli.Options;
-024import org.apache.commons.cli.ParseException;
-025
-026import redstone.xmlrpc.XmlRpcFault;
-027
-028/**
-029 * 
-030 * Main Application class for the command line interface.
-031 * 
-032 * @author Can Bican &lt;can@bican.net&gt;
-033 * 
-034 */
-035public class Main {
-036  /**
-037   * @param args
-038   *          execute with "-?" for an explanation of args
-039   * @throws ParseException
-040   *           When the command line options cannot be parsed
-041   */
-042  @SuppressWarnings({ "nls", "boxing" })
-043  public static void main(String[] args) throws ParseException {
-044    try {
-045      Options options = new Options();
-046      options.addOption("?", "help", false, "Print usage information");
-047      options.addOption("h", "url", true, "Specify the url to xmlrpc.php");
-048      options.addOption("u", "user", true, "User name");
-049      options.addOption("p", "pass", true, "Password");
-050      options.addOption("a", "authors", false, "Get author list");
-051      options.addOption("s", "slug", true, "Slug for categories");
-052      options.addOption("pi", "parentid", true, "Parent id for categories");
-053      options.addOption("oi", "postid", true, "Post id for pages and posts");
-054      options.addOption("c", "categories", false, "Get category list");
-055      options.addOption("cn", "newcategory", true,
-056          "New category (uses --slug and --parentid)");
-057      options.addOption("cr", "deletecategory", true,
-058          "Delete category <category_id>");
-059      options.addOption("pg", "pages", false, "Get page list (full)");
-060      options.addOption("pl", "pagelist", false, "Get page list");
-061      options.addOption("ps", "page", true, "Get page");
-062      options.addOption("pn", "newpage", true,
-063          "New page from file <arg> (needs --publish)");
-064      options.addOption("pe", "editpage", true,
-065          "Edit page (needs --postid and --publish");
-066      options.addOption("pd", "deletepage", true,
-067          "Delete page (needs --publish)");
-068      options.addOption("l", "publish", true,
-069          "Publish status for \"new\" options");
-070      options.addOption("us", "userinfo", false, "Get user information");
-071      options.addOption("or", "recentposts", true, "Get recent posts");
-072      options.addOption("os", "getpost", true, "Get post");
-073      options.addOption("on", "newpost", true,
-074          "New post from file <arg> (needs --publish)");
-075      options.addOption("oe", "editpost", true,
-076          "Edit post (needs --postid and --publish");
-077      options.addOption("od", "deletepost", true,
-078          "Delete post (needs --publish)");
-079      options.addOption("sm", "supportedmethods", false,
-080          "List supported methods");
-081      options.addOption("st", "supportedfilters", false,
-082          "List supported text filters");
-083      options.addOption("mn", "newmedia", true,
-084          "New media file (uses --overwrite)");
-085      options.addOption("ov", "overwrite", false,
-086          "Allow overwrite in uploading new media");
-087      options.addOption("so", "supportedstatus", false,
-088          "Print supported page and post status values");
-089      options.addOption("cs", "commentstatus", false,
-090          "Print comment status names for the blog");
-091      options.addOption("cc", "commentcount", true,
-092          "Get comment count for a post (-1 for all posts)");
-093      options.addOption("ca", "newcomment", true, "New comment from file");
-094      options.addOption("cd", "deletecomment", true, "Delete comment");
-095      options.addOption("ce", "editcomment", true, "Edit comment from file");
-096      options.addOption("cg", "getcomment", true, "Get comment");
-097      options.addOption("ct", "getcomments", true, "Get comments for the post");
-098      options.addOption("cs", "commentstatus", true,
-099          "Comment status (for --getcomments)");
-100      options.addOption("co", "commentoffset", true,
-101          "Comment offset # (for --getcomments)");
-102      options.addOption("cm", "commentnumber", true,
-103          "Comment # (for --getcomments)");
-104      try {
-105        WpCliConfiguration config = new WpCliConfiguration(args, options,
-106            Main.class);
-107        if (config.hasOption("help")) {
-108          showHelp(options);
-109        } else if ((!config.hasOption("url")) || (!config.hasOption("user"))
-110            || (!config.hasOption("pass"))) {
-111          System.err.println("Specify --user, --pass and --url");
-112        } else {
-113          try {
-114            Wordpress wp = new Wordpress(config.getOptionValue("user"),
-115                config.getOptionValue("pass"), config.getOptionValue("url"));
-116            if (config.hasOption("authors")) {
-117              printList(wp.getAuthors(), Author.class, true);
-118            } else if (config.hasOption("categories")) {
-119              printList(wp.getCategories(), Category.class, true);
-120            } else if (config.hasOption("deletecategory")) {
-121              Integer category_id = Integer.valueOf(config
-122                  .getOptionValue("deletecategory"));
-123              int r = wp.deleteCategory(category_id);
-124              System.out.println(r);
-125            } else if (config.hasOption("newcategory")) {
-126              String slug = config.getOptionValue("slug");
-127              Integer parentId = getInteger("parentid", config);
-128              if (slug == null)
-129                slug = "";
-130              if (parentId == null)
-131                parentId = 0;
-132              System.out.println(wp.newCategory(
-133                  config.getOptionValue("newcategory"), slug, parentId));
-134            } else if (config.hasOption("pages")) {
-135              printList(wp.getPages(), Page.class, false);
-136            } else if (config.hasOption("pagelist")) {
-137              printList(wp.getPageList(), PageDefinition.class, false);
-138            } else if (config.hasOption("page")) {
-139              printItem(wp.getPage(getInteger("page", config)), Page.class);
-140            } else if (config.hasOption("userinfo")) {
-141              printItem(wp.getUserInfo(), User.class);
-142            } else if (config.hasOption("recentposts")) {
-143              printList(wp.getRecentPosts(getInteger("recentposts", config)),
-144                  Page.class, false);
-145            } else if (config.hasOption("getpost")) {
-146              printItem(wp.getPost(getInteger("getpost", config)), Page.class);
-147            } else if (config.hasOption("supportedmethods")) {
-148              printList(wp.supportedMethods(), String.class, false);
-149            } else if (config.hasOption("supportedfilters")) {
-150              printList(wp.supportedTextFilters(), String.class, false);
-151            } else if (config.hasOption("newpage")) {
-152              if (!config.hasOption("publish")) {
-153                showHelp(options);
-154              } else {
-155                System.out.println(wp.newPage(
-156                    Page.fromFile(new File(config.getOptionValue("newpage"))),
-157                    config.getOptionValue("publish")));
-158              }
-159            } else if (config.hasOption("editpage")) {
-160              edit(options, config, wp, "editpage", true);
-161            } else if (config.hasOption("editpost")) {
-162              edit(options, config, wp, "editpost", false);
-163            } else if (config.hasOption("deletepage")) {
-164              delete(options, config, wp, "deletepage", true);
-165            } else if (config.hasOption("deletepost")) {
-166              delete(options, config, wp, "deletepost", false);
-167            } else if (config.hasOption("newpost")) {
-168              if (!config.hasOption("publish")) {
-169                showHelp(options);
-170              } else {
-171                System.out.println(wp.newPost(
-172                    Page.fromFile(new File(config.getOptionValue("newpost"))),
-173                    Boolean.valueOf(config.getOptionValue("publish"))));
-174              }
-175            } else if (config.hasOption("newmedia")) {
-176              String fileName = config.getOptionValue("newmedia");
-177              File file = new File(fileName);
-178              String mimeType = new MimetypesFileTypeMap().getContentType(file);
-179              Boolean overwrite = Boolean.FALSE;
-180              if (config.hasOption("overwrite"))
-181                overwrite = Boolean.TRUE;
-182              MediaObject result = wp.newMediaObject(mimeType, file, overwrite);
-183              if (result != null) {
-184                System.out.println(result);
-185              }
-186            } else if (config.hasOption("supportedstatus")) {
-187              System.out.println("Recognized status values for posts:");
-188              printList(wp.getPostStatusList(), PostAndPageStatus.class, true);
-189              System.out.println("\nRecognized status values for pages:");
-190              printList(wp.getPageStatusList(), PostAndPageStatus.class, true);
-191            } else if (config.hasOption("commentstatus")) {
-192              showCommentStatus(wp);
-193            } else if (config.hasOption("commentcount")) {
-194              showCommentCount(config, wp);
-195            } else if (config.hasOption("newcomment")) {
-196              editComment(wp, config.getOptionValue("newcomment"), "newcomment");
-197            } else if (config.hasOption("editcomment")) {
-198              editComment(wp, config.getOptionValue("editcomment"),
-199                  "editcomment");
-200            } else if (config.hasOption("deletecomment")) {
-201              System.err.println(Integer.valueOf(config
-202                  .getOptionValue("deletecomment")));
-203              deleteComment(wp,
-204                  Integer.valueOf(config.getOptionValue("deletecomment")));
-205            } else if (config.hasOption("getcomment")) {
-206              printComment(wp,
-207                  Integer.valueOf(config.getOptionValue("getcomment")));
-208            } else if (config.hasOption("getcomments")) {
-209              Integer postID = Integer.valueOf(config
-210                  .getOptionValue("getcomments"));
-211              String commentStatus = config.getOptionValue("commentstatus");
-212              Integer commentOffset;
-213              try {
-214                commentOffset = Integer.valueOf(config
-215                    .getOptionValue("commentoffset"));
-216              } catch (NumberFormatException e) {
-217                commentOffset = null;
-218              }
-219              Integer commentNumber;
-220              try {
-221                commentNumber = Integer.valueOf(config
-222                    .getOptionValue("commentnumber"));
-223              } catch (Exception e) {
-224                commentNumber = null;
-225              }
-226              printComments(wp, postID, commentStatus, commentOffset,
-227                  commentNumber);
-228            } else {
-229              showHelp(options);
-230            }
-231          } catch (MalformedURLException e) {
-232            System.err.println("URL \"" + config.getOptionValue("url")
-233                + "\" is invalid, reason is: " + e.getLocalizedMessage());
-234          } catch (IOException e) {
-235            System.err.println("Can't read from file, reason is: "
-236                + e.getLocalizedMessage());
-237          } catch (InvalidPostFormatException e) {
-238            System.err.println("Input format is invalid.");
-239          }
-240        }
-241      } catch (ParseException e) {
-242        System.err.println("Can't process command line arguments, reason is: "
-243            + e.getLocalizedMessage());
-244      }
-245    } catch (XmlRpcFault e) {
-246      String reason = e.getLocalizedMessage();
-247      System.err.println("Operation failed, reason is: " + reason);
-248    }
-249  }
-250
-251  @SuppressWarnings("nls")
-252  private static void printComments(Wordpress wp, Integer postID,
-253      String commentStatus, Integer commentOffset, Integer commentNumber)
-254      throws XmlRpcFault {
-255    List<Comment> r = wp.getComments(commentStatus, postID, commentNumber,
-256        commentOffset);
-257    for (Comment comment : r) {
-258      System.out.println("--- BEGIN COMMENT");
-259      System.out.println(comment);
-260      System.out.println("--- END COMMENT");
-261    }
-262  }
-263
-264  private static void printComment(Wordpress wp, Integer commentID)
-265      throws XmlRpcFault {
-266    Comment r = wp.getComment(commentID);
-267    System.out.println(r);
-268  }
-269
-270  @SuppressWarnings("nls")
-271  private static void deleteComment(Wordpress wp, int commentID)
-272      throws XmlRpcFault {
-273    boolean result = wp.deleteComment(commentID);
-274    if (result)
-275      System.out.println("Comment deleted.");
-276    else
-277      System.out.println("Comment not deleted");
-278  }
-279
-280  @SuppressWarnings({ "nls", "boxing" })
-281  private static void editComment(Wordpress wp, String fileName,
-282      String operation) throws XmlRpcFault, FileNotFoundException, IOException,
-283      InvalidPostFormatException {
-284    Comment comment = Comment.fromFile(new File(fileName));
-285    System.err.println(comment.getPost_id());
-286    System.err.println(comment.getContent());
-287    if (operation.equals("newcomment")) {
-288      Integer r = wp.newComment(comment.getPost_id(), comment.getParent(),
-289          comment.getContent(), comment.getAuthor(), comment.getAuthor_url(),
-290          comment.getAuthor_email());
-291      System.err.println("Comment ID: " + r);
-292    } else if (operation.equals("editcomment")) {
-293      Boolean r = wp.editComment(comment);
-294      if (r)
-295        System.err.println("Comment edited.");
-296      else
-297        System.err.println("Comment not edited.");
-298    }
-299  }
-300
-301  @SuppressWarnings("nls")
-302  private static void showCommentCount(WpCliConfiguration config, Wordpress wp) {
-303    Integer post_ID = getInteger("commentcount", config);
-304    try {
-305      CommentCount result = wp.getCommentsCount(post_ID);
-306      System.out.println(result);
-307    } catch (XmlRpcFault e) {
-308      String reason = e.getLocalizedMessage();
-309      System.err.println("Operation failed, reason is: " + reason);
-310    }
-311  }
-312
-313  private static void showCommentStatus(Wordpress wp) {
-314    printItem(wp.getCommentStatusList(), CommentStatusList.class);
-315  }
-316
-317  @SuppressWarnings({ "nls", "boxing" })
-318  private static void delete(Options options, WpCliConfiguration config,
-319      Wordpress wp, String opt, boolean deletePage) throws XmlRpcFault {
-320    Integer post_ID = getInteger(opt, config);
-321    String publish = config.getOptionValue("publish");
-322    if ((publish != null) && (post_ID != null)) {
-323      if (deletePage) {
-324        System.out.println(wp.deletePage(post_ID, publish));
-325      } else {
-326        System.out.println(wp.deletePost(post_ID, publish));
-327      }
-328    } else {
-329      showHelp(options);
-330    }
-331  }
-332
-333  @SuppressWarnings({ "nls", "boxing" })
-334  private static void edit(Options options, WpCliConfiguration config,
-335      Wordpress wp, String opt, boolean isPage) throws IOException,
-336      InvalidPostFormatException, XmlRpcFault {
-337    Integer post_ID = getInteger("postid", config);
-338    String publish = config.getOptionValue("publish");
-339    Page page = Page.fromFile(new File(config.getOptionValue(opt)));
-340    if ((publish != null) && (post_ID != null)) {
-341      Boolean result = false;
-342      if (isPage) {
-343        result = wp.editPage(post_ID, page, publish);
-344      } else {
-345        result = wp.editPost(post_ID, page, publish);
-346      }
-347      System.out.println(result);
-348    } else {
-349      showHelp(options);
-350    }
-351  }
-352
-353  private static Integer getInteger(String c, WpCliConfiguration config) {
-354    Integer post_ID = null;
-355    try {
-356      post_ID = Integer.valueOf(config.getOptionValue(c));
-357    } catch (NumberFormatException e) {
-358      // leave it null
-359    }
-360    return post_ID;
-361  }
-362
-363  @SuppressWarnings("nls")
-364  private static void showHelp(Options options) {
-365    HelpFormatter help = new HelpFormatter();
-366    help.printHelp(" ", options);
-367  }
-368
-369  private static void printItem(Object o, Class<?> cl) {
-370    cl.cast(o);
-371    System.out.println(((StringHeader) o).getStringHeader());
-372    System.out.println(o);
-373  }
-374
-375  private static void printList(List<?> r, Class<?> cl, boolean oneLiner) {
-376    boolean headerPrinted = false;
-377    for (Object o : r) {
-378      cl.cast(o);
-379      if (!headerPrinted) {
-380        if ((!(o instanceof String)) && (oneLiner)) {
-381          System.out.println(((StringHeader) o).getStringHeader());
-382        }
-383        headerPrinted = true;
-384      }
-385      if (oneLiner) {
-386        System.out.println(((XmlRpcMapped) o).toOneLinerString());
-387      } else {
-388        System.out.println(o);
-389      }
-390    }
-391  }
-392}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - diff --git a/doc/src-html/net/bican/wordpress/MediaObject.html b/doc/src-html/net/bican/wordpress/MediaObject.html deleted file mode 100644 index c8fefd6..0000000 --- a/doc/src-html/net/bican/wordpress/MediaObject.html +++ /dev/null @@ -1,155 +0,0 @@ - - - -Source code - - - -
-
001/*
-002 * 
-003 * Wordpress-java
-004 * http://code.google.com/p/wordpress-java/
-005 * 
-006 * Copyright 2012 Can Bican <can@bican.net>
-007 * See the file 'COPYING' in the distribution for licensing terms.
-008 * 
-009 */
-010package net.bican.wordpress;
-011
-012/**
-013 * 
-014 * Media Object, as the result of an upload;
-015 * 
-016 * @author Can Bican &lt;can@bican.net&gt;
-017 * 
-018 */
-019public class MediaObject extends XmlRpcMapped {
-020  String url;
-021
-022  String file;
-023
-024  String type;
-025  
-026  String id;
-027  
-028  /**
-029   * @return the ID of the Media Object
-030   */
-031  public String getId(){
-032      return id;
-033  }
-034
-035  /**
-036   * @param set the ID of the Media Object
-037   */
-038  public void setId(String id){
-039      this.id = id;
-040  }
-041
-042  /**
-043   * @return the url
-044   */
-045  public String getUrl() {
-046    return this.url;
-047  }
-048
-049  /**
-050   * @param url the url to set
-051   */
-052  public void setUrl(String url) {
-053    this.url = url;
-054  }
-055
-056  /**
-057   * @return the file
-058   */
-059  public String getFile() {
-060    return this.file;
-061  }
-062
-063  /**
-064   * @param file the file to set
-065   */
-066  public void setFile(String file) {
-067    this.file = file;
-068  }
-069
-070  /**
-071   * @return the type
-072   */
-073  public String getType() {
-074    return this.type;
-075  }
-076
-077  /**
-078   * @param type the type to set
-079   */
-080  public void setType(String type) {
-081    this.type = type;
-082  }
-083}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - diff --git a/doc/src-html/net/bican/wordpress/Page.html b/doc/src-html/net/bican/wordpress/Page.html deleted file mode 100644 index 6b0d9fe..0000000 --- a/doc/src-html/net/bican/wordpress/Page.html +++ /dev/null @@ -1,586 +0,0 @@ - - - -Source code - - - -
-
001/*
-002 * 
-003 * Wordpress-java
-004 * http://code.google.com/p/wordpress-java/
-005 * 
-006 * Copyright 2012 Can Bican <can@bican.net>
-007 * See the file 'COPYING' in the distribution for licensing terms.
-008 * 
-009 */
-010package net.bican.wordpress;
-011
-012import java.io.BufferedReader;
-013import java.io.File;
-014import java.io.FileReader;
-015import java.io.IOException;
-016import java.util.Date;
-017
-018import redstone.xmlrpc.XmlRpcArray;
-019import redstone.xmlrpc.XmlRpcStruct;
-020
-021/**
-022 * 
-023 * Page object for a blog.
-024 * 
-025 * @author Can Bican &lt;can@bican.net&gt;
-026 * 
-027 */
-028public class Page extends XmlRpcMapped implements StringHeader {
-029  /**
-030   * 
-031   * Generates a new page class from the given file
-032   * 
-033   * @param file file that contains the page information
-034   * @return new Page object
-035   * @throws IOException when the file cannot be read
-036   * @throws InvalidPostFormatException when the file format is not recognized
-037   */
-038  public static Page fromFile(File file) throws IOException,
-039      InvalidPostFormatException {
-040    BufferedReader input = new BufferedReader(new FileReader(file));
-041    XmlRpcStruct page = FileParser.parseFile(input);
-042    Page result = new Page();
-043    result.fromXmlRpcStruct(page);
-044    return result;
-045  }
-046
-047  XmlRpcArray categories;
-048
-049  XmlRpcArray custom_fields;
-050
-051  Date date_created_gmt;
-052
-053  Date dateCreated;
-054
-055  String description;
-056
-057  String link;
-058
-059  Integer mt_allow_comments;
-060
-061  Integer mt_allow_pings;
-062
-063  String mt_excerpt;
-064
-065  String mt_keywords;
-066
-067  String mt_text_more;
-068
-069  Integer page_id;
-070
-071  String page_status;
-072
-073  String permaLink;
-074
-075  String post_status;
-076
-077  String post_type;
-078
-079  Integer postid;
-080
-081  String title;
-082
-083  String userid;
-084
-085  String wp_author;
-086
-087  String wp_author_display_name;
-088
-089  String wp_author_id;
-090
-091  Integer wp_page_order;
-092
-093  Integer wp_page_parent_id;
-094
-095  String wp_page_parent_title;
-096
-097  String wp_password;
-098  
-099  String wp_post_thumbnail;
-100
-101  String wp_slug;
-102  
-103  /**
-104   * @return the categories
-105   */
-106  public XmlRpcArray getCategories() {
-107    return this.categories;
-108  }
-109
-110  /**
-111   * @return the custom_fields
-112   */
-113  public XmlRpcArray getCustom_fields() {
-114    return this.custom_fields;
-115  }
-116
-117  /**
-118   * @return the date_created_gmt
-119   */
-120  public Date getDate_created_gmt() {
-121    return this.date_created_gmt;
-122  }
-123
-124  /**
-125   * @return the dateCreated
-126   */
-127  public Date getDateCreated() {
-128    return this.dateCreated;
-129  }
-130
-131  /**
-132   * @return the description
-133   */
-134  public String getDescription() {
-135    return this.description;
-136  }
-137
-138  /**
-139   * @return the excerpt
-140   */
-141  public String getExcerpt() {
-142    return this.mt_excerpt;
-143  }
-144
-145  /**
-146   * @return the link
-147   */
-148  public String getLink() {
-149    return this.link;
-150  }
-151
-152  /**
-153   * @return the mt_allow_comments
-154   */
-155  public Integer getMt_allow_comments() {
-156    return this.mt_allow_comments;
-157  }
-158
-159  /**
-160   * @return the mt_allow_pings
-161   */
-162  public Integer getMt_allow_pings() {
-163    return this.mt_allow_pings;
-164  }
-165
-166  /**
-167   * @return the mt_keywords
-168   */
-169  public String getMt_keywords() {
-170    return this.mt_keywords;
-171  }
-172
-173  /**
-174   * @return text_more
-175   */
-176  public String getMt_text_more() {
-177    return this.mt_text_more;
-178  }
-179
-180  /**
-181   * @return the page_id
-182   */
-183  public Integer getPage_id() {
-184    return this.page_id;
-185  }
-186
-187  /**
-188   * @return the page_status
-189   */
-190  public String getPage_status() {
-191    return this.page_status;
-192  }
-193
-194  /**
-195   * @return the permaLink
-196   */
-197  public String getPermaLink() {
-198    return this.permaLink;
-199  }
-200
-201  /**
-202   * @return the post_status
-203   */
-204  public String getPost_status() {
-205    return this.post_status;
-206  }
-207
-208  /**
-209   * @return the post_type
-210   */
-211  public String getPost_type() {
-212    return this.post_type;
-213  }
-214
-215  /**
-216   * @return the postid
-217   */
-218  public Integer getPostid() {
-219    return this.postid;
-220  }
-221
-222  /**
-223   * (non-Javadoc)
-224   * 
-225   * @see net.bican.wordpress.StringHeader#getStringHeader()
-226   */
-227  @Override
-228  @SuppressWarnings("nls")
-229  public String getStringHeader() {
-230    return ""; // this is not a tabulated list
-231  }
-232
-233  /**
-234   * @return the title
-235   */
-236  public String getTitle() {
-237    return this.title;
-238  }
-239
-240  /**
-241   * @return the userid
-242   */
-243  public String getUserid() {
-244    return this.userid;
-245  }
-246
-247  /**
-248   * @return the wp_author
-249   */
-250  public String getWp_author() {
-251    return this.wp_author;
-252  }
-253
-254  /**
-255   * @return the wp_author_display_name
-256   */
-257  public String getWp_author_display_name() {
-258    return this.wp_author_display_name;
-259  }
-260
-261  /**
-262   * @return the wp_author_id
-263   */
-264  public String getWp_author_id() {
-265    return this.wp_author_id;
-266  }
-267
-268  /**
-269   * @return the wp_page_order
-270   */
-271  public Integer getWp_page_order() {
-272    return this.wp_page_order;
-273  }
-274
-275  /**
-276   * @return the wp_page_parent_id
-277   */
-278  public Integer getWp_page_parent_id() {
-279    return this.wp_page_parent_id;
-280  }
-281
-282  /**
-283   * @return the wp_page_parent_title
-284   */
-285  public String getWp_page_parent_title() {
-286    return this.wp_page_parent_title;
-287  }
-288
-289  /**
-290   * @return the wp_password
-291   */
-292  public String getWp_password() {
-293    return this.wp_password;
-294  }
-295
-296  /**
-297   * @return the wp_slug
-298   */
-299  public String getWp_slug() {
-300    return this.wp_slug;
-301  }
-302
-303  /**
-304   * @param categories the categories to set
-305   */
-306  public void setCategories(XmlRpcArray categories) {
-307    this.categories = categories;
-308  }
-309
-310  /**
-311   * @param custom_fields the custom_fields to set
-312   */
-313  public void setCustom_fields(XmlRpcArray custom_fields) {
-314    this.custom_fields = custom_fields;
-315  }
-316
-317  /**
-318   * @param date_created_gmt the date_created_gmt to set
-319   */
-320  public void setDate_created_gmt(Date date_created_gmt) {
-321    this.date_created_gmt = date_created_gmt;
-322    // one of dateCreated() and date_created_gmt() has to be null
-323    // or the behavior when two of them are different is undefined
-324    if (this.date_created_gmt != null)
-325      this.dateCreated = null;
-326  }
-327
-328  /**
-329   * @param dateCreated the dateCreated to set
-330   */
-331  public void setDateCreated(Date dateCreated) {
-332    this.dateCreated = dateCreated;
-333    // one of dateCreated() and date_created_gmt() has to be null
-334    // or the behavior when two of them are different is undefined
-335    if (this.dateCreated != null)
-336      this.date_created_gmt = null;
-337  }
-338
-339  /**
-340   * @param description the description to set
-341   */
-342  public void setDescription(String description) {
-343    this.description = description;
-344  }
-345
-346  /**
-347   * @param excerpt the excerpt to set
-348   */
-349  public void setExcerpt(String excerpt) {
-350    this.mt_excerpt = excerpt;
-351  }
-352
-353  /**
-354   * @param link the link to set
-355   */
-356  public void setLink(String link) {
-357    this.link = link;
-358  }
-359
-360  /**
-361   * @param mt_allow_comments the mt_allow_comments to set
-362   */
-363  public void setMt_allow_comments(Integer mt_allow_comments) {
-364    this.mt_allow_comments = mt_allow_comments;
-365  }
-366
-367  /**
-368   * @param mt_allow_pings the mt_allow_pings to set
-369   */
-370  public void setMt_allow_pings(Integer mt_allow_pings) {
-371    this.mt_allow_pings = mt_allow_pings;
-372  }
-373
-374  /**
-375   * @param mt_keywords the mt_keywords to set
-376   */
-377  public void setMt_keywords(String mt_keywords) {
-378    this.mt_keywords = mt_keywords;
-379  }
-380
-381  /**
-382   * @param mt_text_more to set
-383   */
-384  public void setMt_text_more(String mt_text_more) {
-385    this.mt_text_more = mt_text_more;
-386  }
-387
-388  /**
-389   * @param page_id the page_id to set
-390   */
-391  public void setPage_id(Integer page_id) {
-392    this.page_id = page_id;
-393  }
-394
-395  /**
-396   * @param page_status the page_status to set
-397   */
-398  public void setPage_status(String page_status) {
-399    this.page_status = page_status;
-400  }
-401
-402  /**
-403   * @param permaLink the permaLink to set
-404   */
-405  public void setPermaLink(String permaLink) {
-406    this.permaLink = permaLink;
-407  }
-408
-409  /**
-410   * @param postStatus the post_status to set
-411   */
-412  public void setPost_status(String postStatus) {
-413    this.post_status = postStatus;
-414  }
-415
-416  /**
-417   * @param post_type the post_type to set
-418   */
-419  public void setPost_type(String post_type) {
-420    this.post_type = post_type;
-421  }
-422
-423  /**
-424   * @param postid the postid to set
-425   */
-426  public void setPostid(Integer postid) {
-427    this.postid = postid;
-428  }
-429
-430  /**
-431   * @param title the title to set
-432   */
-433  public void setTitle(String title) {
-434    this.title = title;
-435  }
-436
-437  /**
-438   * @param userid the userid to set
-439   */
-440  public void setUserid(String userid) {
-441    this.userid = userid;
-442  }
-443
-444  /**
-445   * @param wp_author the wp_author to set
-446   */
-447  public void setWp_author(String wp_author) {
-448    this.wp_author = wp_author;
-449  }
-450
-451  /**
-452   * @param wp_author_display_name the wp_author_display_name to set
-453   */
-454  public void setWp_author_display_name(String wp_author_display_name) {
-455    this.wp_author_display_name = wp_author_display_name;
-456  }
-457
-458  /**
-459   * @param wp_author_id the wp_author_id to set
-460   */
-461  public void setWp_author_id(String wp_author_id) {
-462    this.wp_author_id = wp_author_id;
-463  }
-464
-465  /**
-466   * @param wp_page_order the wp_page_order to set
-467   */
-468  public void setWp_page_order(Integer wp_page_order) {
-469    this.wp_page_order = wp_page_order;
-470  }
-471
-472  /**
-473   * @param wp_page_parent_id the wp_page_parent_id to set
-474   */
-475  public void setWp_page_parent_id(Integer wp_page_parent_id) {
-476    this.wp_page_parent_id = wp_page_parent_id;
-477  }
-478
-479  /**
-480   * @param wp_page_parent_title the wp_page_parent_title to set
-481   */
-482  public void setWp_page_parent_title(String wp_page_parent_title) {
-483    this.wp_page_parent_title = wp_page_parent_title;
-484  }
-485
-486  /**
-487   * @param wp_password the wp_password to set
-488   */
-489  public void setWp_password(String wp_password) {
-490    this.wp_password = wp_password;
-491  }
-492  
-493  /**
-494    * @return thumbnail ID. This is the ID of the MediaObject in Wordpress
-495    */
-496  public String getWp_post_thumbnail() {
-497    return wp_post_thumbnail;
-498  }
-499
-500  /**
-501    * @param wp_post_thumbnail set the post thumbnail (feature image). This is the ID of the Media
-502    * object already created with MediaObject class 
-503    */
-504  public void setWp_post_thumbnail(String wp_post_thumbnail) {
-505    this.wp_post_thumbnail = wp_post_thumbnail;
-506  }
-507
-508  /**
-509   * @param wp_slug the wp_slug to set
-510   */
-511  public void setWp_slug(String wp_slug) {
-512    this.wp_slug = wp_slug;
-513  }
-514}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - diff --git a/doc/src-html/net/bican/wordpress/PageDefinition.html b/doc/src-html/net/bican/wordpress/PageDefinition.html deleted file mode 100644 index 4ca48c7..0000000 --- a/doc/src-html/net/bican/wordpress/PageDefinition.html +++ /dev/null @@ -1,171 +0,0 @@ - - - -Source code - - - -
-
001/*
-002 * 
-003 * Wordpress-java
-004 * http://code.google.com/p/wordpress-java/
-005 * 
-006 * Copyright 2012 Can Bican <can@bican.net>
-007 * See the file 'COPYING' in the distribution for licensing terms.
-008 * 
-009 */
-010package net.bican.wordpress;
-011
-012import java.util.Date;
-013
-014/**
-015 * 
-016 * A trimmed version of <code>Page</code> object, that is returned in lists
-017 * 
-018 * @author Can Bican &lt;can@bican.net&gt;
-019 * 
-020 */
-021public class PageDefinition extends XmlRpcMapped implements StringHeader {
-022  String page_title;
-023
-024  String page_parent_id;
-025
-026  Date dateCreated;
-027
-028  Date date_created_gmt;
-029
-030  /**
-031   * @return the page_title
-032   */
-033  public String getPage_title() {
-034    return this.page_title;
-035  }
-036
-037  /**
-038   * @param page_title the page_title to set
-039   */
-040  public void setPage_title(String page_title) {
-041    this.page_title = page_title;
-042  }
-043
-044  /**
-045   * @return the page_parent_id
-046   */
-047  public String getPage_parent_id() {
-048    return this.page_parent_id;
-049  }
-050
-051  /**
-052   * @param page_parent_id the page_parent_id to set
-053   */
-054  public void setPage_parent_id(String page_parent_id) {
-055    this.page_parent_id = page_parent_id;
-056  }
-057
-058  /**
-059   * @return the dateCreated
-060   */
-061  public Date getDateCreated() {
-062    return this.dateCreated;
-063  }
-064
-065  /**
-066   * @param dateCreated the dateCreated to set
-067   */
-068  public void setDateCreated(Date dateCreated) {
-069    this.dateCreated = dateCreated;
-070  }
-071
-072  /**
-073   * @return the date_created_gmt
-074   */
-075  public Date getDate_created_gmt() {
-076    return this.date_created_gmt;
-077  }
-078
-079  /**
-080   * @param date_created_gmt the date_created_gmt to set
-081   */
-082  public void setDate_created_gmt(Date date_created_gmt) {
-083    this.date_created_gmt = date_created_gmt;
-084  }
-085
-086  /**
-087   * (non-Javadoc)
-088   * 
-089   * @see net.bican.wordpress.StringHeader#getStringHeader()
-090   */
-091  @Override
-092  @SuppressWarnings("nls")
-093  public String getStringHeader() {
-094    final String TAB = ":";
-095    return "Date Created" + TAB + "Date Created(GMT)" + TAB + "Parent ID" + TAB
-096        + "Page Title";
-097  }
-098
-099}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - diff --git a/doc/src-html/net/bican/wordpress/Ping.html b/doc/src-html/net/bican/wordpress/Ping.html deleted file mode 100644 index 896faad..0000000 --- a/doc/src-html/net/bican/wordpress/Ping.html +++ /dev/null @@ -1,139 +0,0 @@ - - - -Source code - - - -
-
001/*
-002 * 
-003 * Wordpress-java
-004 * http://code.google.com/p/wordpress-java/
-005 * 
-006 * Copyright 2012 Can Bican <can@bican.net>
-007 * See the file 'COPYING' in the distribution for licensing terms.
-008 * 
-009 */
-010package net.bican.wordpress;
-011
-012/**
-013 * 
-014 * Class that hold trackback information
-015 * 
-016 * @author Can Bican &lt;can@bican.net&gt;
-017 * 
-018 */
-019public class Ping extends XmlRpcMapped {
-020  String pingTitle;
-021
-022  String pingURL;
-023
-024  String pingIP;
-025
-026  /**
-027   * @return the pingTitle
-028   */
-029  public String getPingTitle() {
-030    return this.pingTitle;
-031  }
-032
-033  /**
-034   * @param pingTitle the pingTitle to set
-035   */
-036  public void setPingTitle(String pingTitle) {
-037    this.pingTitle = pingTitle;
-038  }
-039
-040  /**
-041   * @return the pingURL
-042   */
-043  public String getPingURL() {
-044    return this.pingURL;
-045  }
-046
-047  /**
-048   * @param pingURL the pingURL to set
-049   */
-050  public void setPingURL(String pingURL) {
-051    this.pingURL = pingURL;
-052  }
-053
-054  /**
-055   * @return the pingIP
-056   */
-057  public String getPingIP() {
-058    return this.pingIP;
-059  }
-060
-061  /**
-062   * @param pingIP the pingIP to set
-063   */
-064  public void setPingIP(String pingIP) {
-065    this.pingIP = pingIP;
-066  }
-067}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - diff --git a/doc/src-html/net/bican/wordpress/PostAndPageStatus.html b/doc/src-html/net/bican/wordpress/PostAndPageStatus.html deleted file mode 100644 index 3aae215..0000000 --- a/doc/src-html/net/bican/wordpress/PostAndPageStatus.html +++ /dev/null @@ -1,135 +0,0 @@ - - - -Source code - - - -
-
001/*
-002 * 
-003 * Wordpress-java
-004 * http://code.google.com/p/wordpress-java/
-005 * 
-006 * Copyright 2012 Can Bican <can@bican.net>
-007 * See the file 'COPYING' in the distribution for licensing terms.
-008 * 
-009 */
-010package net.bican.wordpress;
-011
-012/**
-013 * 
-014 * Status values for posts and pages
-015 * 
-016 * @author Can Bican <can@bican.net>
-017 * 
-018 */
-019public class PostAndPageStatus extends XmlRpcMapped implements StringHeader {
-020  String status;
-021
-022  String description;
-023
-024  /**
-025   * @return the status
-026   */
-027  public String getStatus() {
-028    return this.status;
-029  }
-030
-031  /**
-032   * @param status the status to set
-033   */
-034  public void setStatus(String status) {
-035    this.status = status;
-036  }
-037
-038  /**
-039   * @return the description
-040   */
-041  public String getDescription() {
-042    return this.description;
-043  }
-044
-045  /**
-046   * @param description the description to set
-047   */
-048  public void setDescription(String description) {
-049    this.description = description;
-050  }
-051
-052  /**
-053   * 
-054   * (non-Javadoc)
-055   * 
-056   * @see net.bican.wordpress.StringHeader#getStringHeader()
-057   */
-058  @Override
-059  @SuppressWarnings("nls")
-060  public String getStringHeader() {
-061    return "";
-062  }
-063}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - diff --git a/doc/src-html/net/bican/wordpress/StringHeader.html b/doc/src-html/net/bican/wordpress/StringHeader.html deleted file mode 100644 index 7b16d56..0000000 --- a/doc/src-html/net/bican/wordpress/StringHeader.html +++ /dev/null @@ -1,96 +0,0 @@ - - - -Source code - - - -
-
001/*
-002 * 
-003 * Wordpress-java
-004 * http://code.google.com/p/wordpress-java/
-005 * 
-006 * Copyright 2012 Can Bican <can@bican.net>
-007 * See the file 'COPYING' in the distribution for licensing terms.
-008 * 
-009 */
-010package net.bican.wordpress;
-011
-012/**
-013 * 
-014 * Interface for supplying a header for tabular output in toString()
-015 * 
-016 * @author Can Bican &lt;can@bican.net&gt;
-017 * 
-018 */
-019public interface StringHeader {
-020  /**
-021   * @return Header list
-022   */
-023  public String getStringHeader();
-024}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - diff --git a/doc/src-html/net/bican/wordpress/User.html b/doc/src-html/net/bican/wordpress/User.html deleted file mode 100644 index ba7385e..0000000 --- a/doc/src-html/net/bican/wordpress/User.html +++ /dev/null @@ -1,185 +0,0 @@ - - - -Source code - - - -
-
001/*
-002 * 
-003 * Wordpress-java
-004 * http://code.google.com/p/wordpress-java/
-005 * 
-006 * Copyright 2012 Can Bican <can@bican.net>
-007 * See the file 'COPYING' in the distribution for licensing terms.
-008 * 
-009 */
-010package net.bican.wordpress;
-011
-012/**
-013 * 
-014 * Class that keeps user information from blogger style calls
-015 * 
-016 * @author Can Bican &lt;can@bican.net&gt;
-017 * 
-018 */
-019public class User extends XmlRpcMapped implements StringHeader {
-020  String nickname;
-021
-022  Integer userid;
-023
-024  String url;
-025
-026  String lastname;
-027
-028  String firstname;
-029
-030  /**
-031   * (non-Javadoc)
-032   * 
-033   * @see net.bican.wordpress.StringHeader#getStringHeader()
-034   */
-035  @Override
-036  @SuppressWarnings("nls")
-037  public String getStringHeader() {
-038    final String TAB = ":";
-039    return "First name" + TAB + "Last name" + TAB + "Nick name" + TAB + "Url"
-040        + TAB + "User ID";
-041  }
-042
-043  /**
-044   * @return the nickname
-045   */
-046  public String getNickname() {
-047    return this.nickname;
-048  }
-049
-050  /**
-051   * @param nickname the nickname to set
-052   */
-053  public void setNickname(String nickname) {
-054    this.nickname = nickname;
-055  }
-056
-057  /**
-058   * @return the userid
-059   */
-060  public Integer getUserid() {
-061    return this.userid;
-062  }
-063
-064  /**
-065   * @param userid the userid to set
-066   */
-067  public void setUserid(Integer userid) {
-068    this.userid = userid;
-069  }
-070
-071  /**
-072   * @return the url
-073   */
-074  public String getUrl() {
-075    return this.url;
-076  }
-077
-078  /**
-079   * @param url the url to set
-080   */
-081  public void setUrl(String url) {
-082    this.url = url;
-083  }
-084
-085  /**
-086   * @return the lastname
-087   */
-088  public String getLastname() {
-089    return this.lastname;
-090  }
-091
-092  /**
-093   * @param lastname the lastname to set
-094   */
-095  public void setLastname(String lastname) {
-096    this.lastname = lastname;
-097  }
-098
-099  /**
-100   * @return the firstname
-101   */
-102  public String getFirstname() {
-103    return this.firstname;
-104  }
-105
-106  /**
-107   * @param firstname the firstname to set
-108   */
-109  public void setFirstname(String firstname) {
-110    this.firstname = firstname;
-111  }
-112
-113}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - diff --git a/doc/src-html/net/bican/wordpress/Wordpress.html b/doc/src-html/net/bican/wordpress/Wordpress.html deleted file mode 100644 index 364ae2a..0000000 --- a/doc/src-html/net/bican/wordpress/Wordpress.html +++ /dev/null @@ -1,1254 +0,0 @@ - - - -Source code - - - -
-
001/*
-002 * 
-003 * Wordpress-java
-004 * http://code.google.com/p/wordpress-java/
-005 * 
-006 * Copyright 2012 Can Bican <can@bican.net>
-007 * See the file 'COPYING' in the distribution for licensing terms.
-008 * 
-009 */
-010package net.bican.wordpress;
-011
-012import java.io.File;
-013import java.io.FileInputStream;
-014import java.io.FileNotFoundException;
-015import java.io.IOException;
-016import java.io.InputStream;
-017import java.net.MalformedURLException;
-018import java.net.URL;
-019import java.util.ArrayList;
-020import java.util.List;
-021
-022import redstone.xmlrpc.XmlRpcArray;
-023import redstone.xmlrpc.XmlRpcFault;
-024import redstone.xmlrpc.XmlRpcProxy;
-025import redstone.xmlrpc.XmlRpcStruct;
-026
-027interface BloggerBridge {
-028  /**
-029   * @param blogid
-030   *          Blog id, not used in wordpress
-031   * @param username
-032   *          User name
-033   * @param password
-034   *          Password
-035   * @param post_ID
-036   *          Page ID to delete
-037   * @param publish
-038   *          Publish status
-039   * @return result of deletion
-040   * @throws XmlRpcFault
-041   */
-042  Boolean deletePost(Integer blogid, Integer post_ID, String username,
-043      String password, String publish) throws XmlRpcFault;
-044
-045  /**
-046   * @param placeHolder
-047   *          No reference about what it is in xmlrpc.php, but it's not used
-048   * @param blogid
-049   *          Blog id, not used in wordpress
-050   * @param username
-051   *          User name
-052   * @param password
-053   *          Password
-054   * @param template
-055   *          Template, not used in wordpress
-056   * @return Template page
-057   * @throws XmlRpcFault
-058   */
-059  String getTemplate(Integer placeHolder, Integer blogid, String username,
-060      String password, String template) throws XmlRpcFault;
-061
-062  /**
-063   * @param placeHolder
-064   *          No reference about what it is in xmlrpc.php, but it's not used
-065   * @param username
-066   *          User name
-067   * @param password
-068   *          Password
-069   * @return User information
-070   * @throws XmlRpcFault
-071   */
-072  XmlRpcStruct getUserInfo(Integer placeHolder, String username, String password)
-073      throws XmlRpcFault;
-074
-075  /**
-076   * @param placeHolder
-077   *          No reference about what it is in xmlrpc.php, but it's not used
-078   * @param username
-079   *          User name
-080   * @param password
-081   *          Password
-082   * @return Blog that user has
-083   * @throws XmlRpcFault
-084   */
-085  XmlRpcArray getUsersBlogs(Integer placeHolder, String username,
-086      String password) throws XmlRpcFault;
-087
-088  /**
-089   * @param placeHolder
-090   *          No reference about what it is in xmlrpc.php, but it's not used
-091   * @param blogid
-092   *          Blog id, not used in wordpress
-093   * @param username
-094   *          User name
-095   * @param password
-096   *          Password
-097   * @param content
-098   *          Content of the template
-099   * @param template
-100   *          Template, not used in wordpress
-101   * @return Result of the operation
-102   * @throws XmlRpcFault
-103   */
-104  Boolean setTemplate(Integer placeHolder, Integer blogid, String username,
-105      String password, String content, String template) throws XmlRpcFault;
-106}
-107
-108interface DemoBridge {
-109  /**
-110   * @param number1
-111   *          first number
-112   * @param number2
-113   *          second number
-114   * @return addition of the arguments
-115   * @throws XmlRpcFault
-116   */
-117  Double addTwoNumbers(Double number1, Double number2) throws XmlRpcFault;
-118
-119  /**
-120   * @return A very important message
-121   * @throws XmlRpcFault
-122   */
-123  String sayHello() throws XmlRpcFault;
-124}
-125
-126interface MetaWebLogBridge {
-127  /**
-128   * @param post_ID
-129   *          ID of the post to edit
-130   * @param username
-131   *          User name
-132   * @param password
-133   *          Password
-134   * @param post
-135   *          Page information
-136   * @param publish
-137   *          Post status
-138   * @return result of edit
-139   * @throws XmlRpcFault
-140   */
-141  Boolean editPost(Integer post_ID, String username, String password,
-142      XmlRpcStruct post, String publish) throws XmlRpcFault;
-143
-144  /**
-145   * @param post_ID
-146   *          ID of the post to retrieve
-147   * @param username
-148   *          User name
-149   * @param password
-150   *          Password
-151   * @return Page information
-152   * @throws XmlRpcFault
-153   */
-154  XmlRpcStruct getPost(Integer post_ID, String username, String password)
-155      throws XmlRpcFault;
-156
-157  /**
-158   * @param blogid
-159   *          Blog id (not used in wordpress)
-160   * @param username
-161   *          User name
-162   * @param password
-163   *          Password
-164   * @param num_posts
-165   *          Number of posts to retrieve
-166   * @return List of pages
-167   * @throws XmlRpcFault
-168   */
-169  XmlRpcArray getRecentPosts(Integer blogid, String username, String password,
-170      Integer num_posts) throws XmlRpcFault;
-171
-172  /**
-173   * @param blogid
-174   *          Blog id (not used in wordpress)
-175   * @param username
-176   *          User name
-177   * @param password
-178   *          Password
-179   * @param data
-180   *          Data Structure (type,bits,overwrite)
-181   * @return result of the upload
-182   * @throws XmlRpcFault
-183   */
-184  XmlRpcStruct newMediaObject(Integer blogid, String username, String password,
-185      XmlRpcStruct data) throws XmlRpcFault;
-186
-187  /**
-188   * @param blogid
-189   *          Blog id (not used in wordpress)
-190   * @param username
-191   *          User name
-192   * @param password
-193   *          Password
-194   * @param post
-195   *          Post structure
-196   * @param publish
-197   *          Publish status
-198   * @return post id
-199   * @throws XmlRpcFault
-200   */
-201  String newPost(Integer blogid, String username, String password,
-202      XmlRpcStruct post, Boolean publish) throws XmlRpcFault;
-203}
-204
-205interface MovableTypeBridge {
-206  /**
-207   * @return List of methods the server supports
-208   * @throws XmlRpcFault
-209   */
-210  XmlRpcArray supportedMethods() throws XmlRpcFault;
-211
-212  /**
-213   * @return List of supported text filters
-214   * @throws XmlRpcFault
-215   */
-216  XmlRpcArray supportedTextFilters() throws XmlRpcFault;
-217
-218  /**
-219   * @param PostId
-220   *          Post id
-221   * @return List of trackbacks for the post
-222   * @throws XmlRpcFault
-223   */
-224  XmlRpcArray getTrackbackPings(Integer PostId) throws XmlRpcFault;
-225}
-226
-227interface PingbackBridge {
-228  /**
-229   * @param pagelinkedfrom
-230   *          Source
-231   * @param pagelinkedto
-232   *          Destination
-233   * @return response string
-234   * @throws XmlRpcFault
-235   */
-236  String ping(String pagelinkedfrom, String pagelinkedto) throws XmlRpcFault;
-237}
-238
-239interface PingbackExtensionsBridge {
-240  /**
-241   * @param url
-242   *          url of the page queried
-243   * @return Array of URLs
-244   * @throws XmlRpcFault
-245   */
-246  XmlRpcArray getPingbacks(String url) throws XmlRpcFault;
-247}
-248
-249/**
-250 * 
-251 * The utility class that links xmlrpc calls to Java functions.
-252 * 
-253 * @author Can Bican &lt;can@bican.net&gt;
-254 * 
-255 */
-256public class Wordpress {
-257
-258  private static byte[] getBytesFromFile(File file) {
-259    byte[] result = null;
-260    InputStream is = null;
-261    try {
-262      is = new FileInputStream(file);
-263
-264      // Get the size of the file
-265      long length = file.length();
-266
-267      // You cannot create an array using a long type.
-268      // It needs to be an int type.
-269      // Before converting to an int type, check
-270      // to ensure that file is not larger than Integer.MAX_VALUE.
-271      if (length > Integer.MAX_VALUE) {
-272        // File is too large
-273      }
-274
-275      // Create the byte array to hold the data
-276      byte[] bytes = new byte[(int) length];
-277
-278      // Read in the bytes
-279      int offset = 0;
-280      int numRead = 0;
-281      while (offset < bytes.length
-282          && (numRead = is.read(bytes, offset, bytes.length - offset)) >= 0) {
-283        offset += numRead;
-284      }
-285
-286      // Ensure all the bytes have been read in
-287      if (offset < bytes.length) {
-288        throw new IOException(
-289            "Could not completely read file " + file.getName()); //$NON-NLS-1$
-290      }
-291      result = bytes;
-292    } catch (FileNotFoundException e) {
-293      e.printStackTrace();
-294    } catch (IOException e) {
-295      e.printStackTrace();
-296    } finally {
-297      if (is != null)
-298        try {
-299          is.close();
-300        } catch (IOException e) {
-301          e.printStackTrace();
-302        }
-303    }
-304    return result;
-305  }
-306
-307  private BloggerBridge            blogger;
-308
-309  private DemoBridge               demo        = null;
-310
-311  private MovableTypeBridge        mt          = null;
-312
-313  private MetaWebLogBridge         mw          = null;
-314
-315  private String                   password    = null;
-316
-317  private PingbackBridge           pingback    = null;
-318
-319  private PingbackExtensionsBridge pingbackExt = null;
-320
-321  private String                   username    = null;
-322
-323  private WordpressBridge          wp          = null;
-324
-325  private String                   xmlRpcUrl   = null;
-326
-327  @SuppressWarnings("unused")
-328  private Wordpress() {
-329    // no default constructor - class needs username, password and url
-330  }
-331
-332  /**
-333   * @param username
-334   *          User name
-335   * @param password
-336   *          Password
-337   * @param xmlRpcUrl
-338   *          xmlrpc communication point, usually blogurl/xmlrpc.php
-339   * @throws MalformedURLException
-340   *           If the URL is faulty
-341   */
-342  public Wordpress(String username, String password, String xmlRpcUrl)
-343      throws MalformedURLException {
-344    this.username = username;
-345    this.password = password;
-346    this.xmlRpcUrl = xmlRpcUrl;
-347    initMetaWebLog();
-348  }
-349
-350  /**
-351   * @param number1
-352   *          First number
-353   * @param number2
-354   *          Second number
-355   * @return addition of two numbers
-356   * @throws XmlRpcFault
-357   *           Generic exception for xml-rpc operations
-358   */
-359  @SuppressWarnings("boxing")
-360  public double addTwoNumbers(double number1, double number2)
-361      throws XmlRpcFault {
-362    return this.demo.addTwoNumbers(number1, number2);
-363  }
-364
-365  /**
-366   * @param post_ID
-367   *          ID of the page to delete
-368   * @param publish
-369   *          Publish status
-370   * @return Result of deletion
-371   * @throws XmlRpcFault
-372   *           Generic exception for xml-rpc operations
-373   */
-374  @SuppressWarnings("boxing")
-375  public Boolean deletePage(int post_ID, String publish) throws XmlRpcFault {
-376    return this.wp.deletePage(0, this.username, this.password,
-377        Integer.valueOf(post_ID), publish);
-378  }
-379
-380  /**
-381   * @param post_ID
-382   *          ID of the post to delete
-383   * @param publish
-384   *          Publish status
-385   * @return result of deletion
-386   * @throws XmlRpcFault
-387   *           Generic exception for xml-rpc operations
-388   */
-389  @SuppressWarnings("boxing")
-390  public Boolean deletePost(int post_ID, String publish) throws XmlRpcFault {
-391    return this.blogger.deletePost(0, post_ID, this.username, this.password,
-392        publish);
-393  }
-394
-395  /**
-396   * @param post_ID
-397   *          ID of the post to edit
-398   * @param page
-399   *          Page information
-400   * @param publish
-401   *          Publish status
-402   * @return Result of edit
-403   * @throws XmlRpcFault
-404   *           Generic exception for xml-rpc operations
-405   */
-406  @SuppressWarnings("boxing")
-407  public Boolean editPage(int post_ID, Page page, String publish)
-408      throws XmlRpcFault {
-409    XmlRpcStruct post = page.toXmlRpcStruct();
-410    return this.wp.editPage(0, post_ID, this.username, this.password, post,
-411        publish);
-412  }
-413
-414  /**
-415   * @param post_ID
-416   *          ID of the post to edit
-417   * @param page
-418   *          Page information
-419   * @param publish
-420   *          Publish status
-421   * @return result of edit
-422   * @throws XmlRpcFault
-423   *           Generic exception for xml-rpc operations
-424   */
-425  @SuppressWarnings("boxing")
-426  public Boolean editPost(int post_ID, Page page, String publish)
-427      throws XmlRpcFault {
-428    XmlRpcStruct post = page.toXmlRpcStruct();
-429    return this.mw.editPost(post_ID, this.username, this.password, post,
-430        publish);
-431  }
-432
-433  @SuppressWarnings({ "rawtypes", "unchecked", "static-method" })
-434  private List fillFromXmlRpcArray(XmlRpcArray r, Class cl) {
-435    List result = null;
-436    try {
-437      result = new ArrayList();
-438      for (Object o : r) {
-439        XmlRpcMapped n = (XmlRpcMapped) cl.newInstance();
-440        if (o instanceof String) {
-441          result.add(o);
-442        } else {
-443          n.fromXmlRpcStruct((XmlRpcStruct) o);
-444        }
-445        result.add(n);
-446      }
-447    } catch (InstantiationException e) {
-448      e.printStackTrace();
-449    } catch (IllegalAccessException e) {
-450      e.printStackTrace();
-451    }
-452    return result;
-453  }
-454
-455  @SuppressWarnings("static-method")
-456  private List<String> fromStringArray(XmlRpcArray r) {
-457    List<String> result;
-458    result = new ArrayList<String>();
-459    for (Object object : r) {
-460      result.add((String) object);
-461    }
-462    return result;
-463  }
-464
-465  /**
-466   * @return List of authors
-467   * @throws XmlRpcFault
-468   *           Generic exception for xml-rpc operations
-469   */
-470  @SuppressWarnings("unchecked")
-471  public List<Author> getAuthors() throws XmlRpcFault {
-472    XmlRpcArray r = this.wp.getAuthors(0, this.username, this.password);
-473    return fillFromXmlRpcArray(r, Author.class);
-474  }
-475
-476  /**
-477   * @return List of categories
-478   * @throws XmlRpcFault
-479   *           Generic exception for xml-rpc operations
-480   */
-481  @SuppressWarnings("unchecked")
-482  public List<Category> getCategories() throws XmlRpcFault {
-483    XmlRpcArray r = this.wp.getCategories(0, this.username, this.password);
-484    return fillFromXmlRpcArray(r, Category.class);
-485  }
-486
-487  /**
-488   * @param pageid
-489   *          Page ID
-490   * @return The <code>Page</code> object.
-491   * @throws XmlRpcFault
-492   *           Generic exception for xml-rpc operations
-493   */
-494  @SuppressWarnings("boxing")
-495  public Page getPage(int pageid) throws XmlRpcFault {
-496    XmlRpcStruct r = this.wp.getPage(0, pageid, this.username, this.password);
-497    Page result = new Page();
-498    result.fromXmlRpcStruct(r);
-499    return result;
-500  }
-501
-502  /**
-503   * @return List of Pages, short format
-504   * @throws XmlRpcFault
-505   *           Generic exception for xml-rpc operations
-506   */
-507  @SuppressWarnings({ "unchecked", "boxing" })
-508  public List<PageDefinition> getPageList() throws XmlRpcFault {
-509    XmlRpcArray r = this.wp.getPageList(0, this.username, this.password);
-510    return fillFromXmlRpcArray(r, PageDefinition.class);
-511  }
-512
-513  /**
-514   * @return List of Pages, in full format
-515   * @throws XmlRpcFault
-516   *           Generic exception for xml-rpc operations
-517   */
-518  @SuppressWarnings({ "unchecked", "boxing" })
-519  public List<Page> getPages() throws XmlRpcFault {
-520    XmlRpcArray r = this.wp.getPages(0, this.username, this.password);
-521    return fillFromXmlRpcArray(r, Page.class);
-522  }
-523
-524  /**
-525   * @param postId
-526   *          Post ID
-527   * @return Trackbacks for the post
-528   * @throws XmlRpcFault
-529   *           Generic exception for xml-rpc operations
-530   */
-531  @SuppressWarnings({ "unchecked", "boxing" })
-532  public List<Ping> getTrackbackPings(int postId) throws XmlRpcFault {
-533    XmlRpcArray r = this.mt.getTrackbackPings(postId);
-534    return fillFromXmlRpcArray(r, Ping.class);
-535  }
-536
-537  /**
-538   * @param url
-539   *          Url of the page queried
-540   * @return List of URLs
-541   * @throws XmlRpcFault
-542   *           Generic exception for xml-rpc operations
-543   */
-544  public List<URL> getPingbacks(String url) throws XmlRpcFault {
-545    List<URL> result = null;
-546    try {
-547      XmlRpcArray r = this.pingbackExt.getPingbacks(url);
-548      result = new ArrayList<URL>();
-549      for (Object rec : r) {
-550        result.add(new URL((String) rec));
-551      }
-552    } catch (MalformedURLException e) {
-553      e.printStackTrace();
-554    }
-555    return result;
-556  }
-557
-558  /**
-559   * @param post_ID
-560   *          ID of the post to retrieve
-561   * @return Page information
-562   * @throws XmlRpcFault
-563   *           Generic exception for xml-rpc operations
-564   */
-565  @SuppressWarnings("boxing")
-566  public Page getPost(int post_ID) throws XmlRpcFault {
-567    XmlRpcStruct r = this.mw.getPost(post_ID, this.username, this.password);
-568    Page result = new Page();
-569    result.fromXmlRpcStruct(r);
-570    return result;
-571  }
-572
-573  /**
-574   * @param num_posts
-575   *          Number of posts to be retrieved.
-576   * @return List of pages.
-577   * @throws XmlRpcFault
-578   *           Generic exception for xml-rpc operations
-579   */
-580  @SuppressWarnings({ "unchecked", "boxing" })
-581  public List<Page> getRecentPosts(int num_posts) throws XmlRpcFault {
-582    XmlRpcArray r = this.mw.getRecentPosts(0, this.username, this.password,
-583        num_posts);
-584    return fillFromXmlRpcArray(r, Page.class);
-585  }
-586
-587  /**
-588   * @return Template page
-589   * @throws XmlRpcFault
-590   *           Generic exception for xml-rpc operations
-591   */
-592  @SuppressWarnings({ "boxing", "nls" })
-593  public String getTemplate() throws XmlRpcFault {
-594    return this.blogger.getTemplate(0, 0, this.username, this.password, "");
-595  }
-596
-597  /**
-598   * @return The user information
-599   * @throws XmlRpcFault
-600   *           Generic exception for xml-rpc operations
-601   */
-602  @SuppressWarnings("boxing")
-603  public User getUserInfo() throws XmlRpcFault {
-604    XmlRpcStruct r = this.blogger.getUserInfo(0, this.username, this.password);
-605    User result = new User();
-606    result.fromXmlRpcStruct(r);
-607    return result;
-608  }
-609
-610  /**
-611   * @return List of blogs the user has (only one in wordpress case)
-612   * @throws XmlRpcFault
-613   *           Generic exception for xml-rpc operations
-614   */
-615  @SuppressWarnings({ "unchecked", "boxing" })
-616  public List<Blog> getUsersBlogs() throws XmlRpcFault {
-617    XmlRpcArray r = this.blogger.getUsersBlogs(0, this.username, this.password);
-618    return fillFromXmlRpcArray(r, Blog.class);
-619  }
-620
-621  @SuppressWarnings("nls")
-622  private void initMetaWebLog() throws MalformedURLException {
-623    final URL url = new URL(this.xmlRpcUrl);
-624    this.wp = (WordpressBridge) XmlRpcProxy.createProxy(url, "wp",
-625        new Class[] { WordpressBridge.class }, true);
-626    this.mw = (MetaWebLogBridge) XmlRpcProxy.createProxy(url, "metaWeblog",
-627        new Class[] { MetaWebLogBridge.class }, true);
-628    this.mt = (MovableTypeBridge) XmlRpcProxy.createProxy(url, "mt",
-629        new Class[] { MovableTypeBridge.class }, true);
-630    this.demo = (DemoBridge) XmlRpcProxy.createProxy(url, "demo",
-631        new Class[] { DemoBridge.class }, true);
-632    this.pingback = (PingbackBridge) XmlRpcProxy.createProxy(url, "pingback",
-633        new Class[] { PingbackBridge.class }, true);
-634    this.blogger = (BloggerBridge) XmlRpcProxy.createProxy(url, "blogger",
-635        new Class[] { BloggerBridge.class }, true);
-636    this.pingbackExt = (PingbackExtensionsBridge) XmlRpcProxy.createProxy(url,
-637        "pingback.extensions", new Class[] { PingbackExtensionsBridge.class },
-638        true);
-639  }
-640
-641  /**
-642   * @param name
-643   *          Category name
-644   * @param slug
-645   *          Category short name
-646   * @param parentId
-647   *          Parent ID
-648   * @return New category id
-649   * @throws XmlRpcFault
-650   *           Generic exception for xml-rpc operations
-651   */
-652  @SuppressWarnings({ "unchecked", "nls", "boxing" })
-653  public int newCategory(String name, String slug, int parentId)
-654      throws XmlRpcFault {
-655    XmlRpcStruct h = new XmlRpcStruct();
-656    h.put("name", name);
-657    h.put("slug", slug);
-658    h.put("parent_id", parentId);
-659    return this.wp.newCategory(0, this.username, this.password, h);
-660  }
-661
-662  /**
-663   * @param mimeType
-664   *          Mime type of the file
-665   * @param file
-666   *          File name
-667   * @param overwrite
-668   *          true/false
-669   * @return new object location
-670   * @throws XmlRpcFault
-671   *           Generic exception for xml-rpc operations
-672   */
-673  @SuppressWarnings("boxing")
-674  public MediaObject newMediaObject(String mimeType, File file,
-675      Boolean overwrite) throws XmlRpcFault {
-676    Attachment att = new Attachment();
-677    att.setType(mimeType);
-678    att.setOverwrite(overwrite);
-679    att.setName(file.getName());
-680    att.setBits(getBytesFromFile(file));
-681    XmlRpcStruct d = att.toXmlRpcStruct();
-682    XmlRpcStruct r = this.mw.newMediaObject(0, this.username, this.password, d);
-683    MediaObject result = new MediaObject();
-684    result.fromXmlRpcStruct(r);
-685    return result;
-686  }
-687
-688  /**
-689   * @param post
-690   *          Page information
-691   * @param publish
-692   *          Publish status
-693   * @return Post ID
-694   * @throws XmlRpcFault
-695   *           Generic exception for xml-rpc operations
-696   */
-697  @SuppressWarnings("boxing")
-698  public String newPage(Page post, String publish) throws XmlRpcFault {
-699    return this.wp.newPage(0, this.username, this.password,
-700        post.toXmlRpcStruct(), publish);
-701  }
-702
-703  /**
-704   * @param page
-705   *          Post information
-706   * @param publish
-707   *          Publish status
-708   * @return Post id
-709   * @throws XmlRpcFault
-710   *           Generic exception for xml-rpc operations
-711   */
-712  @SuppressWarnings("boxing")
-713  public String newPost(Page page, boolean publish) throws XmlRpcFault {
-714    return this.mw.newPost(0, this.username, this.password,
-715        page.toXmlRpcStruct(), publish);
-716  }
-717
-718  /**
-719   * @param pagelinkedfrom
-720   *          Source
-721   * @param pagelinkedto
-722   *          Destination
-723   * @return response for ping
-724   * @throws XmlRpcFault
-725   *           Generic exception for xml-rpc operations
-726   */
-727  public String ping(String pagelinkedfrom, String pagelinkedto)
-728      throws XmlRpcFault {
-729    return this.pingback.ping(pagelinkedfrom, pagelinkedto);
-730  }
-731
-732  /**
-733   * @return A very important message
-734   * @throws XmlRpcFault
-735   *           Generic exception for xml-rpc operations
-736   */
-737  public String sayHello() throws XmlRpcFault {
-738    return this.demo.sayHello();
-739  }
-740
-741  /**
-742   * @param content
-743   *          Content of the template
-744   * @return Result of the operation
-745   * @throws XmlRpcFault
-746   *           Generic exception for xml-rpc operations
-747   */
-748  @SuppressWarnings({ "boxing", "nls" })
-749  public boolean setTemplate(String content) throws XmlRpcFault {
-750    return this.blogger.setTemplate(0, 0, this.username, this.password,
-751        content, "");
-752  }
-753
-754  /**
-755   * @param category
-756   *          Category to search
-757   * @param max_results
-758   *          Maximum results to return
-759   * @return List of suggested categories
-760   * @throws XmlRpcFault
-761   *           Generic exception for xml-rpc operations
-762   */
-763  @SuppressWarnings("static-method")
-764  public List<Category> suggestCategories(String category, Integer max_results)
-765      throws XmlRpcFault {
-766    throw new UnsupportedOperationException(); // couldn't quite figure out the
-767    // response.
-768  }
-769
-770  /**
-771   * @return List of supported methods
-772   * @throws XmlRpcFault
-773   *           Generic exception for xml-rpc operations
-774   */
-775  public List<String> supportedMethods() throws XmlRpcFault {
-776    return fromStringArray(this.mt.supportedMethods());
-777  }
-778
-779  /**
-780   * @return List of supported text filters
-781   * @throws XmlRpcFault
-782   *           Generic exception for xml-rpc operations
-783   */
-784  public List<String> supportedTextFilters() throws XmlRpcFault {
-785    return fromStringArray(this.mt.supportedTextFilters());
-786  }
-787
-788  /**
-789   * @return List of supported post status values
-790   * @throws XmlRpcFault
-791   *           Generic exception for xml-rpc operations
-792   */
-793  @SuppressWarnings("boxing")
-794  public List<PostAndPageStatus> getPostStatusList() throws XmlRpcFault {
-795    return processKeyValList(this.wp.getPostStatusList(0, this.username,
-796        this.password));
-797  }
-798
-799  /**
-800   * @return List of supported page status values
-801   * @throws XmlRpcFault
-802   *           Generic exception for xml-rpc operations
-803   */
-804  @SuppressWarnings("boxing")
-805  public List<PostAndPageStatus> getPageStatusList() throws XmlRpcFault {
-806    return processKeyValList(this.wp.getPageStatusList(0, this.username,
-807        this.password));
-808  }
-809
-810  @SuppressWarnings({ "static-method", "nls" })
-811  private List<PostAndPageStatus> processKeyValList(XmlRpcStruct r) {
-812    String response = r.toString();
-813    response = response.replaceAll("[{}]", "").replaceAll(",  *", ",");
-814    String[] responses = response.split(",");
-815    List<PostAndPageStatus> result = new ArrayList<PostAndPageStatus>();
-816    for (String rp : responses) {
-817      String[] keyval = rp.split("=");
-818      PostAndPageStatus pp = new PostAndPageStatus();
-819      pp.setStatus(keyval[0]);
-820      pp.setDescription(keyval[1]);
-821      result.add(pp);
-822    }
-823    return result;
-824  }
-825
-826  /**
-827   * @param post_ID
-828   *          Blog Post ID
-829   * @return Number of comments (approved, spam, otherwise)
-830   * @throws XmlRpcFault
-831   *           Generic exception for xml-rpc operations
-832   */
-833  @SuppressWarnings("boxing")
-834  public CommentCount getCommentsCount(Integer post_ID) throws XmlRpcFault {
-835    XmlRpcStruct struct;
-836    if (post_ID != -1)
-837      struct = this.wp
-838          .getCommentCount(0, this.username, this.password, post_ID);
-839    else
-840      struct = this.wp.getCommentCount(0, this.username, this.password);
-841    CommentCount cc = new CommentCount();
-842    cc.fromXmlRpcStruct(struct);
-843    return cc;
-844  }
-845
-846  /**
-847   * 
-848   * @param status
-849   *          One of "approve", "hold", or "spam". Or, null to show all.
-850   * @param post_id
-851   *          Filter comments by post_id, or null to not filter.
-852   * @param number
-853   *          The number of comments to return, or null for the default (of 10)
-854   * @param offset
-855   *          The offset into the set of comments to return, or null for 0
-856   * @return A list of Comment objects
-857   * @throws XmlRpcFault
-858   *           Generic exception for xml-rpc operations
-859   */
-860  @SuppressWarnings({ "unchecked", "nls", "boxing" })
-861  public List<Comment> getComments(String status, Integer post_id,
-862      Integer number, Integer offset) throws XmlRpcFault {
-863
-864    XmlRpcStruct filter = new XmlRpcStruct();
-865
-866    if (status != null) {
-867      filter.put("status", status);
-868    }
-869
-870    if (post_id != null) {
-871      filter.put("post_id", post_id);
-872    }
-873
-874    if (number != null) {
-875      filter.put("number", number);
-876    }
-877
-878    if (offset != null) {
-879      filter.put("offset", offset);
-880    }
-881
-882    XmlRpcArray r = this.wp
-883        .getComments(0, this.username, this.password, filter);
-884    return fillFromXmlRpcArray(r, Comment.class);
-885  }
-886
-887  /**
-888   * @param comment_id
-889   *          comment_id to fetch
-890   * @return A Comment object
-891   * @throws XmlRpcFault
-892   *           Generic exception for xml-rpc operations
-893   */
-894  @SuppressWarnings("boxing")
-895  public Comment getComment(Integer comment_id) throws XmlRpcFault {
-896    XmlRpcStruct struct = this.wp.getComment(0, this.username, this.password,
-897        comment_id);
-898
-899    Comment comment = new Comment();
-900    comment.fromXmlRpcStruct(struct);
-901
-902    return comment;
-903  }
-904
-905  /**
-906   * @param post_id
-907   *          Post to attach the comment to.
-908   * @param comment_parent
-909   *          Id of the parent comment (for threading)
-910   * @param content
-911   *          Content of comment
-912   * @param author
-913   *          Author's name
-914   * @param author_url
-915   *          Author's URL (can be empty)
-916   * @param author_email
-917   *          Author's Email Address
-918   * @return the id for the newly created comment.
-919   * @throws XmlRpcFault
-920   *           Generic exception for xml-rpc operations
-921   */
-922  @SuppressWarnings({ "unchecked", "nls", "boxing" })
-923  public Integer newComment(Integer post_id, Integer comment_parent,
-924      String content, String author, String author_url, String author_email)
-925      throws XmlRpcFault {
-926
-927    XmlRpcStruct comment = new XmlRpcStruct();
-928
-929    if (comment_parent != null) {
-930      comment.put("comment_parent", comment_parent);
-931    }
-932
-933    comment.put("content", content);
-934    if (author != null)
-935      comment.put("author", author);
-936    if (author_url != null)
-937      comment.put("author_url", author_url);
-938    if (author_email != null)
-939      comment.put("author_email", author_email);
-940
-941    Integer comment_id = this.wp.newComment(0, this.username, this.password,
-942        post_id, comment);
-943
-944    return comment_id;
-945  }
-946
-947  /**
-948   * @return the comment status list
-949   */
-950  public CommentStatusList getCommentStatusList() {
-951    XmlRpcStruct csl = this.wp.getCommentStatusList(0, this.username,
-952        this.password);
-953    CommentStatusList result = new CommentStatusList();
-954    result.fromXmlRpcStruct(csl);
-955    return result;
-956  }
-957
-958  /**
-959   * @param commentID
-960   *          comment id to delete
-961   * @return result of the operation
-962   * @throws XmlRpcFault
-963   */
-964  @SuppressWarnings("boxing")
-965  public boolean deleteComment(int commentID) throws XmlRpcFault {
-966    return this.wp.deleteComment(0, this.username, this.password, commentID);
-967  }
-968
-969  /**
-970   * @param comment
-971   * @return Result of the operation
-972   * @throws XmlRpcFault
-973   */
-974  @SuppressWarnings("boxing")
-975  public boolean editComment(Comment comment) throws XmlRpcFault {
-976    Boolean r = this.wp.editComment(0, this.username, this.password,
-977        comment.getComment_id(), comment);
-978    return r;
-979  }
-980
-981  /**
-982   * @param categoryId
-983   * @return Result of the operation
-984   * @throws XmlRpcFault
-985   */
-986  @SuppressWarnings("boxing")
-987  public int deleteCategory(int categoryId) throws XmlRpcFault {
-988    Object r = this.wp.deleteCategory(0, this.username, this.password,
-989        categoryId);
-990    if (r instanceof Boolean)
-991      return 0;
-992    return (Integer) r;
-993  }
-994}
-995
-996interface WordpressBridge {
-997
-998  Boolean editComment(Integer blogid, String username, String password,
-999      Integer comment_id, Comment comment) throws XmlRpcFault;
-1000
-1001  Object deleteCategory(Integer blogid, String username, String password,
-1002      Integer category_id);
-1003
-1004  Boolean deleteComment(Integer blogid, String username, String password,
-1005      Integer comment_id) throws XmlRpcFault;
-1006
-1007  /**
-1008   * @param blogid
-1009   *          Blog id, not used in wordpress
-1010   * @param username
-1011   *          User name
-1012   * @param password
-1013   *          Password
-1014   * @param post_ID
-1015   *          ID of the post to delete
-1016   * @param publish
-1017   *          Publish status
-1018   * @return Result of deletion--
-1019   * @throws XmlRpcFault
-1020   */
-1021  Boolean deletePage(Integer blogid, String username, String password,
-1022      Integer post_ID, String publish) throws XmlRpcFault;
-1023
-1024  XmlRpcStruct getCommentStatusList(int i, String username, String password);
-1025
-1026  /**
-1027   * @param blogid
-1028   *          Blog id, not used in wordpress
-1029   * @param post_ID
-1030   *          ID of the post to edit
-1031   * @param username
-1032   *          User name
-1033   * @param password
-1034   *          Password
-1035   * @param post
-1036   *          Post information
-1037   * @param publish
-1038   *          Publish status
-1039   * @return Result of edit
-1040   * @throws XmlRpcFault
-1041   */
-1042  Boolean editPage(Integer blogid, Integer post_ID, String username,
-1043      String password, XmlRpcStruct post, String publish) throws XmlRpcFault;
-1044
-1045  /**
-1046   * @param blogid
-1047   *          Blog id, not used in wordpress
-1048   * @param username
-1049   *          User name
-1050   * @param password
-1051   *          Password
-1052   * @return Array of Authors
-1053   * @throws XmlRpcFault
-1054   */
-1055  XmlRpcArray getAuthors(int blogid, String username, String password)
-1056      throws XmlRpcFault;
-1057
-1058  /**
-1059   * @param blogid
-1060   *          Blog id, not used in wordpress
-1061   * @param username
-1062   *          User name
-1063   * @param password
-1064   *          Password
-1065   * @return Array of categories
-1066   * @throws XmlRpcFault
-1067   */
-1068  XmlRpcArray getCategories(int blogid, String username, String password)
-1069      throws XmlRpcFault;
-1070
-1071  /**
-1072   * @param blogid
-1073   *          Blog id, not used in wordpress
-1074   * @param pageid
-1075   *          Page id
-1076   * @param username
-1077   *          User name
-1078   * @param password
-1079   *          Password
-1080   * @return Page information
-1081   * @throws XmlRpcFault
-1082   */
-1083  XmlRpcStruct getPage(Integer blogid, Integer pageid, String username,
-1084      String password) throws XmlRpcFault;
-1085
-1086  /**
-1087   * @param blogid
-1088   *          Blog id, not used in wordpress
-1089   * @param username
-1090   *          User name
-1091   * @param password
-1092   *          Password
-1093   * @return Array of Pages
-1094   * @throws XmlRpcFault
-1095   */
-1096  XmlRpcArray getPageList(Integer blogid, String username, String password)
-1097      throws XmlRpcFault;
-1098
-1099  /**
-1100   * @param blogid
-1101   *          Blog id, not used in wordpress
-1102   * @param username
-1103   *          User name
-1104   * @param password
-1105   *          Password
-1106   * @return Array of Pages
-1107   * @throws XmlRpcFault
-1108   */
-1109  XmlRpcArray getPages(Integer blogid, String username, String password)
-1110      throws XmlRpcFault;
-1111
-1112  /**
-1113   * @param blogid
-1114   *          Blog id, not used in wordpress
-1115   * @param username
-1116   *          User name
-1117   * @param password
-1118   *          Password
-1119   * @param category
-1120   *          Category information
-1121   * @return new category id
-1122   * @throws XmlRpcFault
-1123   */
-1124  Integer newCategory(Integer blogid, String username, String password,
-1125      XmlRpcStruct category) throws XmlRpcFault;
-1126
-1127  /**
-1128   * @param blogid
-1129   *          Blog id, not used in wordpress
-1130   * @param username
-1131   *          User name
-1132   * @param password
-1133   *          Password
-1134   * @param post
-1135   *          Page information
-1136   * @param publish
-1137   *          Publish status
-1138   * @return Post ID
-1139   * @throws XmlRpcFault
-1140   */
-1141  String newPage(Integer blogid, String username, String password,
-1142      XmlRpcStruct post, String publish) throws XmlRpcFault;
-1143
-1144  /**
-1145   * @param blogid
-1146   *          Blog id, not used in wordpress
-1147   * @param username
-1148   *          User name
-1149   * @param password
-1150   *          Password
-1151   * @param category
-1152   *          Category to search
-1153   * @param max_results
-1154   *          Maximum results to return
-1155   * @return List of suggested categories
-1156   * @throws XmlRpcFault
-1157   */
-1158  XmlRpcArray suggestCategories(Integer blogid, String username,
-1159      String password, String category, Integer max_results) throws XmlRpcFault;
-1160
-1161  XmlRpcStruct getPostStatusList(Integer blogid, String username,
-1162      String password) throws XmlRpcFault;
-1163
-1164  XmlRpcStruct getPageStatusList(Integer blogid, String username,
-1165      String password) throws XmlRpcFault;
-1166
-1167  XmlRpcStruct getCommentCount(Integer blogid, String username,
-1168      String password, Integer post_ID) throws XmlRpcFault;
-1169
-1170  XmlRpcStruct getCommentCount(Integer blogid, String username, String password)
-1171      throws XmlRpcFault;
-1172
-1173  XmlRpcArray getComments(Integer blogid, String username, String password,
-1174      XmlRpcStruct filter) throws XmlRpcFault;
-1175
-1176  XmlRpcStruct getComment(Integer blogid, String username, String password,
-1177      Integer comment_id) throws XmlRpcFault;
-1178
-1179  Integer newComment(Integer blogid, String username, String password,
-1180      Integer post_id, XmlRpcStruct comment) throws XmlRpcFault;
-1181
-1182}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - diff --git a/doc/src-html/net/bican/wordpress/XmlRpcMapped.html b/doc/src-html/net/bican/wordpress/XmlRpcMapped.html deleted file mode 100644 index e184ed8..0000000 --- a/doc/src-html/net/bican/wordpress/XmlRpcMapped.html +++ /dev/null @@ -1,230 +0,0 @@ - - - -Source code - - - -
-
001/*
-002 * 
-003 * Wordpress-java
-004 * http://code.google.com/p/wordpress-java/
-005 * 
-006 * Copyright 2012 Can Bican <can@bican.net>
-007 * See the file 'COPYING' in the distribution for licensing terms.
-008 * 
-009 */
-010package net.bican.wordpress;
-011
-012import java.lang.reflect.Field;
-013import java.text.ParseException;
-014import java.text.SimpleDateFormat;
-015import java.util.Date;
-016
-017import redstone.xmlrpc.XmlRpcStruct;
-018
-019/**
-020 * 
-021 * An object that has the capabilites of converting to/from
-022 * <code>XmlRpcStruct</code>.
-023 * 
-024 * @author Can Bican &lt;can@bican.net&gt;
-025 * 
-026 */
-027public abstract class XmlRpcMapped {
-028
-029  @SuppressWarnings("nls")
-030  private static final SimpleDateFormat sdf = new SimpleDateFormat(
-031      "yyyyMMdd'T'HH:mm:ss");
-032
-033  /**
-034   * (non-Javadoc)
-035   * 
-036   * @param recordDelimiter How to delimit records
-037   * @param fieldDelimiter How to delimit the key/value pairs
-038   * @param showFieldName Whether to show field name or not
-039   * 
-040   * @see java.lang.Object#toString()
-041   */
-042  @SuppressWarnings("nls")
-043  private String toGenericString(String recordDelimiter, String fieldDelimiter,
-044      boolean showFieldName) {
-045    String result = null;
-046    try {
-047      result = "";
-048      Field[] f = this.getClass().getDeclaredFields();
-049      for (Field field : f) {
-050        Class<?> fType = field.getType();
-051        if (showFieldName)
-052          result += field.getName() + fieldDelimiter;
-053        if (fType == Date.class) {
-054          result += sdf.format(field.get(this));
-055        } else {
-056          result += field.get(this);
-057        }
-058        result += recordDelimiter;
-059      }
-060    } catch (IllegalAccessException e) {
-061      // ignore and skip output
-062    }
-063    return result;
-064  }
-065
-066  /**
-067   * (non-Javadoc)
-068   * 
-069   * @see java.lang.Object#toString()
-070   */
-071  @SuppressWarnings("nls")
-072  @Override
-073  public String toString() {
-074    return toGenericString("\n", ":", true);
-075  }
-076
-077  /**
-078   * @return Something similar to toString() but in one line
-079   */
-080  @SuppressWarnings("nls")
-081  public String toOneLinerString() {
-082    return toGenericString(":", "", false).replaceAll(":$", "");
-083  }
-084
-085  /**
-086   * @param x XmlRpcStruct to create the object from
-087   */
-088  @SuppressWarnings("nls")
-089  public void fromXmlRpcStruct(XmlRpcStruct x) {
-090    Field[] f = this.getClass().getDeclaredFields();
-091    String k = null;
-092    Object v = null;
-093    for (Field field : f) {
-094      try {
-095        k = field.getName();
-096        v = x.get(k);
-097        Class<?> kType = field.getType();
-098        if (v != null) {
-099          if (kType == Integer.class) {
-100            if (v.getClass() != Integer.class) {
-101              Integer vInt = Integer.valueOf((String) v);
-102              field.set(this, vInt);
-103            } else {
-104              field.set(this, v);
-105            }
-106          } else if (kType == Date.class) {
-107            try {
-108              if (v.getClass() != Date.class) {
-109                Date vDate = sdf.parse((String) v);
-110                field.set(this, vDate);
-111              } else {
-112                field.set(this, v);
-113              }
-114            } catch (ParseException e) {
-115              throw new IllegalArgumentException(e);
-116            }
-117          } else {
-118            field.set(this, v);
-119          }
-120        }
-121      } catch (IllegalArgumentException e) {
-122        try {
-123          System.err.println("Warning: value \"" + v + "\" is invalid for \""
-124              + k + "\", setting it to \"null\"");
-125          field.set(this, null);
-126        } catch (IllegalAccessException e1) {
-127          System.err.println(field.getName() + ":" + field.getType() + ":"
-128              + x.get(field.getName()));
-129          e1.printStackTrace();
-130        }
-131      } catch (IllegalAccessException e) {
-132        e.printStackTrace();
-133      }
-134    }
-135  }
-136
-137  /**
-138   * @return An XmlRpcStruct that represents the object.
-139   */
-140  @SuppressWarnings("unchecked")
-141  public XmlRpcStruct toXmlRpcStruct() {
-142    XmlRpcStruct result = new XmlRpcStruct();
-143    Field[] f = this.getClass().getDeclaredFields();
-144    for (Field field : f) {
-145      try {
-146        Object o = field.get(this);
-147        if (o != null) {
-148          result.put(field.getName(), o);
-149        }
-150      } catch (IllegalArgumentException e) {
-151        e.printStackTrace();
-152      } catch (IllegalAccessException e) {
-153        e.printStackTrace();
-154      }
-155    }
-156    return result;
-157  }
-158}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - diff --git a/doc/src-html/net/bican/wordpress/configuration/CliConfiguration.html b/doc/src-html/net/bican/wordpress/configuration/CliConfiguration.html deleted file mode 100644 index 3eae56a..0000000 --- a/doc/src-html/net/bican/wordpress/configuration/CliConfiguration.html +++ /dev/null @@ -1,122 +0,0 @@ - - - -Source code - - - -
-
001/*
-002 * 
-003 * Wordpress-java
-004 * http://code.google.com/p/wordpress-java/
-005 * 
-006 * Copyright 2012 Can Bican <can@bican.net>
-007 * See the file 'COPYING' in the distribution for licensing terms.
-008 * 
-009 */
-010package net.bican.wordpress.configuration;
-011
-012import org.apache.commons.cli.BasicParser;
-013import org.apache.commons.cli.CommandLine;
-014import org.apache.commons.cli.CommandLineParser;
-015import org.apache.commons.cli.Option;
-016import org.apache.commons.cli.Options;
-017import org.apache.commons.cli.ParseException;
-018import org.apache.commons.configuration.BaseConfiguration;
-019
-020/**
-021 * 
-022 * Implement a simple CLI configuration in apache commons configuration style
-023 * 
-024 * @author Can Bican &lt;can@bican.net&gt;
-025 * 
-026 */
-027public class CliConfiguration extends BaseConfiguration {
-028  /**
-029   * 
-030   * generates the configuration in terms of arguments and options
-031   * 
-032   * @param args Command line arguments
-033   * @param options Command line options
-034   * @throws ParseException When the configuration cannot be parsed
-035   */
-036  @SuppressWarnings("nls")
-037  public CliConfiguration(String[] args, Options options) throws ParseException {
-038    CommandLineParser parser = new BasicParser();
-039    CommandLine commandLine = parser.parse(options, args);
-040    for (Option option : commandLine.getOptions()) {
-041      String key = option.getLongOpt();
-042      String val = option.getValue();
-043      if (val == null) {
-044        this.addProperty(key, "N/A");
-045      } else {
-046        this.addProperty(key, val);
-047      }
-048    }
-049  }
-050}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - diff --git a/doc/src-html/net/bican/wordpress/configuration/PreferencesConfiguration.html b/doc/src-html/net/bican/wordpress/configuration/PreferencesConfiguration.html deleted file mode 100644 index 1b8dd0e..0000000 --- a/doc/src-html/net/bican/wordpress/configuration/PreferencesConfiguration.html +++ /dev/null @@ -1,110 +0,0 @@ - - - -Source code - - - -
-
001/*
-002 * 
-003 * Wordpress-java
-004 * http://code.google.com/p/wordpress-java/
-005 * 
-006 * Copyright 2012 Can Bican <can@bican.net>
-007 * See the file 'COPYING' in the distribution for licensing terms.
-008 * 
-009 */
-010package net.bican.wordpress.configuration;
-011
-012import java.util.prefs.BackingStoreException;
-013import java.util.prefs.Preferences;
-014
-015import org.apache.commons.configuration.BaseConfiguration;
-016
-017/**
-018 * 
-019 * 
-020 * @author Can Bican &lt;can@bican.net&gt;
-021 * 
-022 */
-023public class PreferencesConfiguration extends BaseConfiguration {
-024
-025  /**
-026   * @param cl Calling class
-027   */
-028  public PreferencesConfiguration(Class<?> cl) {
-029    try {
-030      Preferences p = Preferences.userNodeForPackage(cl);
-031      for (String preference : p.keys()) {
-032        this.addProperty(preference, p.get(preference, null));
-033      }
-034    } catch (BackingStoreException e) {
-035      // then we end up with an empty set of preferences, no big deal
-036    }
-037  }
-038}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - diff --git a/doc/src-html/net/bican/wordpress/configuration/WpCliConfiguration.html b/doc/src-html/net/bican/wordpress/configuration/WpCliConfiguration.html deleted file mode 100644 index 2539ff8..0000000 --- a/doc/src-html/net/bican/wordpress/configuration/WpCliConfiguration.html +++ /dev/null @@ -1,133 +0,0 @@ - - - -Source code - - - -
-
001/*
-002 * 
-003 * Wordpress-java
-004 * http://code.google.com/p/wordpress-java/
-005 * 
-006 * Copyright 2012 Can Bican <can@bican.net>
-007 * See the file 'COPYING' in the distribution for licensing terms.
-008 * 
-009 */
-010package net.bican.wordpress.configuration;
-011
-012import java.util.ArrayList;
-013import java.util.Collection;
-014
-015import org.apache.commons.cli.Options;
-016import org.apache.commons.cli.ParseException;
-017import org.apache.commons.configuration.CompositeConfiguration;
-018import org.apache.commons.configuration.Configuration;
-019
-020/**
-021 * 
-022 * A composite configuration class that combines preferences and command line.
-023 * 
-024 * @author Can Bican &lt;can@bican.net&gt;
-025 * 
-026 */
-027public class WpCliConfiguration {
-028
-029  private CompositeConfiguration config = null;
-030
-031  /**
-032   * @param args Command line arguments
-033   * @param options Command line options
-034   * @param cl Calling class
-035   * @throws ParseException When the configuration cannot be parsed
-036   */
-037  public WpCliConfiguration(String[] args, Options options, Class<?> cl)
-038      throws ParseException {
-039    Collection<Configuration> confs = new ArrayList<Configuration>();
-040    confs.add(new CliConfiguration(args, options));
-041    confs.add(new PreferencesConfiguration(cl));
-042    this.config = new CompositeConfiguration(confs);
-043  }
-044
-045  /**
-046   * @param key Option key to check
-047   * @return <code>true</code> if the configuration contains the key
-048   */
-049  public boolean hasOption(String key) {
-050    return this.config.containsKey(key);
-051  }
-052
-053  /**
-054   * @param key Option key to retrieve
-055   * @return Value of the option key
-056   */
-057  public String getOptionValue(String key) {
-058    return this.config.getString(key);
-059  }
-060
-061}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - diff --git a/doc/src-html/net/bican/wordpress/example/Main.html b/doc/src-html/net/bican/wordpress/example/Main.html deleted file mode 100644 index 0685179..0000000 --- a/doc/src-html/net/bican/wordpress/example/Main.html +++ /dev/null @@ -1,136 +0,0 @@ - - - -Source code - - - -
-
001/*
-002 * 
-003 * Wordpress-java
-004 * http://code.google.com/p/wordpress-java/
-005 * 
-006 * Copyright 2012 Can Bican <can@bican.net>
-007 * See the file 'COPYING' in the distribution for licensing terms.
-008 * 
-009 */
-010package net.bican.wordpress.example;
-011
-012import java.net.MalformedURLException;
-013import java.util.List;
-014
-015import redstone.xmlrpc.XmlRpcFault;
-016
-017import net.bican.wordpress.Page;
-018import net.bican.wordpress.PageDefinition;
-019import net.bican.wordpress.Wordpress;
-020
-021/**
-022 * 
-023 * Example implementation
-024 * 
-025 * Run this as java net.bican.wordpress.example.Main &lt;username&gt;
-026 * &lt;password&gt; &lt;xmlrpc-url&gt; for your blog.
-027 * 
-028 * @author Can Bican
-029 * 
-030 */
-031public class Main {
-032
-033  /**
-034   * @param args
-035   * @throws MalformedURLException
-036   * @throws XmlRpcFault
-037   */
-038  @SuppressWarnings("nls")
-039  public static void main(String[] args) throws MalformedURLException,
-040      XmlRpcFault {
-041    String username = args[0];
-042    String password = args[1];
-043    String xmlRpcUrl = args[2];
-044    Wordpress wp = new Wordpress(username, password, xmlRpcUrl);
-045    List<Page> recentPosts = wp.getRecentPosts(10);
-046    System.out.println("Here are the ten recent posts:");
-047    for (Page page : recentPosts) {
-048      System.out.println(page.getPostid() + ":" + page.getTitle());
-049    }
-050    List<PageDefinition> pages = wp.getPageList();
-051    System.out.println("Here are the pages:");
-052    for (PageDefinition pageDefinition : pages) {
-053      System.out.println(pageDefinition.getPage_title());
-054    }
-055    System.out.println("Posting a test (draft) page from a previous page...");
-056    Page recentPost = wp.getRecentPosts(1).get(0);
-057    recentPost.setTitle("Test Page");
-058    recentPost.setDescription("Test description");
-059    String result = wp.newPost(recentPost, false);
-060    System.out.println("new post page id: " + result);
-061    System.out.println("\nThat's all for now.");
-062  }
-063
-064}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - diff --git a/doc/src-html/org/json/JSONArray.html b/doc/src-html/org/json/JSONArray.html deleted file mode 100644 index 1e157bf..0000000 --- a/doc/src-html/org/json/JSONArray.html +++ /dev/null @@ -1,961 +0,0 @@ - - - -Source code - - - -
-
001package org.json;
-002
-003/*
-004 Copyright (c) 2002 JSON.org
-005
-006 Permission is hereby granted, free of charge, to any person obtaining a copy
-007 of this software and associated documentation files (the "Software"), to deal
-008 in the Software without restriction, including without limitation the rights
-009 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-010 copies of the Software, and to permit persons to whom the Software is
-011 furnished to do so, subject to the following conditions:
-012
-013 The above copyright notice and this permission notice shall be included in all
-014 copies or substantial portions of the Software.
-015
-016 The Software shall be used for Good, not Evil.
-017
-018 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-019 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-020 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-021 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-022 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-023 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-024 SOFTWARE.
-025 */
-026
-027import java.io.IOException;
-028import java.io.Writer;
-029import java.lang.reflect.Array;
-030import java.util.ArrayList;
-031import java.util.Collection;
-032import java.util.Iterator;
-033import java.util.Map;
-034
-035/**
-036 * A JSONArray is an ordered sequence of values. Its external text form is a
-037 * string wrapped in square brackets with commas separating the values. The
-038 * internal form is an object having <code>get</code> and <code>opt</code>
-039 * methods for accessing the values by index, and <code>put</code> methods for
-040 * adding or replacing values. The values can be any of these types:
-041 * <code>Boolean</code>, <code>JSONArray</code>, <code>JSONObject</code>,
-042 * <code>Number</code>, <code>String</code>, or the
-043 * <code>JSONObject.NULL object</code>.
-044 * <p>
-045 * The constructor can convert a JSON text into a Java object. The
-046 * <code>toString</code> method converts to JSON text.
-047 * <p>
-048 * A <code>get</code> method returns a value if one can be found, and throws an
-049 * exception if one cannot be found. An <code>opt</code> method returns a
-050 * default value instead of throwing an exception, and so is useful for
-051 * obtaining optional values.
-052 * <p>
-053 * The generic <code>get()</code> and <code>opt()</code> methods return an
-054 * object which you can cast or query for type. There are also typed
-055 * <code>get</code> and <code>opt</code> methods that do type checking and type
-056 * coercion for you.
-057 * <p>
-058 * The texts produced by the <code>toString</code> methods strictly conform to
-059 * JSON syntax rules. The constructors are more forgiving in the texts they will
-060 * accept:
-061 * <ul>
-062 * <li>An extra <code>,</code>&nbsp;<small>(comma)</small> may appear just
-063 * before the closing bracket.</li>
-064 * <li>The <code>null</code> value will be inserted when there is <code>,</code>
-065 * &nbsp;<small>(comma)</small> elision.</li>
-066 * <li>Strings may be quoted with <code>'</code>&nbsp;<small>(single quote)</small>.</li>
-067 * <li>Strings do not need to be quoted at all if they do not begin with a quote
-068 * or single quote, and if they do not contain leading or trailing spaces, and
-069 * if they do not contain any of these characters:
-070 * <code>{ } [ ] / \ : , = ; #</code> and if they do not look like numbers and
-071 * if they are not the reserved words <code>true</code>, <code>false</code>, or
-072 * <code>null</code>.</li>
-073 * <li>Values can be separated by <code>;</code> <small>(semicolon)</small> as
-074 * well as by <code>,</code> <small>(comma)</small>.</li>
-075 * <li>Numbers may have the <code>0x-</code> <small>(hex)</small> prefix.</li>
-076 * </ul>
-077 * 
-078 * @author JSON.org
-079 * @version 2009-04-14
-080 */
-081@SuppressWarnings({"unchecked","rawtypes","nls"})
-082public class JSONArray {
-083
-084  /**
-085   * The arrayList where the JSONArray's properties are kept.
-086   */
-087  private ArrayList myArrayList;
-088
-089  /**
-090   * Construct an empty JSONArray.
-091   */
-092  public JSONArray() {
-093    this.myArrayList = new ArrayList();
-094  }
-095
-096  /**
-097   * Construct a JSONArray from a JSONTokener.
-098   * 
-099   * @param x A JSONTokener
-100   * @throws JSONException If there is a syntax error.
-101   */
-102  public JSONArray(JSONTokener x) throws JSONException {
-103    this();
-104    char c = x.nextClean();
-105    char q;
-106    if (c == '[') {
-107      q = ']';
-108    } else if (c == '(') {
-109      q = ')';
-110    } else {
-111      throw x.syntaxError("A JSONArray text must start with '['");
-112    }
-113    if (x.nextClean() == ']') {
-114      return;
-115    }
-116    x.back();
-117    for (;;) {
-118      if (x.nextClean() == ',') {
-119        x.back();
-120        this.myArrayList.add(null);
-121      } else {
-122        x.back();
-123        this.myArrayList.add(x.nextValue());
-124      }
-125      c = x.nextClean();
-126      switch (c) {
-127        case ';':
-128        case ',':
-129          if (x.nextClean() == ']') {
-130            return;
-131          }
-132          x.back();
-133          break;
-134        case ']':
-135        case ')':
-136          if (q != c) {
-137            throw x.syntaxError("Expected a '" + new Character(q) + "'");
-138          }
-139          return;
-140        default:
-141          throw x.syntaxError("Expected a ',' or ']'");
-142      }
-143    }
-144  }
-145
-146  /**
-147   * Construct a JSONArray from a source JSON text.
-148   * 
-149   * @param source A string that begins with <code>[</code>&nbsp;<small>(left
-150   *          bracket)</small> and ends with <code>]</code>&nbsp;<small>(right
-151   *          bracket)</small>.
-152   * @throws JSONException If there is a syntax error.
-153   */
-154  public JSONArray(String source) throws JSONException {
-155    this(new JSONTokener(source));
-156  }
-157
-158  /**
-159   * Construct a JSONArray from a Collection.
-160   * 
-161   * @param collection A Collection.
-162   */
-163  public JSONArray(Collection collection) {
-164    this.myArrayList = new ArrayList();
-165    if (collection != null) {
-166      Iterator iter = collection.iterator();
-167      while (iter.hasNext()) {
-168        Object o = iter.next();
-169        this.myArrayList.add(JSONObject.wrap(o));
-170      }
-171    }
-172  }
-173
-174  /**
-175   * Construct a JSONArray from an array
-176   * 
-177   * @param array TODO
-178   * @throws JSONException If not an array.
-179   */
-180  public JSONArray(Object array) throws JSONException {
-181    this();
-182    if (array.getClass().isArray()) {
-183      int length = Array.getLength(array);
-184      for (int i = 0; i < length; i += 1) {
-185        this.put(JSONObject.wrap(Array.get(array, i)));
-186      }
-187    } else {
-188      throw new JSONException(
-189          "JSONArray initial value should be a string or collection or array.");
-190    }
-191  }
-192
-193  /**
-194   * Get the object value associated with an index.
-195   * 
-196   * @param index The index must be between 0 and length() - 1.
-197   * @return An object value.
-198   * @throws JSONException If there is no value for the index.
-199   */
-200  public Object get(int index) throws JSONException {
-201    Object o = opt(index);
-202    if (o == null) {
-203      throw new JSONException("JSONArray[" + index + "] not found.");
-204    }
-205    return o;
-206  }
-207
-208  /**
-209   * Get the boolean value associated with an index. The string values "true"
-210   * and "false" are converted to boolean.
-211   * 
-212   * @param index The index must be between 0 and length() - 1.
-213   * @return The truth.
-214   * @throws JSONException If there is no value for the index or if the value is
-215   *           not convertable to boolean.
-216   */
-217  public boolean getBoolean(int index) throws JSONException {
-218    Object o = get(index);
-219    if (o.equals(Boolean.FALSE)
-220        || (o instanceof String && ((String) o).equalsIgnoreCase("false"))) {
-221      return false;
-222    } else if (o.equals(Boolean.TRUE)
-223        || (o instanceof String && ((String) o).equalsIgnoreCase("true"))) {
-224      return true;
-225    }
-226    throw new JSONException("JSONArray[" + index + "] is not a Boolean.");
-227  }
-228
-229  /**
-230   * Get the double value associated with an index.
-231   * 
-232   * @param index The index must be between 0 and length() - 1.
-233   * @return The value.
-234   * @throws JSONException If the key is not found or if the value cannot be
-235   *           converted to a number.
-236   */
-237  public double getDouble(int index) throws JSONException {
-238    Object o = get(index);
-239    try {
-240      return o instanceof Number ? ((Number) o).doubleValue() : Double.valueOf(
-241          (String) o).doubleValue();
-242    } catch (Exception e) {
-243      throw new JSONException("JSONArray[" + index + "] is not a number.");
-244    }
-245  }
-246
-247  /**
-248   * Get the int value associated with an index.
-249   * 
-250   * @param index The index must be between 0 and length() - 1.
-251   * @return The value.
-252   * @throws JSONException If the key is not found or if the value cannot be
-253   *           converted to a number. if the value cannot be converted to a
-254   *           number.
-255   */
-256  public int getInt(int index) throws JSONException {
-257    Object o = get(index);
-258    return o instanceof Number ? ((Number) o).intValue()
-259        : (int) getDouble(index);
-260  }
-261
-262  /**
-263   * Get the JSONArray associated with an index.
-264   * 
-265   * @param index The index must be between 0 and length() - 1.
-266   * @return A JSONArray value.
-267   * @throws JSONException If there is no value for the index. or if the value
-268   *           is not a JSONArray
-269   */
-270  public JSONArray getJSONArray(int index) throws JSONException {
-271    Object o = get(index);
-272    if (o instanceof JSONArray) {
-273      return (JSONArray) o;
-274    }
-275    throw new JSONException("JSONArray[" + index + "] is not a JSONArray.");
-276  }
-277
-278  /**
-279   * Get the JSONObject associated with an index.
-280   * 
-281   * @param index subscript
-282   * @return A JSONObject value.
-283   * @throws JSONException If there is no value for the index or if the value is
-284   *           not a JSONObject
-285   */
-286  public JSONObject getJSONObject(int index) throws JSONException {
-287    Object o = get(index);
-288    if (o instanceof JSONObject) {
-289      return (JSONObject) o;
-290    }
-291    throw new JSONException("JSONArray[" + index + "] is not a JSONObject.");
-292  }
-293
-294  /**
-295   * Get the long value associated with an index.
-296   * 
-297   * @param index The index must be between 0 and length() - 1.
-298   * @return The value.
-299   * @throws JSONException If the key is not found or if the value cannot be
-300   *           converted to a number.
-301   */
-302  public long getLong(int index) throws JSONException {
-303    Object o = get(index);
-304    return o instanceof Number ? ((Number) o).longValue()
-305        : (long) getDouble(index);
-306  }
-307
-308  /**
-309   * Get the string associated with an index.
-310   * 
-311   * @param index The index must be between 0 and length() - 1.
-312   * @return A string value.
-313   * @throws JSONException If there is no value for the index.
-314   */
-315  public String getString(int index) throws JSONException {
-316    return get(index).toString();
-317  }
-318
-319  /**
-320   * Determine if the value is null.
-321   * 
-322   * @param index The index must be between 0 and length() - 1.
-323   * @return true if the value at the index is null, or if there is no value.
-324   */
-325  public boolean isNull(int index) {
-326    return JSONObject.NULL.equals(opt(index));
-327  }
-328
-329  /**
-330   * Make a string from the contents of this JSONArray. The
-331   * <code>separator</code> string is inserted between each element. Warning:
-332   * This method assumes that the data structure is acyclical.
-333   * 
-334   * @param separator A string that will be inserted between the elements.
-335   * @return a string.
-336   * @throws JSONException If the array contains an invalid number.
-337   */
-338  public String join(String separator) throws JSONException {
-339    int len = length();
-340    StringBuffer sb = new StringBuffer();
-341
-342    for (int i = 0; i < len; i += 1) {
-343      if (i > 0) {
-344        sb.append(separator);
-345      }
-346      sb.append(JSONObject.valueToString(this.myArrayList.get(i)));
-347    }
-348    return sb.toString();
-349  }
-350
-351  /**
-352   * Get the number of elements in the JSONArray, included nulls.
-353   * 
-354   * @return The length (or size).
-355   */
-356  public int length() {
-357    return this.myArrayList.size();
-358  }
-359
-360  /**
-361   * Get the optional object value associated with an index.
-362   * 
-363   * @param index The index must be between 0 and length() - 1.
-364   * @return An object value, or null if there is no object at that index.
-365   */
-366  public Object opt(int index) {
-367    return (index < 0 || index >= length()) ? null : this.myArrayList
-368        .get(index);
-369  }
-370
-371  /**
-372   * Get the optional boolean value associated with an index. It returns false
-373   * if there is no value at that index, or if the value is not Boolean.TRUE or
-374   * the String "true".
-375   * 
-376   * @param index The index must be between 0 and length() - 1.
-377   * @return The truth.
-378   */
-379  public boolean optBoolean(int index) {
-380    return optBoolean(index, false);
-381  }
-382
-383  /**
-384   * Get the optional boolean value associated with an index. It returns the
-385   * defaultValue if there is no value at that index or if it is not a Boolean
-386   * or the String "true" or "false" (case insensitive).
-387   * 
-388   * @param index The index must be between 0 and length() - 1.
-389   * @param defaultValue A boolean default.
-390   * @return The truth.
-391   */
-392  public boolean optBoolean(int index, boolean defaultValue) {
-393    try {
-394      return getBoolean(index);
-395    } catch (Exception e) {
-396      return defaultValue;
-397    }
-398  }
-399
-400  /**
-401   * Get the optional double value associated with an index. NaN is returned if
-402   * there is no value for the index, or if the value is not a number and cannot
-403   * be converted to a number.
-404   * 
-405   * @param index The index must be between 0 and length() - 1.
-406   * @return The value.
-407   */
-408  public double optDouble(int index) {
-409    return optDouble(index, Double.NaN);
-410  }
-411
-412  /**
-413   * Get the optional double value associated with an index. The defaultValue is
-414   * returned if there is no value for the index, or if the value is not a
-415   * number and cannot be converted to a number.
-416   * 
-417   * @param index subscript
-418   * @param defaultValue The default value.
-419   * @return The value.
-420   */
-421  public double optDouble(int index, double defaultValue) {
-422    try {
-423      return getDouble(index);
-424    } catch (Exception e) {
-425      return defaultValue;
-426    }
-427  }
-428
-429  /**
-430   * Get the optional int value associated with an index. Zero is returned if
-431   * there is no value for the index, or if the value is not a number and cannot
-432   * be converted to a number.
-433   * 
-434   * @param index The index must be between 0 and length() - 1.
-435   * @return The value.
-436   */
-437  public int optInt(int index) {
-438    return optInt(index, 0);
-439  }
-440
-441  /**
-442   * Get the optional int value associated with an index. The defaultValue is
-443   * returned if there is no value for the index, or if the value is not a
-444   * number and cannot be converted to a number.
-445   * 
-446   * @param index The index must be between 0 and length() - 1.
-447   * @param defaultValue The default value.
-448   * @return The value.
-449   */
-450  public int optInt(int index, int defaultValue) {
-451    try {
-452      return getInt(index);
-453    } catch (Exception e) {
-454      return defaultValue;
-455    }
-456  }
-457
-458  /**
-459   * Get the optional JSONArray associated with an index.
-460   * 
-461   * @param index subscript
-462   * @return A JSONArray value, or null if the index has no value, or if the
-463   *         value is not a JSONArray.
-464   */
-465  public JSONArray optJSONArray(int index) {
-466    Object o = opt(index);
-467    return o instanceof JSONArray ? (JSONArray) o : null;
-468  }
-469
-470  /**
-471   * Get the optional JSONObject associated with an index. Null is returned if
-472   * the key is not found, or null if the index has no value, or if the value is
-473   * not a JSONObject.
-474   * 
-475   * @param index The index must be between 0 and length() - 1.
-476   * @return A JSONObject value.
-477   */
-478  public JSONObject optJSONObject(int index) {
-479    Object o = opt(index);
-480    return o instanceof JSONObject ? (JSONObject) o : null;
-481  }
-482
-483  /**
-484   * Get the optional long value associated with an index. Zero is returned if
-485   * there is no value for the index, or if the value is not a number and cannot
-486   * be converted to a number.
-487   * 
-488   * @param index The index must be between 0 and length() - 1.
-489   * @return The value.
-490   */
-491  public long optLong(int index) {
-492    return optLong(index, 0);
-493  }
-494
-495  /**
-496   * Get the optional long value associated with an index. The defaultValue is
-497   * returned if there is no value for the index, or if the value is not a
-498   * number and cannot be converted to a number.
-499   * 
-500   * @param index The index must be between 0 and length() - 1.
-501   * @param defaultValue The default value.
-502   * @return The value.
-503   */
-504  public long optLong(int index, long defaultValue) {
-505    try {
-506      return getLong(index);
-507    } catch (Exception e) {
-508      return defaultValue;
-509    }
-510  }
-511
-512  /**
-513   * Get the optional string value associated with an index. It returns an empty
-514   * string if there is no value at that index. If the value is not a string and
-515   * is not null, then it is coverted to a string.
-516   * 
-517   * @param index The index must be between 0 and length() - 1.
-518   * @return A String value.
-519   */
-520  public String optString(int index) {
-521    return optString(index, "");
-522  }
-523
-524  /**
-525   * Get the optional string associated with an index. The defaultValue is
-526   * returned if the key is not found.
-527   * 
-528   * @param index The index must be between 0 and length() - 1.
-529   * @param defaultValue The default value.
-530   * @return A String value.
-531   */
-532  public String optString(int index, String defaultValue) {
-533    Object o = opt(index);
-534    return o != null ? o.toString() : defaultValue;
-535  }
-536
-537  /**
-538   * Append a boolean value. This increases the array's length by one.
-539   * 
-540   * @param value A boolean value.
-541   * @return this.
-542   */
-543  public JSONArray put(boolean value) {
-544    put(value ? Boolean.TRUE : Boolean.FALSE);
-545    return this;
-546  }
-547
-548  /**
-549   * Put a value in the JSONArray, where the value will be a JSONArray which is
-550   * produced from a Collection.
-551   * 
-552   * @param value A Collection value.
-553   * @return this.
-554   */
-555  public JSONArray put(Collection value) {
-556    put(new JSONArray(value));
-557    return this;
-558  }
-559
-560  /**
-561   * Append a double value. This increases the array's length by one.
-562   * 
-563   * @param value A double value.
-564   * @throws JSONException if the value is not finite.
-565   * @return this.
-566   */
-567  public JSONArray put(double value) throws JSONException {
-568    Double d = new Double(value);
-569    JSONObject.testValidity(d);
-570    put(d);
-571    return this;
-572  }
-573
-574  /**
-575   * Append an int value. This increases the array's length by one.
-576   * 
-577   * @param value An int value.
-578   * @return this.
-579   */
-580  public JSONArray put(int value) {
-581    put(new Integer(value));
-582    return this;
-583  }
-584
-585  /**
-586   * Append an long value. This increases the array's length by one.
-587   * 
-588   * @param value A long value.
-589   * @return this.
-590   */
-591  public JSONArray put(long value) {
-592    put(new Long(value));
-593    return this;
-594  }
-595
-596  /**
-597   * Put a value in the JSONArray, where the value will be a JSONObject which is
-598   * produced from a Map.
-599   * 
-600   * @param value A Map value.
-601   * @return this.
-602   */
-603  public JSONArray put(Map value) {
-604    put(new JSONObject(value));
-605    return this;
-606  }
-607
-608  /**
-609   * Append an object value. This increases the array's length by one.
-610   * 
-611   * @param value An object value. The value should be a Boolean, Double,
-612   *          Integer, JSONArray, JSONObject, Long, or String, or the
-613   *          JSONObject.NULL object.
-614   * @return this.
-615   */
-616  public JSONArray put(Object value) {
-617    this.myArrayList.add(value);
-618    return this;
-619  }
-620
-621  /**
-622   * Put or replace a boolean value in the JSONArray. If the index is greater
-623   * than the length of the JSONArray, then null elements will be added as
-624   * necessary to pad it out.
-625   * 
-626   * @param index The subscript.
-627   * @param value A boolean value.
-628   * @return this.
-629   * @throws JSONException If the index is negative.
-630   */
-631  public JSONArray put(int index, boolean value) throws JSONException {
-632    put(index, value ? Boolean.TRUE : Boolean.FALSE);
-633    return this;
-634  }
-635
-636  /**
-637   * Put a value in the JSONArray, where the value will be a JSONArray which is
-638   * produced from a Collection.
-639   * 
-640   * @param index The subscript.
-641   * @param value A Collection value.
-642   * @return this.
-643   * @throws JSONException If the index is negative or if the value is not
-644   *           finite.
-645   */
-646  public JSONArray put(int index, Collection value) throws JSONException {
-647    put(index, new JSONArray(value));
-648    return this;
-649  }
-650
-651  /**
-652   * Put or replace a double value. If the index is greater than the length of
-653   * the JSONArray, then null elements will be added as necessary to pad it out.
-654   * 
-655   * @param index The subscript.
-656   * @param value A double value.
-657   * @return this.
-658   * @throws JSONException If the index is negative or if the value is not
-659   *           finite.
-660   */
-661  public JSONArray put(int index, double value) throws JSONException {
-662    put(index, new Double(value));
-663    return this;
-664  }
-665
-666  /**
-667   * Put or replace an int value. If the index is greater than the length of the
-668   * JSONArray, then null elements will be added as necessary to pad it out.
-669   * 
-670   * @param index The subscript.
-671   * @param value An int value.
-672   * @return this.
-673   * @throws JSONException If the index is negative.
-674   */
-675  public JSONArray put(int index, int value) throws JSONException {
-676    put(index, new Integer(value));
-677    return this;
-678  }
-679
-680  /**
-681   * Put or replace a long value. If the index is greater than the length of the
-682   * JSONArray, then null elements will be added as necessary to pad it out.
-683   * 
-684   * @param index The subscript.
-685   * @param value A long value.
-686   * @return this.
-687   * @throws JSONException If the index is negative.
-688   */
-689  public JSONArray put(int index, long value) throws JSONException {
-690    put(index, new Long(value));
-691    return this;
-692  }
-693
-694  /**
-695   * Put a value in the JSONArray, where the value will be a JSONObject which is
-696   * produced from a Map.
-697   * 
-698   * @param index The subscript.
-699   * @param value The Map value.
-700   * @return this.
-701   * @throws JSONException If the index is negative or if the the value is an
-702   *           invalid number.
-703   */
-704  public JSONArray put(int index, Map value) throws JSONException {
-705    put(index, new JSONObject(value));
-706    return this;
-707  }
-708
-709  /**
-710   * Put or replace an object value in the JSONArray. If the index is greater
-711   * than the length of the JSONArray, then null elements will be added as
-712   * necessary to pad it out.
-713   * 
-714   * @param index The subscript.
-715   * @param value The value to put into the array. The value should be a
-716   *          Boolean, Double, Integer, JSONArray, JSONObject, Long, or String,
-717   *          or the JSONObject.NULL object.
-718   * @return this.
-719   * @throws JSONException If the index is negative or if the the value is an
-720   *           invalid number.
-721   */
-722  public JSONArray put(int index, Object value) throws JSONException {
-723    JSONObject.testValidity(value);
-724    if (index < 0) {
-725      throw new JSONException("JSONArray[" + index + "] not found.");
-726    }
-727    if (index < length()) {
-728      this.myArrayList.set(index, value);
-729    } else {
-730      while (index != length()) {
-731        put(JSONObject.NULL);
-732      }
-733      put(value);
-734    }
-735    return this;
-736  }
-737
-738  /**
-739   * Remove an index and close the hole.
-740   * 
-741   * @param index The index of the element to be removed.
-742   * @return The value that was associated with the index, or null if there was
-743   *         no value.
-744   */
-745  public Object remove(int index) {
-746    Object o = opt(index);
-747    this.myArrayList.remove(index);
-748    return o;
-749  }
-750
-751  /**
-752   * Produce a JSONObject by combining a JSONArray of names with the values of
-753   * this JSONArray.
-754   * 
-755   * @param names A JSONArray containing a list of key strings. These will be
-756   *          paired with the values.
-757   * @return A JSONObject, or null if there are no names or if this JSONArray
-758   *         has no values.
-759   * @throws JSONException If any of the names are null.
-760   */
-761  public JSONObject toJSONObject(JSONArray names) throws JSONException {
-762    if (names == null || names.length() == 0 || length() == 0) {
-763      return null;
-764    }
-765    JSONObject jo = new JSONObject();
-766    for (int i = 0; i < names.length(); i += 1) {
-767      jo.put(names.getString(i), this.opt(i));
-768    }
-769    return jo;
-770  }
-771
-772  /**
-773   * Make a JSON text of this JSONArray. For compactness, no unnecessary
-774   * whitespace is added. If it is not possible to produce a syntactically
-775   * correct JSON text then null will be returned instead. This could occur if
-776   * the array contains an invalid number.
-777   * <p>
-778   * Warning: This method assumes that the data structure is acyclical.
-779   * 
-780   * @return a printable, displayable, transmittable representation of the
-781   *         array.
-782   */
-783  @Override
-784  public String toString() {
-785    try {
-786      return '[' + join(",") + ']';
-787    } catch (Exception e) {
-788      return null;
-789    }
-790  }
-791
-792  /**
-793   * Make a prettyprinted JSON text of this JSONArray. Warning: This method
-794   * assumes that the data structure is acyclical.
-795   * 
-796   * @param indentFactor The number of spaces to add to each level of
-797   *          indentation.
-798   * @return a printable, displayable, transmittable representation of the
-799   *         object, beginning with <code>[</code>&nbsp;<small>(left
-800   *         bracket)</small> and ending with <code>]</code>&nbsp;<small>(right
-801   *         bracket)</small>.
-802   * @throws JSONException
-803   */
-804  public String toString(int indentFactor) throws JSONException {
-805    return toString(indentFactor, 0);
-806  }
-807
-808  /**
-809   * Make a prettyprinted JSON text of this JSONArray. Warning: This method
-810   * assumes that the data structure is acyclical.
-811   * 
-812   * @param indentFactor The number of spaces to add to each level of
-813   *          indentation.
-814   * @param indent The indention of the top level.
-815   * @return a printable, displayable, transmittable representation of the
-816   *         array.
-817   * @throws JSONException
-818   */
-819  String toString(int indentFactor, int indent) throws JSONException {
-820    int len = length();
-821    if (len == 0) {
-822      return "[]";
-823    }
-824    int i;
-825    StringBuffer sb = new StringBuffer("[");
-826    if (len == 1) {
-827      sb.append(JSONObject.valueToString(this.myArrayList.get(0), indentFactor,
-828          indent));
-829    } else {
-830      int newindent = indent + indentFactor;
-831      sb.append('\n');
-832      for (i = 0; i < len; i += 1) {
-833        if (i > 0) {
-834          sb.append(",\n");
-835        }
-836        for (int j = 0; j < newindent; j += 1) {
-837          sb.append(' ');
-838        }
-839        sb.append(JSONObject.valueToString(this.myArrayList.get(i),
-840            indentFactor, newindent));
-841      }
-842      sb.append('\n');
-843      for (i = 0; i < indent; i += 1) {
-844        sb.append(' ');
-845      }
-846    }
-847    sb.append(']');
-848    return sb.toString();
-849  }
-850
-851  /**
-852   * Write the contents of the JSONArray as JSON text to a writer. For
-853   * compactness, no whitespace is added.
-854   * <p>
-855   * Warning: This method assumes that the data structure is acyclical.
-856   * 
-857   * @param writer TODO
-858   * 
-859   * @return The writer.
-860   * @throws JSONException
-861   */
-862  public Writer write(Writer writer) throws JSONException {
-863    try {
-864      boolean b = false;
-865      int len = length();
-866
-867      writer.write('[');
-868
-869      for (int i = 0; i < len; i += 1) {
-870        if (b) {
-871          writer.write(',');
-872        }
-873        Object v = this.myArrayList.get(i);
-874        if (v instanceof JSONObject) {
-875          ((JSONObject) v).write(writer);
-876        } else if (v instanceof JSONArray) {
-877          ((JSONArray) v).write(writer);
-878        } else {
-879          writer.write(JSONObject.valueToString(v));
-880        }
-881        b = true;
-882      }
-883      writer.write(']');
-884      return writer;
-885    } catch (IOException e) {
-886      throw new JSONException(e);
-887    }
-888  }
-889}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - diff --git a/doc/src-html/org/json/JSONException.html b/doc/src-html/org/json/JSONException.html deleted file mode 100644 index 12f1ce4..0000000 --- a/doc/src-html/org/json/JSONException.html +++ /dev/null @@ -1,115 +0,0 @@ - - - -Source code - - - -
-
001package org.json;
-002
-003/**
-004 * The JSONException is thrown by the JSON.org classes when things are amiss.
-005 * 
-006 * @author JSON.org
-007 * @version 2008-09-18
-008 */
-009public class JSONException extends Exception {
-010  /**
-011   * 
-012   */
-013  private static final long serialVersionUID = 0;
-014
-015  private Throwable cause;
-016
-017  /**
-018   * Constructs a JSONException with an explanatory message.
-019   * 
-020   * @param message Detail about the reason for the exception.
-021   */
-022  public JSONException(String message) {
-023    super(message);
-024  }
-025
-026  /**
-027   * @param t TODO
-028   */
-029  public JSONException(Throwable t) {
-030    super(t.getMessage());
-031    this.cause = t;
-032  }
-033
-034  /**
-035   * (non-Javadoc)
-036   * 
-037   * @see java.lang.Throwable#getCause()
-038   */
-039  @Override
-040  public synchronized Throwable getCause() {
-041    return this.cause;
-042  }
-043}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - diff --git a/doc/src-html/org/json/JSONObject.html b/doc/src-html/org/json/JSONObject.html deleted file mode 100644 index fd92df8..0000000 --- a/doc/src-html/org/json/JSONObject.html +++ /dev/null @@ -1,1612 +0,0 @@ - - - -Source code - - - -
-
001package org.json;
-002
-003/*
-004 Copyright (c) 2002 JSON.org
-005
-006 Permission is hereby granted, free of charge, to any person obtaining a copy
-007 of this software and associated documentation files (the "Software"), to deal
-008 in the Software without restriction, including without limitation the rights
-009 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-010 copies of the Software, and to permit persons to whom the Software is
-011 furnished to do so, subject to the following conditions:
-012
-013 The above copyright notice and this permission notice shall be included in all
-014 copies or substantial portions of the Software.
-015
-016 The Software shall be used for Good, not Evil.
-017
-018 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-019 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-020 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-021 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-022 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-023 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-024 SOFTWARE.
-025 */
-026
-027import java.io.IOException;
-028import java.io.Writer;
-029import java.lang.reflect.Field;
-030import java.lang.reflect.Modifier;
-031import java.lang.reflect.Method;
-032import java.util.Collection;
-033import java.util.HashMap;
-034import java.util.Iterator;
-035import java.util.Map;
-036import java.util.TreeSet;
-037
-038/**
-039 * A JSONObject is an unordered collection of name/value pairs. Its external
-040 * form is a string wrapped in curly braces with colons between the names and
-041 * values, and commas between the values and names. The internal form is an
-042 * object having <code>get</code> and <code>opt</code> methods for accessing the
-043 * values by name, and <code>put</code> methods for adding or replacing values
-044 * by name. The values can be any of these types: <code>Boolean</code>,
-045 * <code>JSONArray</code>, <code>JSONObject</code>, <code>Number</code>,
-046 * <code>String</code>, or the <code>JSONObject.NULL</code> object. A JSONObject
-047 * constructor can be used to convert an external form JSON text into an
-048 * internal form whose values can be retrieved with the <code>get</code> and
-049 * <code>opt</code> methods, or to convert values into a JSON text using the
-050 * <code>put</code> and <code>toString</code> methods. A <code>get</code> method
-051 * returns a value if one can be found, and throws an exception if one cannot be
-052 * found. An <code>opt</code> method returns a default value instead of throwing
-053 * an exception, and so is useful for obtaining optional values.
-054 * <p>
-055 * The generic <code>get()</code> and <code>opt()</code> methods return an
-056 * object, which you can cast or query for type. There are also typed
-057 * <code>get</code> and <code>opt</code> methods that do type checking and type
-058 * coercion for you.
-059 * <p>
-060 * The <code>put</code> methods adds values to an object. For example,
-061 * 
-062 * <pre>
-063 * myString = new JSONObject().put(&quot;JSON&quot;, &quot;Hello, World!&quot;).toString();
-064 * </pre>
-065 * 
-066 * produces the string <code>{"JSON": "Hello, World"}</code>.
-067 * <p>
-068 * The texts produced by the <code>toString</code> methods strictly conform to
-069 * the JSON syntax rules. The constructors are more forgiving in the texts they
-070 * will accept:
-071 * <ul>
-072 * <li>An extra <code>,</code>&nbsp;<small>(comma)</small> may appear just
-073 * before the closing brace.</li>
-074 * <li>Strings may be quoted with <code>'</code>&nbsp;<small>(single quote)</small>.</li>
-075 * <li>Strings do not need to be quoted at all if they do not begin with a quote
-076 * or single quote, and if they do not contain leading or trailing spaces, and
-077 * if they do not contain any of these characters:
-078 * <code>{ } [ ] / \ : , = ; #</code> and if they do not look like numbers and
-079 * if they are not the reserved words <code>true</code>, <code>false</code>, or
-080 * <code>null</code>.</li>
-081 * <li>Keys can be followed by <code>=</code> or <code>=></code> as well as by
-082 * <code>:</code>.</li>
-083 * <li>Values can be followed by <code>;</code> <small>(semicolon)</small> as
-084 * well as by <code>,</code> <small>(comma)</small>.</li>
-085 * <li>Numbers may have the <code>0-</code> <small>(octal)</small> or <code>0x-</code>
-086 * <small>(hex)</small> prefix.</li>
-087 * </ul>
-088 * 
-089 * @author JSON.org
-090 * @version 2010-01-05
-091 */
-092@SuppressWarnings( { "unchecked", "synthetic-access", "rawtypes","nls" })
-093public class JSONObject {
-094
-095  /**
-096   * JSONObject.NULL is equivalent to the value that JavaScript calls null,
-097   * whilst Java's null is equivalent to the value that JavaScript calls
-098   * undefined.
-099   */
-100  private static final class Null {
-101
-102    /**
-103     * There is only intended to be a single instance of the NULL object, so the
-104     * clone method returns itself.
-105     * 
-106     * @return NULL.
-107     */
-108    @Override
-109    protected final Object clone() {
-110      return this;
-111    }
-112
-113    /**
-114     * A Null object is equal to the null value and to itself.
-115     * 
-116     * @param object An object to test for nullness.
-117     * @return true if the object parameter is the JSONObject.NULL object or
-118     *         null.
-119     */
-120    @Override
-121    public boolean equals(Object object) {
-122      return object == null || object == this;
-123    }
-124
-125    /**
-126     * Get the "null" string value.
-127     * 
-128     * @return The string "null".
-129     */
-130    @Override
-131    public String toString() {
-132      return "null";
-133    }
-134
-135    @Override
-136    public int hashCode() {
-137      return super.hashCode();
-138    }
-139  }
-140
-141  /**
-142   * The map where the JSONObject's properties are kept.
-143   */
-144  private Map map;
-145
-146  /**
-147   * It is sometimes more convenient and less ambiguous to have a
-148   * <code>NULL</code> object than to use Java's <code>null</code> value.
-149   * <code>JSONObject.NULL.equals(null)</code> returns <code>true</code>.
-150   * <code>JSONObject.NULL.toString()</code> returns <code>"null"</code>.
-151   */
-152  public static final Object NULL = new Null();
-153
-154  /**
-155   * Construct an empty JSONObject.
-156   */
-157  public JSONObject() {
-158    this.map = new HashMap();
-159  }
-160
-161  /**
-162   * Construct a JSONObject from a subset of another JSONObject. An array of
-163   * strings is used to identify the keys that should be copied. Missing keys
-164   * are ignored.
-165   * 
-166   * @param jo A JSONObject.
-167   * @param names An array of strings.
-168   */
-169  public JSONObject(JSONObject jo, String[] names) {
-170    this();
-171    for (int i = 0; i < names.length; i += 1) {
-172      try {
-173        putOnce(names[i], jo.opt(names[i]));
-174      } catch (Exception ignore) {
-175        // ??
-176      }
-177    }
-178  }
-179
-180  /**
-181   * Construct a JSONObject from a JSONTokener.
-182   * 
-183   * @param x A JSONTokener object containing the source string.
-184   * @throws JSONException If there is a syntax error in the source string or a
-185   *           duplicated key.
-186   */
-187  public JSONObject(JSONTokener x) throws JSONException {
-188    this();
-189    char c;
-190    String key;
-191
-192    if (x.nextClean() != '{') {
-193      throw x.syntaxError("A JSONObject text must begin with '{'");
-194    }
-195    for (;;) {
-196      c = x.nextClean();
-197      switch (c) {
-198        case 0:
-199          throw x.syntaxError("A JSONObject text must end with '}'");
-200        case '}':
-201          return;
-202        default:
-203          x.back();
-204          key = x.nextValue().toString();
-205      }
-206
-207      /*
-208       * The key is followed by ':'. We will also tolerate '=' or '=>'.
-209       */
-210
-211      c = x.nextClean();
-212      if (c == '=') {
-213        if (x.next() != '>') {
-214          x.back();
-215        }
-216      } else if (c != ':') {
-217        throw x.syntaxError("Expected a ':' after a key");
-218      }
-219      putOnce(key, x.nextValue());
-220
-221      /*
-222       * Pairs are separated by ','. We will also tolerate ';'.
-223       */
-224
-225      switch (x.nextClean()) {
-226        case ';':
-227        case ',':
-228          if (x.nextClean() == '}') {
-229            return;
-230          }
-231          x.back();
-232          break;
-233        case '}':
-234          return;
-235        default:
-236          throw x.syntaxError("Expected a ',' or '}'");
-237      }
-238    }
-239  }
-240
-241  /**
-242   * Construct a JSONObject from a Map.
-243   * 
-244   * @param map A map object that can be used to initialize the contents of the
-245   *          JSONObject.
-246   */
-247  public JSONObject(Map map) {
-248    this.map = new HashMap();
-249    if (map != null) {
-250      Iterator i = map.entrySet().iterator();
-251      while (i.hasNext()) {
-252        Map.Entry e = (Map.Entry) i.next();
-253        this.map.put(e.getKey(), wrap(e.getValue()));
-254      }
-255    }
-256  }
-257
-258  /**
-259   * Construct a JSONObject from an Object using bean getters. It reflects on
-260   * all of the public methods of the object. For each of the methods with no
-261   * parameters and a name starting with <code>"get"</code> or <code>"is"</code>
-262   * followed by an uppercase letter, the method is invoked, and a key and the
-263   * value returned from the getter method are put into the new JSONObject.
-264   * 
-265   * The key is formed by removing the <code>"get"</code> or <code>"is"</code>
-266   * prefix. If the second remaining character is not upper case, then the first
-267   * character is converted to lower case.
-268   * 
-269   * For example, if an object has a method named <code>"getName"</code>, and if
-270   * the result of calling <code>object.getName()</code> is
-271   * <code>"Larry Fine"</code>, then the JSONObject will contain
-272   * <code>"name": "Larry Fine"</code>.
-273   * 
-274   * @param bean An object that has getter methods that should be used to make a
-275   *          JSONObject.
-276   */
-277  public JSONObject(Object bean) {
-278    this();
-279    populateMap(bean);
-280  }
-281
-282  /**
-283   * Construct a JSONObject from an Object, using reflection to find the public
-284   * members. The resulting JSONObject's keys will be the strings from the names
-285   * array, and the values will be the field values associated with those keys
-286   * in the object. If a key is not found or not visible, then it will not be
-287   * copied into the new JSONObject.
-288   * 
-289   * @param object An object that has fields that should be used to make a
-290   *          JSONObject.
-291   * @param names An array of strings, the names of the fields to be obtained
-292   *          from the object.
-293   */
-294  public JSONObject(Object object, String names[]) {
-295    this();
-296    Class c = object.getClass();
-297    for (int i = 0; i < names.length; i += 1) {
-298      String name = names[i];
-299      try {
-300        putOpt(name, c.getField(name).get(object));
-301      } catch (Exception ignore) {
-302        // ??
-303      }
-304    }
-305  }
-306
-307  /**
-308   * Construct a JSONObject from a source JSON text string. This is the most
-309   * commonly used JSONObject constructor.
-310   * 
-311   * @param source A string beginning with <code>{</code>&nbsp;<small>(left
-312   *          brace)</small> and ending with <code>}</code>&nbsp;<small>(right
-313   *          brace)</small>.
-314   * @exception JSONException If there is a syntax error in the source string or
-315   *              a duplicated key.
-316   */
-317  public JSONObject(String source) throws JSONException {
-318    this(new JSONTokener(source));
-319  }
-320
-321  /**
-322   * Accumulate values under a key. It is similar to the put method except that
-323   * if there is already an object stored under the key then a JSONArray is
-324   * stored under the key to hold all of the accumulated values. If there is
-325   * already a JSONArray, then the new value is appended to it. In contrast, the
-326   * put method replaces the previous value.
-327   * 
-328   * @param key A key string.
-329   * @param value An object to be accumulated under the key.
-330   * @return this.
-331   * @throws JSONException If the value is an invalid number or if the key is
-332   *           null.
-333   */
-334  public JSONObject accumulate(String key, Object value) throws JSONException {
-335    testValidity(value);
-336    Object o = opt(key);
-337    if (o == null) {
-338      put(key, value instanceof JSONArray ? new JSONArray().put(value) : value);
-339    } else if (o instanceof JSONArray) {
-340      ((JSONArray) o).put(value);
-341    } else {
-342      put(key, new JSONArray().put(o).put(value));
-343    }
-344    return this;
-345  }
-346
-347  /**
-348   * Append values to the array under a key. If the key does not exist in the
-349   * JSONObject, then the key is put in the JSONObject with its value being a
-350   * JSONArray containing the value parameter. If the key was already associated
-351   * with a JSONArray, then the value parameter is appended to it.
-352   * 
-353   * @param key A key string.
-354   * @param value An object to be accumulated under the key.
-355   * @return this.
-356   * @throws JSONException If the key is null or if the current value associated
-357   *           with the key is not a JSONArray.
-358   */
-359  public JSONObject append(String key, Object value) throws JSONException {
-360    testValidity(value);
-361    Object o = opt(key);
-362    if (o == null) {
-363      put(key, new JSONArray().put(value));
-364    } else if (o instanceof JSONArray) {
-365      put(key, ((JSONArray) o).put(value));
-366    } else {
-367      throw new JSONException("JSONObject[" + key + "] is not a JSONArray.");
-368    }
-369    return this;
-370  }
-371
-372  /**
-373   * Produce a string from a double. The string "null" will be returned if the
-374   * number is not finite.
-375   * 
-376   * @param d A double.
-377   * @return A String.
-378   */
-379  static public String doubleToString(double d) {
-380    if (Double.isInfinite(d) || Double.isNaN(d)) {
-381      return "null";
-382    }
-383
-384    // Shave off trailing zeros and decimal point, if possible.
-385
-386    String s = Double.toString(d);
-387    if (s.indexOf('.') > 0 && s.indexOf('e') < 0 && s.indexOf('E') < 0) {
-388      while (s.endsWith("0")) {
-389        s = s.substring(0, s.length() - 1);
-390      }
-391      if (s.endsWith(".")) {
-392        s = s.substring(0, s.length() - 1);
-393      }
-394    }
-395    return s;
-396  }
-397
-398  /**
-399   * Get the value object associated with a key.
-400   * 
-401   * @param key A key string.
-402   * @return The object associated with the key.
-403   * @throws JSONException if the key is not found.
-404   */
-405  public Object get(String key) throws JSONException {
-406    Object o = opt(key);
-407    if (o == null) {
-408      throw new JSONException("JSONObject[" + quote(key) + "] not found.");
-409    }
-410    return o;
-411  }
-412
-413  /**
-414   * Get the boolean value associated with a key.
-415   * 
-416   * @param key A key string.
-417   * @return The truth.
-418   * @throws JSONException if the value is not a Boolean or the String "true" or
-419   *           "false".
-420   */
-421  public boolean getBoolean(String key) throws JSONException {
-422    Object o = get(key);
-423    if (o.equals(Boolean.FALSE)
-424        || (o instanceof String && ((String) o).equalsIgnoreCase("false"))) {
-425      return false;
-426    } else if (o.equals(Boolean.TRUE)
-427        || (o instanceof String && ((String) o).equalsIgnoreCase("true"))) {
-428      return true;
-429    }
-430    throw new JSONException("JSONObject[" + quote(key) + "] is not a Boolean.");
-431  }
-432
-433  /**
-434   * Get the double value associated with a key.
-435   * 
-436   * @param key A key string.
-437   * @return The numeric value.
-438   * @throws JSONException if the key is not found or if the value is not a
-439   *           Number object and cannot be converted to a number.
-440   */
-441  public double getDouble(String key) throws JSONException {
-442    Object o = get(key);
-443    try {
-444      return o instanceof Number ? ((Number) o).doubleValue() : Double.valueOf(
-445          (String) o).doubleValue();
-446    } catch (Exception e) {
-447      throw new JSONException("JSONObject[" + quote(key) + "] is not a number.");
-448    }
-449  }
-450
-451  /**
-452   * Get the int value associated with a key.
-453   * 
-454   * @param key A key string.
-455   * @return The integer value.
-456   * @throws JSONException if the key is not found or if the value cannot be
-457   *           converted to an integer.
-458   */
-459  public int getInt(String key) throws JSONException {
-460    Object o = get(key);
-461    try {
-462      return o instanceof Number ? ((Number) o).intValue() : Integer
-463          .parseInt((String) o);
-464    } catch (Exception e) {
-465      throw new JSONException("JSONObject[" + quote(key) + "] is not an int.");
-466    }
-467  }
-468
-469  /**
-470   * Get the JSONArray value associated with a key.
-471   * 
-472   * @param key A key string.
-473   * @return A JSONArray which is the value.
-474   * @throws JSONException if the key is not found or if the value is not a
-475   *           JSONArray.
-476   */
-477  public JSONArray getJSONArray(String key) throws JSONException {
-478    Object o = get(key);
-479    if (o instanceof JSONArray) {
-480      return (JSONArray) o;
-481    }
-482    throw new JSONException("JSONObject[" + quote(key)
-483        + "] is not a JSONArray.");
-484  }
-485
-486  /**
-487   * Get the JSONObject value associated with a key.
-488   * 
-489   * @param key A key string.
-490   * @return A JSONObject which is the value.
-491   * @throws JSONException if the key is not found or if the value is not a
-492   *           JSONObject.
-493   */
-494  public JSONObject getJSONObject(String key) throws JSONException {
-495    Object o = get(key);
-496    if (o instanceof JSONObject) {
-497      return (JSONObject) o;
-498    }
-499    throw new JSONException("JSONObject[" + quote(key)
-500        + "] is not a JSONObject.");
-501  }
-502
-503  /**
-504   * Get the long value associated with a key.
-505   * 
-506   * @param key A key string.
-507   * @return The long value.
-508   * @throws JSONException if the key is not found or if the value cannot be
-509   *           converted to a long.
-510   */
-511  public long getLong(String key) throws JSONException {
-512    Object o = get(key);
-513    try {
-514      return o instanceof Number ? ((Number) o).longValue() : Long
-515          .parseLong((String) o);
-516    } catch (Exception e) {
-517      throw new JSONException("JSONObject[" + quote(key) + "] is not a long.");
-518    }
-519  }
-520
-521  /**
-522   * Get an array of field names from a JSONObject.
-523   * 
-524   * @param jo TODO
-525   * 
-526   * @return An array of field names, or null if there are no names.
-527   */
-528  public static String[] getNames(JSONObject jo) {
-529    int length = jo.length();
-530    if (length == 0) {
-531      return null;
-532    }
-533    Iterator i = jo.keys();
-534    String[] names = new String[length];
-535    int j = 0;
-536    while (i.hasNext()) {
-537      names[j] = (String) i.next();
-538      j += 1;
-539    }
-540    return names;
-541  }
-542
-543  /**
-544   * Get an array of field names from an Object.
-545   * 
-546   * @param object TODO
-547   * 
-548   * @return An array of field names, or null if there are no names.
-549   */
-550  public static String[] getNames(Object object) {
-551    if (object == null) {
-552      return null;
-553    }
-554    Class klass = object.getClass();
-555    Field[] fields = klass.getFields();
-556    int length = fields.length;
-557    if (length == 0) {
-558      return null;
-559    }
-560    String[] names = new String[length];
-561    for (int i = 0; i < length; i += 1) {
-562      names[i] = fields[i].getName();
-563    }
-564    return names;
-565  }
-566
-567  /**
-568   * Get the string associated with a key.
-569   * 
-570   * @param key A key string.
-571   * @return A string which is the value.
-572   * @throws JSONException if the key is not found.
-573   */
-574  public String getString(String key) throws JSONException {
-575    return get(key).toString();
-576  }
-577
-578  /**
-579   * Determine if the JSONObject contains a specific key.
-580   * 
-581   * @param key A key string.
-582   * @return true if the key exists in the JSONObject.
-583   */
-584  public boolean has(String key) {
-585    return this.map.containsKey(key);
-586  }
-587
-588  /**
-589   * Increment a property of a JSONObject. If there is no such property, create
-590   * one with a value of 1. If there is such a property, and if it is an
-591   * Integer, Long, Double, or Float, then add one to it.
-592   * 
-593   * @param key A key string.
-594   * @return this.
-595   * @throws JSONException If there is already a property with this name that is
-596   *           not an Integer, Long, Double, or Float.
-597   */
-598  public JSONObject increment(String key) throws JSONException {
-599    Object value = opt(key);
-600    if (value == null) {
-601      put(key, 1);
-602    } else {
-603      if (value instanceof Integer) {
-604        put(key, ((Integer) value).intValue() + 1);
-605      } else if (value instanceof Long) {
-606        put(key, ((Long) value).longValue() + 1);
-607      } else if (value instanceof Double) {
-608        put(key, ((Double) value).doubleValue() + 1);
-609      } else if (value instanceof Float) {
-610        put(key, ((Float) value).floatValue() + 1);
-611      } else {
-612        throw new JSONException("Unable to increment [" + key + "].");
-613      }
-614    }
-615    return this;
-616  }
-617
-618  /**
-619   * Determine if the value associated with the key is null or if there is no
-620   * value.
-621   * 
-622   * @param key A key string.
-623   * @return true if there is no value associated with the key or if the value
-624   *         is the JSONObject.NULL object.
-625   */
-626  public boolean isNull(String key) {
-627    return JSONObject.NULL.equals(opt(key));
-628  }
-629
-630  /**
-631   * Get an enumeration of the keys of the JSONObject.
-632   * 
-633   * @return An iterator of the keys.
-634   */
-635  public Iterator keys() {
-636    return this.map.keySet().iterator();
-637  }
-638
-639  /**
-640   * Get the number of keys stored in the JSONObject.
-641   * 
-642   * @return The number of keys in the JSONObject.
-643   */
-644  public int length() {
-645    return this.map.size();
-646  }
-647
-648  /**
-649   * Produce a JSONArray containing the names of the elements of this
-650   * JSONObject.
-651   * 
-652   * @return A JSONArray containing the key strings, or null if the JSONObject
-653   *         is empty.
-654   */
-655  public JSONArray names() {
-656    JSONArray ja = new JSONArray();
-657    Iterator keys = keys();
-658    while (keys.hasNext()) {
-659      ja.put(keys.next());
-660    }
-661    return ja.length() == 0 ? null : ja;
-662  }
-663
-664  /**
-665   * Produce a string from a Number.
-666   * 
-667   * @param n A Number
-668   * @return A String.
-669   * @throws JSONException If n is a non-finite number.
-670   */
-671  static public String numberToString(Number n) throws JSONException {
-672    if (n == null) {
-673      throw new JSONException("Null pointer");
-674    }
-675    testValidity(n);
-676
-677    // Shave off trailing zeros and decimal point, if possible.
-678
-679    String s = n.toString();
-680    if (s.indexOf('.') > 0 && s.indexOf('e') < 0 && s.indexOf('E') < 0) {
-681      while (s.endsWith("0")) {
-682        s = s.substring(0, s.length() - 1);
-683      }
-684      if (s.endsWith(".")) {
-685        s = s.substring(0, s.length() - 1);
-686      }
-687    }
-688    return s;
-689  }
-690
-691  /**
-692   * Get an optional value associated with a key.
-693   * 
-694   * @param key A key string.
-695   * @return An object which is the value, or null if there is no value.
-696   */
-697  public Object opt(String key) {
-698    return key == null ? null : this.map.get(key);
-699  }
-700
-701  /**
-702   * Get an optional boolean associated with a key. It returns false if there is
-703   * no such key, or if the value is not Boolean.TRUE or the String "true".
-704   * 
-705   * @param key A key string.
-706   * @return The truth.
-707   */
-708  public boolean optBoolean(String key) {
-709    return optBoolean(key, false);
-710  }
-711
-712  /**
-713   * Get an optional boolean associated with a key. It returns the defaultValue
-714   * if there is no such key, or if it is not a Boolean or the String "true" or
-715   * "false" (case insensitive).
-716   * 
-717   * @param key A key string.
-718   * @param defaultValue The default.
-719   * @return The truth.
-720   */
-721  public boolean optBoolean(String key, boolean defaultValue) {
-722    try {
-723      return getBoolean(key);
-724    } catch (Exception e) {
-725      return defaultValue;
-726    }
-727  }
-728
-729  /**
-730   * Get an optional double associated with a key, or NaN if there is no such
-731   * key or if its value is not a number. If the value is a string, an attempt
-732   * will be made to evaluate it as a number.
-733   * 
-734   * @param key A string which is the key.
-735   * @return An object which is the value.
-736   */
-737  public double optDouble(String key) {
-738    return optDouble(key, Double.NaN);
-739  }
-740
-741  /**
-742   * Get an optional double associated with a key, or the defaultValue if there
-743   * is no such key or if its value is not a number. If the value is a string,
-744   * an attempt will be made to evaluate it as a number.
-745   * 
-746   * @param key A key string.
-747   * @param defaultValue The default.
-748   * @return An object which is the value.
-749   */
-750  public double optDouble(String key, double defaultValue) {
-751    try {
-752      Object o = opt(key);
-753      return o instanceof Number ? ((Number) o).doubleValue() : new Double(
-754          (String) o).doubleValue();
-755    } catch (Exception e) {
-756      return defaultValue;
-757    }
-758  }
-759
-760  /**
-761   * Get an optional int value associated with a key, or zero if there is no
-762   * such key or if the value is not a number. If the value is a string, an
-763   * attempt will be made to evaluate it as a number.
-764   * 
-765   * @param key A key string.
-766   * @return An object which is the value.
-767   */
-768  public int optInt(String key) {
-769    return optInt(key, 0);
-770  }
-771
-772  /**
-773   * Get an optional int value associated with a key, or the default if there is
-774   * no such key or if the value is not a number. If the value is a string, an
-775   * attempt will be made to evaluate it as a number.
-776   * 
-777   * @param key A key string.
-778   * @param defaultValue The default.
-779   * @return An object which is the value.
-780   */
-781  public int optInt(String key, int defaultValue) {
-782    try {
-783      return getInt(key);
-784    } catch (Exception e) {
-785      return defaultValue;
-786    }
-787  }
-788
-789  /**
-790   * Get an optional JSONArray associated with a key. It returns null if there
-791   * is no such key, or if its value is not a JSONArray.
-792   * 
-793   * @param key A key string.
-794   * @return A JSONArray which is the value.
-795   */
-796  public JSONArray optJSONArray(String key) {
-797    Object o = opt(key);
-798    return o instanceof JSONArray ? (JSONArray) o : null;
-799  }
-800
-801  /**
-802   * Get an optional JSONObject associated with a key. It returns null if there
-803   * is no such key, or if its value is not a JSONObject.
-804   * 
-805   * @param key A key string.
-806   * @return A JSONObject which is the value.
-807   */
-808  public JSONObject optJSONObject(String key) {
-809    Object o = opt(key);
-810    return o instanceof JSONObject ? (JSONObject) o : null;
-811  }
-812
-813  /**
-814   * Get an optional long value associated with a key, or zero if there is no
-815   * such key or if the value is not a number. If the value is a string, an
-816   * attempt will be made to evaluate it as a number.
-817   * 
-818   * @param key A key string.
-819   * @return An object which is the value.
-820   */
-821  public long optLong(String key) {
-822    return optLong(key, 0);
-823  }
-824
-825  /**
-826   * Get an optional long value associated with a key, or the default if there
-827   * is no such key or if the value is not a number. If the value is a string,
-828   * an attempt will be made to evaluate it as a number.
-829   * 
-830   * @param key A key string.
-831   * @param defaultValue The default.
-832   * @return An object which is the value.
-833   */
-834  public long optLong(String key, long defaultValue) {
-835    try {
-836      return getLong(key);
-837    } catch (Exception e) {
-838      return defaultValue;
-839    }
-840  }
-841
-842  /**
-843   * Get an optional string associated with a key. It returns an empty string if
-844   * there is no such key. If the value is not a string and is not null, then it
-845   * is coverted to a string.
-846   * 
-847   * @param key A key string.
-848   * @return A string which is the value.
-849   */
-850  public String optString(String key) {
-851    return optString(key, "");
-852  }
-853
-854  /**
-855   * Get an optional string associated with a key. It returns the defaultValue
-856   * if there is no such key.
-857   * 
-858   * @param key A key string.
-859   * @param defaultValue The default.
-860   * @return A string which is the value.
-861   */
-862  public String optString(String key, String defaultValue) {
-863    Object o = opt(key);
-864    return o != null ? o.toString() : defaultValue;
-865  }
-866
-867  private void populateMap(Object bean) {
-868    Class klass = bean.getClass();
-869
-870    // If klass is a System class then set includeSuperClass to false.
-871
-872    boolean includeSuperClass = klass.getClassLoader() != null;
-873
-874    Method[] methods = (includeSuperClass) ? klass.getMethods() : klass
-875        .getDeclaredMethods();
-876    for (int i = 0; i < methods.length; i += 1) {
-877      try {
-878        Method method = methods[i];
-879        if (Modifier.isPublic(method.getModifiers())) {
-880          String name = method.getName();
-881          String key = "";
-882          if (name.startsWith("get")) {
-883            if (name.equals("getClass") || name.equals("getDeclaringClass")) {
-884              key = "";
-885            } else {
-886              key = name.substring(3);
-887            }
-888          } else if (name.startsWith("is")) {
-889            key = name.substring(2);
-890          }
-891          if (key.length() > 0 && Character.isUpperCase(key.charAt(0))
-892              && method.getParameterTypes().length == 0) {
-893            if (key.length() == 1) {
-894              key = key.toLowerCase();
-895            } else if (!Character.isUpperCase(key.charAt(1))) {
-896              key = key.substring(0, 1).toLowerCase() + key.substring(1);
-897            }
-898
-899            Object result = method.invoke(bean, (Object[]) null);
-900
-901            this.map.put(key, wrap(result));
-902          }
-903        }
-904      } catch (Exception ignore) {
-905        // ??
-906      }
-907    }
-908  }
-909
-910  /**
-911   * Put a key/boolean pair in the JSONObject.
-912   * 
-913   * @param key A key string.
-914   * @param value A boolean which is the value.
-915   * @return this.
-916   * @throws JSONException If the key is null.
-917   */
-918  public JSONObject put(String key, boolean value) throws JSONException {
-919    put(key, value ? Boolean.TRUE : Boolean.FALSE);
-920    return this;
-921  }
-922
-923  /**
-924   * Put a key/value pair in the JSONObject, where the value will be a JSONArray
-925   * which is produced from a Collection.
-926   * 
-927   * @param key A key string.
-928   * @param value A Collection value.
-929   * @return this.
-930   * @throws JSONException
-931   */
-932  public JSONObject put(String key, Collection value) throws JSONException {
-933    put(key, new JSONArray(value));
-934    return this;
-935  }
-936
-937  /**
-938   * Put a key/double pair in the JSONObject.
-939   * 
-940   * @param key A key string.
-941   * @param value A double which is the value.
-942   * @return this.
-943   * @throws JSONException If the key is null or if the number is invalid.
-944   */
-945  public JSONObject put(String key, double value) throws JSONException {
-946    put(key, new Double(value));
-947    return this;
-948  }
-949
-950  /**
-951   * Put a key/int pair in the JSONObject.
-952   * 
-953   * @param key A key string.
-954   * @param value An int which is the value.
-955   * @return this.
-956   * @throws JSONException If the key is null.
-957   */
-958  public JSONObject put(String key, int value) throws JSONException {
-959    put(key, new Integer(value));
-960    return this;
-961  }
-962
-963  /**
-964   * Put a key/long pair in the JSONObject.
-965   * 
-966   * @param key A key string.
-967   * @param value A long which is the value.
-968   * @return this.
-969   * @throws JSONException If the key is null.
-970   */
-971  public JSONObject put(String key, long value) throws JSONException {
-972    put(key, new Long(value));
-973    return this;
-974  }
-975
-976  /**
-977   * Put a key/value pair in the JSONObject, where the value will be a
-978   * JSONObject which is produced from a Map.
-979   * 
-980   * @param key A key string.
-981   * @param value A Map value.
-982   * @return this.
-983   * @throws JSONException
-984   */
-985  public JSONObject put(String key, Map value) throws JSONException {
-986    put(key, new JSONObject(value));
-987    return this;
-988  }
-989
-990  /**
-991   * Put a key/value pair in the JSONObject. If the value is null, then the key
-992   * will be removed from the JSONObject if it is present.
-993   * 
-994   * @param key A key string.
-995   * @param value An object which is the value. It should be of one of these
-996   *          types: Boolean, Double, Integer, JSONArray, JSONObject, Long,
-997   *          String, or the JSONObject.NULL object.
-998   * @return this.
-999   * @throws JSONException If the value is non-finite number or if the key is
-1000   *           null.
-1001   */
-1002  public JSONObject put(String key, Object value) throws JSONException {
-1003    if (key == null) {
-1004      throw new JSONException("Null key.");
-1005    }
-1006    if (value != null) {
-1007      testValidity(value);
-1008      this.map.put(key, value);
-1009    } else {
-1010      remove(key);
-1011    }
-1012    return this;
-1013  }
-1014
-1015  /**
-1016   * Put a key/value pair in the JSONObject, but only if the key and the value
-1017   * are both non-null, and only if there is not already a member with that
-1018   * name.
-1019   * 
-1020   * @param key
-1021   * @param value
-1022   * @return his.
-1023   * @throws JSONException if the key is a duplicate
-1024   */
-1025  public JSONObject putOnce(String key, Object value) throws JSONException {
-1026    if (key != null && value != null) {
-1027      if (opt(key) != null) {
-1028        throw new JSONException("Duplicate key \"" + key + "\"");
-1029      }
-1030      put(key, value);
-1031    }
-1032    return this;
-1033  }
-1034
-1035  /**
-1036   * Put a key/value pair in the JSONObject, but only if the key and the value
-1037   * are both non-null.
-1038   * 
-1039   * @param key A key string.
-1040   * @param value An object which is the value. It should be of one of these
-1041   *          types: Boolean, Double, Integer, JSONArray, JSONObject, Long,
-1042   *          String, or the JSONObject.NULL object.
-1043   * @return this.
-1044   * @throws JSONException If the value is a non-finite number.
-1045   */
-1046  public JSONObject putOpt(String key, Object value) throws JSONException {
-1047    if (key != null && value != null) {
-1048      put(key, value);
-1049    }
-1050    return this;
-1051  }
-1052
-1053  /**
-1054   * Produce a string in double quotes with backslash sequences in all the right
-1055   * places. A backslash will be inserted within </, allowing JSON text to be
-1056   * delivered in HTML. In JSON text, a string cannot contain a control
-1057   * character or an unescaped quote or backslash.
-1058   * 
-1059   * @param string A String
-1060   * @return A String correctly formatted for insertion in a JSON text.
-1061   */
-1062  public static String quote(String string) {
-1063    if (string == null || string.length() == 0) {
-1064      return "\"\"";
-1065    }
-1066
-1067    char b;
-1068    char c = 0;
-1069    int i;
-1070    int len = string.length();
-1071    StringBuffer sb = new StringBuffer(len + 4);
-1072    String t;
-1073
-1074    sb.append('"');
-1075    for (i = 0; i < len; i += 1) {
-1076      b = c;
-1077      c = string.charAt(i);
-1078      switch (c) {
-1079        case '\\':
-1080        case '"':
-1081          sb.append('\\');
-1082          sb.append(c);
-1083          break;
-1084        case '/':
-1085          if (b == '<') {
-1086            sb.append('\\');
-1087          }
-1088          sb.append(c);
-1089          break;
-1090        case '\b':
-1091          sb.append("\\b");
-1092          break;
-1093        case '\t':
-1094          sb.append("\\t");
-1095          break;
-1096        case '\n':
-1097          sb.append("\\n");
-1098          break;
-1099        case '\f':
-1100          sb.append("\\f");
-1101          break;
-1102        case '\r':
-1103          sb.append("\\r");
-1104          break;
-1105        default:
-1106          if (c < ' ' || (c >= '\u0080' && c < '\u00a0')
-1107              || (c >= '\u2000' && c < '\u2100')) {
-1108            t = "000" + Integer.toHexString(c);
-1109            sb.append("\\u" + t.substring(t.length() - 4));
-1110          } else {
-1111            sb.append(c);
-1112          }
-1113      }
-1114    }
-1115    sb.append('"');
-1116    return sb.toString();
-1117  }
-1118
-1119  /**
-1120   * Remove a name and its value, if present.
-1121   * 
-1122   * @param key The name to be removed.
-1123   * @return The value that was associated with the name, or null if there was
-1124   *         no value.
-1125   */
-1126  public Object remove(String key) {
-1127    return this.map.remove(key);
-1128  }
-1129
-1130  /**
-1131   * Get an enumeration of the keys of the JSONObject. The keys will be sorted
-1132   * alphabetically.
-1133   * 
-1134   * @return An iterator of the keys.
-1135   */
-1136  public Iterator sortedKeys() {
-1137    return new TreeSet(this.map.keySet()).iterator();
-1138  }
-1139
-1140  /**
-1141   * Try to convert a string into a number, boolean, or null. If the string
-1142   * can't be converted, return the string.
-1143   * 
-1144   * @param s A String.
-1145   * @return A simple JSON value.
-1146   */
-1147  static public Object stringToValue(String s) {
-1148    if (s.equals("")) {
-1149      return s;
-1150    }
-1151    if (s.equalsIgnoreCase("true")) {
-1152      return Boolean.TRUE;
-1153    }
-1154    if (s.equalsIgnoreCase("false")) {
-1155      return Boolean.FALSE;
-1156    }
-1157    if (s.equalsIgnoreCase("null")) {
-1158      return JSONObject.NULL;
-1159    }
-1160
-1161    /*
-1162     * If it might be a number, try converting it. We support the non-standard
-1163     * 0x- convention. If a number cannot be produced, then the value will just
-1164     * be a string. Note that the 0x-, plus, and implied string conventions are
-1165     * non-standard. A JSON parser may accept non-JSON forms as long as it
-1166     * accepts all correct JSON forms.
-1167     */
-1168
-1169    char b = s.charAt(0);
-1170    if ((b >= '0' && b <= '9') || b == '.' || b == '-' || b == '+') {
-1171      if (b == '0' && s.length() > 2
-1172          && (s.charAt(1) == 'x' || s.charAt(1) == 'X')) {
-1173        try {
-1174          return new Integer(Integer.parseInt(s.substring(2), 16));
-1175        } catch (Exception ignore) {
-1176          // ??
-1177        }
-1178      }
-1179      try {
-1180        if (s.indexOf('.') > -1 || s.indexOf('e') > -1 || s.indexOf('E') > -1) {
-1181          return Double.valueOf(s);
-1182        }
-1183        Long myLong = new Long(s);
-1184        if (myLong.longValue() == myLong.intValue()) {
-1185          return new Integer(myLong.intValue());
-1186        }
-1187        return myLong;
-1188      } catch (Exception ignore) {
-1189        // ??
-1190      }
-1191    }
-1192    return s;
-1193  }
-1194
-1195  /**
-1196   * Throw an exception if the object is an NaN or infinite number.
-1197   * 
-1198   * @param o The object to test.
-1199   * @throws JSONException If o is a non-finite number.
-1200   */
-1201  static void testValidity(Object o) throws JSONException {
-1202    if (o != null) {
-1203      if (o instanceof Double) {
-1204        if (((Double) o).isInfinite() || ((Double) o).isNaN()) {
-1205          throw new JSONException("JSON does not allow non-finite numbers.");
-1206        }
-1207      } else if (o instanceof Float) {
-1208        if (((Float) o).isInfinite() || ((Float) o).isNaN()) {
-1209          throw new JSONException("JSON does not allow non-finite numbers.");
-1210        }
-1211      }
-1212    }
-1213  }
-1214
-1215  /**
-1216   * Produce a JSONArray containing the values of the members of this
-1217   * JSONObject.
-1218   * 
-1219   * @param names A JSONArray containing a list of key strings. This determines
-1220   *          the sequence of the values in the result.
-1221   * @return A JSONArray of values.
-1222   * @throws JSONException If any of the values are non-finite numbers.
-1223   */
-1224  public JSONArray toJSONArray(JSONArray names) throws JSONException {
-1225    if (names == null || names.length() == 0) {
-1226      return null;
-1227    }
-1228    JSONArray ja = new JSONArray();
-1229    for (int i = 0; i < names.length(); i += 1) {
-1230      ja.put(this.opt(names.getString(i)));
-1231    }
-1232    return ja;
-1233  }
-1234
-1235  /**
-1236   * Make a JSON text of this JSONObject. For compactness, no whitespace is
-1237   * added. If this would not result in a syntactically correct JSON text, then
-1238   * null will be returned instead.
-1239   * <p>
-1240   * Warning: This method assumes that the data structure is acyclical.
-1241   * 
-1242   * @return a printable, displayable, portable, transmittable representation of
-1243   *         the object, beginning with <code>{</code>&nbsp;<small>(left
-1244   *         brace)</small> and ending with <code>}</code>&nbsp;<small>(right
-1245   *         brace)</small>.
-1246   */
-1247  @Override
-1248  public String toString() {
-1249    try {
-1250      Iterator keys = keys();
-1251      StringBuffer sb = new StringBuffer("{");
-1252
-1253      while (keys.hasNext()) {
-1254        if (sb.length() > 1) {
-1255          sb.append(',');
-1256        }
-1257        Object o = keys.next();
-1258        sb.append(quote(o.toString()));
-1259        sb.append(':');
-1260        sb.append(valueToString(this.map.get(o)));
-1261      }
-1262      sb.append('}');
-1263      return sb.toString();
-1264    } catch (Exception e) {
-1265      return null;
-1266    }
-1267  }
-1268
-1269  /**
-1270   * Make a prettyprinted JSON text of this JSONObject.
-1271   * <p>
-1272   * Warning: This method assumes that the data structure is acyclical.
-1273   * 
-1274   * @param indentFactor The number of spaces to add to each level of
-1275   *          indentation.
-1276   * @return a printable, displayable, portable, transmittable representation of
-1277   *         the object, beginning with <code>{</code>&nbsp;<small>(left
-1278   *         brace)</small> and ending with <code>}</code>&nbsp;<small>(right
-1279   *         brace)</small>.
-1280   * @throws JSONException If the object contains an invalid number.
-1281   */
-1282  public String toString(int indentFactor) throws JSONException {
-1283    return toString(indentFactor, 0);
-1284  }
-1285
-1286  /**
-1287   * Make a prettyprinted JSON text of this JSONObject.
-1288   * <p>
-1289   * Warning: This method assumes that the data structure is acyclical.
-1290   * 
-1291   * @param indentFactor The number of spaces to add to each level of
-1292   *          indentation.
-1293   * @param indent The indentation of the top level.
-1294   * @return a printable, displayable, transmittable representation of the
-1295   *         object, beginning with <code>{</code>&nbsp;<small>(left
-1296   *         brace)</small> and ending with <code>}</code>&nbsp;<small>(right
-1297   *         brace)</small>.
-1298   * @throws JSONException If the object contains an invalid number.
-1299   */
-1300  String toString(int indentFactor, int indent) throws JSONException {
-1301    int j;
-1302    int n = length();
-1303    if (n == 0) {
-1304      return "{}";
-1305    }
-1306    Iterator keys = sortedKeys();
-1307    StringBuffer sb = new StringBuffer("{");
-1308    int newindent = indent + indentFactor;
-1309    Object o;
-1310    if (n == 1) {
-1311      o = keys.next();
-1312      sb.append(quote(o.toString()));
-1313      sb.append(": ");
-1314      sb.append(valueToString(this.map.get(o), indentFactor, indent));
-1315    } else {
-1316      while (keys.hasNext()) {
-1317        o = keys.next();
-1318        if (sb.length() > 1) {
-1319          sb.append(",\n");
-1320        } else {
-1321          sb.append('\n');
-1322        }
-1323        for (j = 0; j < newindent; j += 1) {
-1324          sb.append(' ');
-1325        }
-1326        sb.append(quote(o.toString()));
-1327        sb.append(": ");
-1328        sb.append(valueToString(this.map.get(o), indentFactor, newindent));
-1329      }
-1330      if (sb.length() > 1) {
-1331        sb.append('\n');
-1332        for (j = 0; j < indent; j += 1) {
-1333          sb.append(' ');
-1334        }
-1335      }
-1336    }
-1337    sb.append('}');
-1338    return sb.toString();
-1339  }
-1340
-1341  /**
-1342   * Make a JSON text of an Object value. If the object has an
-1343   * value.toJSONString() method, then that method will be used to produce the
-1344   * JSON text. The method is required to produce a strictly conforming text. If
-1345   * the object does not contain a toJSONString method (which is the most common
-1346   * case), then a text will be produced by other means. If the value is an
-1347   * array or Collection, then a JSONArray will be made from it and its
-1348   * toJSONString method will be called. If the value is a MAP, then a
-1349   * JSONObject will be made from it and its toJSONString method will be called.
-1350   * Otherwise, the value's toString method will be called, and the result will
-1351   * be quoted.
-1352   * 
-1353   * <p>
-1354   * Warning: This method assumes that the data structure is acyclical.
-1355   * 
-1356   * @param value The value to be serialized.
-1357   * @return a printable, displayable, transmittable representation of the
-1358   *         object, beginning with <code>{</code>&nbsp;<small>(left
-1359   *         brace)</small> and ending with <code>}</code>&nbsp;<small>(right
-1360   *         brace)</small>.
-1361   * @throws JSONException If the value is or contains an invalid number.
-1362   */
-1363  static String valueToString(Object value) throws JSONException {
-1364    if (value == null || value.equals(null)) {
-1365      return "null";
-1366    }
-1367    if (value instanceof JSONString) {
-1368      Object o;
-1369      try {
-1370        o = ((JSONString) value).toJSONString();
-1371      } catch (Exception e) {
-1372        throw new JSONException(e);
-1373      }
-1374      if (o instanceof String) {
-1375        return (String) o;
-1376      }
-1377      throw new JSONException("Bad value from toJSONString: " + o);
-1378    }
-1379    if (value instanceof Number) {
-1380      return numberToString((Number) value);
-1381    }
-1382    if (value instanceof Boolean || value instanceof JSONObject
-1383        || value instanceof JSONArray) {
-1384      return value.toString();
-1385    }
-1386    if (value instanceof Map) {
-1387      return new JSONObject((Map) value).toString();
-1388    }
-1389    if (value instanceof Collection) {
-1390      return new JSONArray((Collection) value).toString();
-1391    }
-1392    if (value.getClass().isArray()) {
-1393      return new JSONArray(value).toString();
-1394    }
-1395    return quote(value.toString());
-1396  }
-1397
-1398  /**
-1399   * Make a prettyprinted JSON text of an object value.
-1400   * <p>
-1401   * Warning: This method assumes that the data structure is acyclical.
-1402   * 
-1403   * @param value The value to be serialized.
-1404   * @param indentFactor The number of spaces to add to each level of
-1405   *          indentation.
-1406   * @param indent The indentation of the top level.
-1407   * @return a printable, displayable, transmittable representation of the
-1408   *         object, beginning with <code>{</code>&nbsp;<small>(left
-1409   *         brace)</small> and ending with <code>}</code>&nbsp;<small>(right
-1410   *         brace)</small>.
-1411   * @throws JSONException If the object contains an invalid number.
-1412   */
-1413  static String valueToString(Object value, int indentFactor, int indent)
-1414      throws JSONException {
-1415    if (value == null || value.equals(null)) {
-1416      return "null";
-1417    }
-1418    try {
-1419      if (value instanceof JSONString) {
-1420        Object o = ((JSONString) value).toJSONString();
-1421        if (o instanceof String) {
-1422          return (String) o;
-1423        }
-1424      }
-1425    } catch (Exception ignore) {
-1426      // ??
-1427    }
-1428    if (value instanceof Number) {
-1429      return numberToString((Number) value);
-1430    }
-1431    if (value instanceof Boolean) {
-1432      return value.toString();
-1433    }
-1434    if (value instanceof JSONObject) {
-1435      return ((JSONObject) value).toString(indentFactor, indent);
-1436    }
-1437    if (value instanceof JSONArray) {
-1438      return ((JSONArray) value).toString(indentFactor, indent);
-1439    }
-1440    if (value instanceof Map) {
-1441      return new JSONObject((Map) value).toString(indentFactor, indent);
-1442    }
-1443    if (value instanceof Collection) {
-1444      return new JSONArray((Collection) value).toString(indentFactor, indent);
-1445    }
-1446    if (value.getClass().isArray()) {
-1447      return new JSONArray(value).toString(indentFactor, indent);
-1448    }
-1449    return quote(value.toString());
-1450  }
-1451
-1452  /**
-1453   * Wrap an object, if necessary. If the object is null, return the NULL
-1454   * object. If it is an array or collection, wrap it in a JSONArray. If it is a
-1455   * map, wrap it in a JSONObject. If it is a standard property (Double, String,
-1456   * et al) then it is already wrapped. Otherwise, if it comes from one of the
-1457   * java packages, turn it into a string. And if it doesn't, try to wrap it in
-1458   * a JSONObject. If the wrapping fails, then null is returned.
-1459   * 
-1460   * @param object The object to wrap
-1461   * @return The wrapped value
-1462   */
-1463  static Object wrap(Object object) {
-1464    try {
-1465      if (object == null) {
-1466        return NULL;
-1467      }
-1468      if (object instanceof JSONObject || object instanceof JSONArray
-1469          || object instanceof Byte || object instanceof Character
-1470          || object instanceof Short || object instanceof Integer
-1471          || object instanceof Long || object instanceof Boolean
-1472          || object instanceof Float || object instanceof Double
-1473          || object instanceof String || NULL.equals(object)) {
-1474        return object;
-1475      }
-1476
-1477      if (object instanceof Collection) {
-1478        return new JSONArray((Collection) object);
-1479      }
-1480      if (object.getClass().isArray()) {
-1481        return new JSONArray(object);
-1482      }
-1483      if (object instanceof Map) {
-1484        return new JSONObject((Map) object);
-1485      }
-1486      Package objectPackage = object.getClass().getPackage();
-1487      String objectPackageName = (objectPackage != null ? objectPackage
-1488          .getName() : "");
-1489      if (objectPackageName.startsWith("java.")
-1490          || objectPackageName.startsWith("javax.")
-1491          || object.getClass().getClassLoader() == null) {
-1492        return object.toString();
-1493      }
-1494      return new JSONObject(object);
-1495    } catch (Exception exception) {
-1496      return null;
-1497    }
-1498  }
-1499
-1500  /**
-1501   * Write the contents of the JSONObject as JSON text to a writer. For
-1502   * compactness, no whitespace is added.
-1503   * <p>
-1504   * Warning: This method assumes that the data structure is acyclical.
-1505   * 
-1506   * @param writer TODO
-1507   * 
-1508   * @return The writer.
-1509   * @throws JSONException
-1510   */
-1511  public Writer write(Writer writer) throws JSONException {
-1512    try {
-1513      boolean b = false;
-1514      Iterator keys = keys();
-1515      writer.write('{');
-1516
-1517      while (keys.hasNext()) {
-1518        if (b) {
-1519          writer.write(',');
-1520        }
-1521        Object k = keys.next();
-1522        writer.write(quote(k.toString()));
-1523        writer.write(':');
-1524        Object v = this.map.get(k);
-1525        if (v instanceof JSONObject) {
-1526          ((JSONObject) v).write(writer);
-1527        } else if (v instanceof JSONArray) {
-1528          ((JSONArray) v).write(writer);
-1529        } else {
-1530          writer.write(valueToString(v));
-1531        }
-1532        b = true;
-1533      }
-1534      writer.write('}');
-1535      return writer;
-1536    } catch (IOException exception) {
-1537      throw new JSONException(exception);
-1538    }
-1539  }
-1540}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - diff --git a/doc/src-html/org/json/JSONString.html b/doc/src-html/org/json/JSONString.html deleted file mode 100644 index 08ca2ca..0000000 --- a/doc/src-html/org/json/JSONString.html +++ /dev/null @@ -1,91 +0,0 @@ - - - -Source code - - - -
-
001package org.json;
-002
-003/**
-004 * The <code>JSONString</code> interface allows a <code>toJSONString()</code>
-005 * method so that a class can change the behavior of
-006 * <code>JSONObject.toString()</code>, <code>JSONArray.toString()</code>, and
-007 * <code>JSONWriter.value(</code>Object<code>)</code>. The
-008 * <code>toJSONString</code> method will be used instead of the default behavior
-009 * of using the Object's <code>toString()</code> method and quoting the result.
-010 */
-011public interface JSONString {
-012  /**
-013   * The <code>toJSONString</code> method allows a class to produce its own JSON
-014   * serialization.
-015   * 
-016   * @return A strictly syntactically correct JSON text.
-017   */
-018  public String toJSONString();
-019}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - diff --git a/doc/src-html/org/json/JSONTokener.html b/doc/src-html/org/json/JSONTokener.html deleted file mode 100644 index 151ee52..0000000 --- a/doc/src-html/org/json/JSONTokener.html +++ /dev/null @@ -1,514 +0,0 @@ - - - -Source code - - - -
-
001package org.json;
-002
-003import java.io.BufferedReader;
-004import java.io.IOException;
-005import java.io.Reader;
-006import java.io.StringReader;
-007
-008/*
-009 Copyright (c) 2002 JSON.org
-010
-011 Permission is hereby granted, free of charge, to any person obtaining a copy
-012 of this software and associated documentation files (the "Software"), to deal
-013 in the Software without restriction, including without limitation the rights
-014 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-015 copies of the Software, and to permit persons to whom the Software is
-016 furnished to do so, subject to the following conditions:
-017
-018 The above copyright notice and this permission notice shall be included in all
-019 copies or substantial portions of the Software.
-020
-021 The Software shall be used for Good, not Evil.
-022
-023 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-024 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-025 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-026 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-027 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-028 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-029 SOFTWARE.
-030 */
-031
-032/**
-033 * A JSONTokener takes a source string and extracts characters and tokens from
-034 * it. It is used by the JSONObject and JSONArray constructors to parse JSON
-035 * source strings.
-036 * 
-037 * @author JSON.org
-038 * @version 2010-02-02
-039 */
-040@SuppressWarnings("nls")
-041public class JSONTokener {
-042
-043  private int character;
-044
-045  private boolean eof;
-046
-047  private int index;
-048
-049  private int line;
-050
-051  private char previous;
-052
-053  private Reader reader;
-054
-055  private boolean usePrevious;
-056
-057  /**
-058   * Construct a JSONTokener from a reader.
-059   * 
-060   * @param reader A reader.
-061   */
-062  public JSONTokener(Reader reader) {
-063    this.reader = reader.markSupported() ? reader : new BufferedReader(reader);
-064    this.eof = false;
-065    this.usePrevious = false;
-066    this.previous = 0;
-067    this.index = 0;
-068    this.character = 1;
-069    this.line = 1;
-070  }
-071
-072  /**
-073   * Construct a JSONTokener from a string.
-074   * 
-075   * @param s A source string.
-076   */
-077  public JSONTokener(String s) {
-078    this(new StringReader(s));
-079  }
-080
-081  /**
-082   * Back up one character. This provides a sort of lookahead capability, so
-083   * that you can test for a digit or letter before attempting to parse the next
-084   * number or identifier.
-085   * 
-086   * @throws JSONException
-087   */
-088  public void back() throws JSONException {
-089    if (this.usePrevious || this.index <= 0) {
-090      throw new JSONException("Stepping back two steps is not supported");
-091    }
-092    this.index -= 1;
-093    this.character -= 1;
-094    this.usePrevious = true;
-095    this.eof = false;
-096  }
-097
-098  /**
-099   * Get the hex value of a character (base16).
-100   * 
-101   * @param c A character between '0' and '9' or between 'A' and 'F' or between
-102   *          'a' and 'f'.
-103   * @return An int between 0 and 15, or -1 if c was not a hex digit.
-104   */
-105  public static int dehexchar(char c) {
-106    if (c >= '0' && c <= '9') {
-107      return c - '0';
-108    }
-109    if (c >= 'A' && c <= 'F') {
-110      return c - ('A' - 10);
-111    }
-112    if (c >= 'a' && c <= 'f') {
-113      return c - ('a' - 10);
-114    }
-115    return -1;
-116  }
-117
-118  /**
-119   * @return TODO
-120   */
-121  public boolean end() {
-122    return this.eof && !this.usePrevious;
-123  }
-124
-125  /**
-126   * Determine if the source string still contains characters that next() can
-127   * consume.
-128   * 
-129   * @return true if not yet at the end of the source.
-130   * @throws JSONException
-131   */
-132  public boolean more() throws JSONException {
-133    next();
-134    if (end()) {
-135      return false;
-136    }
-137    back();
-138    return true;
-139  }
-140
-141  /**
-142   * Get the next character in the source string.
-143   * 
-144   * @return The next character, or 0 if past the end of the source string.
-145   * @throws JSONException
-146   */
-147  public char next() throws JSONException {
-148    int c;
-149    if (this.usePrevious) {
-150      this.usePrevious = false;
-151      c = this.previous;
-152    } else {
-153      try {
-154        c = this.reader.read();
-155      } catch (IOException exception) {
-156        throw new JSONException(exception);
-157      }
-158
-159      if (c <= 0) { // End of stream
-160        this.eof = true;
-161        c = 0;
-162      }
-163    }
-164    this.index += 1;
-165    if (this.previous == '\r') {
-166      this.line += 1;
-167      this.character = c == '\n' ? 0 : 1;
-168    } else if (c == '\n') {
-169      this.line += 1;
-170      this.character = 0;
-171    } else {
-172      this.character += 1;
-173    }
-174    this.previous = (char) c;
-175    return this.previous;
-176  }
-177
-178  /**
-179   * Consume the next character, and check that it matches a specified
-180   * character.
-181   * 
-182   * @param c The character to match.
-183   * @return The character.
-184   * @throws JSONException if the character does not match.
-185   */
-186  public char next(char c) throws JSONException {
-187    char n = next();
-188    if (n != c) {
-189      throw syntaxError("Expected '" + c + "' and instead saw '" + n + "'");
-190    }
-191    return n;
-192  }
-193
-194  /**
-195   * Get the next n characters.
-196   * 
-197   * @param n The number of characters to take.
-198   * @return A string of n characters.
-199   * @throws JSONException Substring bounds error if there are not n characters
-200   *           remaining in the source string.
-201   */
-202  public String next(int n) throws JSONException {
-203    if (n == 0) {
-204      return "";
-205    }
-206
-207    char[] buffer = new char[n];
-208    int pos = 0;
-209
-210    while (pos < n) {
-211      buffer[pos] = next();
-212      if (end()) {
-213        throw syntaxError("Substring bounds error");
-214      }
-215      pos += 1;
-216    }
-217    return new String(buffer);
-218  }
-219
-220  /**
-221   * Get the next char in the string, skipping whitespace.
-222   * 
-223   * @throws JSONException
-224   * @return A character, or 0 if there are no more characters.
-225   */
-226  public char nextClean() throws JSONException {
-227    for (;;) {
-228      char c = next();
-229      if (c == 0 || c > ' ') {
-230        return c;
-231      }
-232    }
-233  }
-234
-235  /**
-236   * Return the characters up to the next close quote character. Backslash
-237   * processing is done. The formal JSON format does not allow strings in single
-238   * quotes, but an implementation is allowed to accept them.
-239   * 
-240   * @param quote The quoting character, either <code>"</code>&nbsp;<small>(double
-241   *          quote)</small> or <code>'</code>&nbsp;<small>(single quote)</small>.
-242   * @return A String.
-243   * @throws JSONException Unterminated string.
-244   */
-245  public String nextString(char quote) throws JSONException {
-246    char c;
-247    StringBuffer sb = new StringBuffer();
-248    for (;;) {
-249      c = next();
-250      switch (c) {
-251        case 0:
-252        case '\n':
-253        case '\r':
-254          throw syntaxError("Unterminated string");
-255        case '\\':
-256          c = next();
-257          switch (c) {
-258            case 'b':
-259              sb.append('\b');
-260              break;
-261            case 't':
-262              sb.append('\t');
-263              break;
-264            case 'n':
-265              sb.append('\n');
-266              break;
-267            case 'f':
-268              sb.append('\f');
-269              break;
-270            case 'r':
-271              sb.append('\r');
-272              break;
-273            case 'u':
-274              sb.append((char) Integer.parseInt(next(4), 16));
-275              break;
-276            case '"':
-277            case '\'':
-278            case '\\':
-279            case '/':
-280              sb.append(c);
-281              break;
-282            default:
-283              throw syntaxError("Illegal escape.");
-284          }
-285          break;
-286        default:
-287          if (c == quote) {
-288            return sb.toString();
-289          }
-290          sb.append(c);
-291      }
-292    }
-293  }
-294
-295  /**
-296   * Get the text up but not including the specified character or the end of
-297   * line, whichever comes first.
-298   * 
-299   * @param d A delimiter character.
-300   * @return A string.
-301   * @throws JSONException
-302   */
-303  public String nextTo(char d) throws JSONException {
-304    StringBuffer sb = new StringBuffer();
-305    for (;;) {
-306      char c = next();
-307      if (c == d || c == 0 || c == '\n' || c == '\r') {
-308        if (c != 0) {
-309          back();
-310        }
-311        return sb.toString().trim();
-312      }
-313      sb.append(c);
-314    }
-315  }
-316
-317  /**
-318   * Get the text up but not including one of the specified delimiter characters
-319   * or the end of line, whichever comes first.
-320   * 
-321   * @param delimiters A set of delimiter characters.
-322   * @return A string, trimmed.
-323   * @throws JSONException
-324   */
-325  public String nextTo(String delimiters) throws JSONException {
-326    char c;
-327    StringBuffer sb = new StringBuffer();
-328    for (;;) {
-329      c = next();
-330      if (delimiters.indexOf(c) >= 0 || c == 0 || c == '\n' || c == '\r') {
-331        if (c != 0) {
-332          back();
-333        }
-334        return sb.toString().trim();
-335      }
-336      sb.append(c);
-337    }
-338  }
-339
-340  /**
-341   * Get the next value. The value can be a Boolean, Double, Integer, JSONArray,
-342   * JSONObject, Long, or String, or the JSONObject.NULL object.
-343   * 
-344   * @throws JSONException If syntax error.
-345   * 
-346   * @return An object.
-347   */
-348  public Object nextValue() throws JSONException {
-349    char c = nextClean();
-350    String s;
-351
-352    switch (c) {
-353      case '"':
-354      case '\'':
-355        return nextString(c);
-356      case '{':
-357        back();
-358        return new JSONObject(this);
-359      case '[':
-360      case '(':
-361        back();
-362        return new JSONArray(this);
-363    }
-364
-365    /*
-366     * Handle unquoted text. This could be the values true, false, or null, or
-367     * it can be a number. An implementation (such as this one) is allowed to
-368     * also accept non-standard forms.
-369     * 
-370     * Accumulate characters until we reach the end of the text or a formatting
-371     * character.
-372     */
-373
-374    StringBuffer sb = new StringBuffer();
-375    while (c >= ' ' && ",:]}/\\\"[{;=#".indexOf(c) < 0) {
-376      sb.append(c);
-377      c = next();
-378    }
-379    back();
-380
-381    s = sb.toString().trim();
-382    if (s.equals("")) {
-383      throw syntaxError("Missing value");
-384    }
-385    return JSONObject.stringToValue(s);
-386  }
-387
-388  /**
-389   * Skip characters until the next character is the requested character. If the
-390   * requested character is not found, no characters are skipped.
-391   * 
-392   * @param to A character to skip to.
-393   * @return The requested character, or zero if the requested character is not
-394   *         found.
-395   * @throws JSONException
-396   */
-397  public char skipTo(char to) throws JSONException {
-398    char c;
-399    try {
-400      int startIndex = this.index;
-401      int startCharacter = this.character;
-402      int startLine = this.line;
-403      this.reader.mark(Integer.MAX_VALUE);
-404      do {
-405        c = next();
-406        if (c == 0) {
-407          this.reader.reset();
-408          this.index = startIndex;
-409          this.character = startCharacter;
-410          this.line = startLine;
-411          return c;
-412        }
-413      } while (c != to);
-414    } catch (IOException exc) {
-415      throw new JSONException(exc);
-416    }
-417
-418    back();
-419    return c;
-420  }
-421
-422  /**
-423   * Make a JSONException to signal a syntax error.
-424   * 
-425   * @param message The error message.
-426   * @return A JSONException object, suitable for throwing
-427   */
-428  public JSONException syntaxError(String message) {
-429    return new JSONException(message + toString());
-430  }
-431
-432  /**
-433   * Make a printable string of this JSONTokener.
-434   * 
-435   * @return " at {index} [character {character} line {line}]"
-436   */
-437  @Override
-438  public String toString() {
-439    return " at " + this.index + " [character " + this.character + " line "
-440        + this.line + "]";
-441  }
-442}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - diff --git a/doc/stylesheet.css b/doc/stylesheet.css deleted file mode 100644 index 0aeaa97..0000000 --- a/doc/stylesheet.css +++ /dev/null @@ -1,474 +0,0 @@ -/* Javadoc style sheet */ -/* -Overall document style -*/ -body { - background-color:#ffffff; - color:#353833; - font-family:Arial, Helvetica, sans-serif; - font-size:76%; - margin:0; -} -a:link, a:visited { - text-decoration:none; - color:#4c6b87; -} -a:hover, a:focus { - text-decoration:none; - color:#bb7a2a; -} -a:active { - text-decoration:none; - color:#4c6b87; -} -a[name] { - color:#353833; -} -a[name]:hover { - text-decoration:none; - color:#353833; -} -pre { - font-size:1.3em; -} -h1 { - font-size:1.8em; -} -h2 { - font-size:1.5em; -} -h3 { - font-size:1.4em; -} -h4 { - font-size:1.3em; -} -h5 { - font-size:1.2em; -} -h6 { - font-size:1.1em; -} -ul { - list-style-type:disc; -} -code, tt { - font-size:1.2em; -} -dt code { - font-size:1.2em; -} -table tr td dt code { - font-size:1.2em; - vertical-align:top; -} -sup { - font-size:.6em; -} -/* -Document title and Copyright styles -*/ -.clear { - clear:both; - height:0px; - overflow:hidden; -} -.aboutLanguage { - float:right; - padding:0px 21px; - font-size:.8em; - z-index:200; - margin-top:-7px; -} -.legalCopy { - margin-left:.5em; -} -.bar a, .bar a:link, .bar a:visited, .bar a:active { - color:#FFFFFF; - text-decoration:none; -} -.bar a:hover, .bar a:focus { - color:#bb7a2a; -} -.tab { - background-color:#0066FF; - background-image:url(resources/titlebar.gif); - background-position:left top; - background-repeat:no-repeat; - color:#ffffff; - padding:8px; - width:5em; - font-weight:bold; -} -/* -Navigation bar styles -*/ -.bar { - background-image:url(resources/background.gif); - background-repeat:repeat-x; - color:#FFFFFF; - padding:.8em .5em .4em .8em; - height:auto;/*height:1.8em;*/ - font-size:1em; - margin:0; -} -.topNav { - background-image:url(resources/background.gif); - background-repeat:repeat-x; - color:#FFFFFF; - float:left; - padding:0; - width:100%; - clear:right; - height:2.8em; - padding-top:10px; - overflow:hidden; -} -.bottomNav { - margin-top:10px; - background-image:url(resources/background.gif); - background-repeat:repeat-x; - color:#FFFFFF; - float:left; - padding:0; - width:100%; - clear:right; - height:2.8em; - padding-top:10px; - overflow:hidden; -} -.subNav { - background-color:#dee3e9; - border-bottom:1px solid #9eadc0; - float:left; - width:100%; - overflow:hidden; -} -.subNav div { - clear:left; - float:left; - padding:0 0 5px 6px; -} -ul.navList, ul.subNavList { - float:left; - margin:0 25px 0 0; - padding:0; -} -ul.navList li{ - list-style:none; - float:left; - padding:3px 6px; -} -ul.subNavList li{ - list-style:none; - float:left; - font-size:90%; -} -.topNav a:link, .topNav a:active, .topNav a:visited, .bottomNav a:link, .bottomNav a:active, .bottomNav a:visited { - color:#FFFFFF; - text-decoration:none; -} -.topNav a:hover, .bottomNav a:hover { - text-decoration:none; - color:#bb7a2a; -} -.navBarCell1Rev { - background-image:url(resources/tab.gif); - background-color:#a88834; - color:#FFFFFF; - margin: auto 5px; - border:1px solid #c9aa44; -} -/* -Page header and footer styles -*/ -.header, .footer { - clear:both; - margin:0 20px; - padding:5px 0 0 0; -} -.indexHeader { - margin:10px; - position:relative; -} -.indexHeader h1 { - font-size:1.3em; -} -.title { - color:#2c4557; - margin:10px 0; -} -.subTitle { - margin:5px 0 0 0; -} -.header ul { - margin:0 0 25px 0; - padding:0; -} -.footer ul { - margin:20px 0 5px 0; -} -.header ul li, .footer ul li { - list-style:none; - font-size:1.2em; -} -/* -Heading styles -*/ -div.details ul.blockList ul.blockList ul.blockList li.blockList h4, div.details ul.blockList ul.blockList ul.blockListLast li.blockList h4 { - background-color:#dee3e9; - border-top:1px solid #9eadc0; - border-bottom:1px solid #9eadc0; - margin:0 0 6px -8px; - padding:2px 5px; -} -ul.blockList ul.blockList ul.blockList li.blockList h3 { - background-color:#dee3e9; - border-top:1px solid #9eadc0; - border-bottom:1px solid #9eadc0; - margin:0 0 6px -8px; - padding:2px 5px; -} -ul.blockList ul.blockList li.blockList h3 { - padding:0; - margin:15px 0; -} -ul.blockList li.blockList h2 { - padding:0px 0 20px 0; -} -/* -Page layout container styles -*/ -.contentContainer, .sourceContainer, .classUseContainer, .serializedFormContainer, .constantValuesContainer { - clear:both; - padding:10px 20px; - position:relative; -} -.indexContainer { - margin:10px; - position:relative; - font-size:1.0em; -} -.indexContainer h2 { - font-size:1.1em; - padding:0 0 3px 0; -} -.indexContainer ul { - margin:0; - padding:0; -} -.indexContainer ul li { - list-style:none; -} -.contentContainer .description dl dt, .contentContainer .details dl dt, .serializedFormContainer dl dt { - font-size:1.1em; - font-weight:bold; - margin:10px 0 0 0; - color:#4E4E4E; -} -.contentContainer .description dl dd, .contentContainer .details dl dd, .serializedFormContainer dl dd { - margin:10px 0 10px 20px; -} -.serializedFormContainer dl.nameValue dt { - margin-left:1px; - font-size:1.1em; - display:inline; - font-weight:bold; -} -.serializedFormContainer dl.nameValue dd { - margin:0 0 0 1px; - font-size:1.1em; - display:inline; -} -/* -List styles -*/ -ul.horizontal li { - display:inline; - font-size:0.9em; -} -ul.inheritance { - margin:0; - padding:0; -} -ul.inheritance li { - display:inline; - list-style:none; -} -ul.inheritance li ul.inheritance { - margin-left:15px; - padding-left:15px; - padding-top:1px; -} -ul.blockList, ul.blockListLast { - margin:10px 0 10px 0; - padding:0; -} -ul.blockList li.blockList, ul.blockListLast li.blockList { - list-style:none; - margin-bottom:25px; -} -ul.blockList ul.blockList li.blockList, ul.blockList ul.blockListLast li.blockList { - padding:0px 20px 5px 10px; - border:1px solid #9eadc0; - background-color:#f9f9f9; -} -ul.blockList ul.blockList ul.blockList li.blockList, ul.blockList ul.blockList ul.blockListLast li.blockList { - padding:0 0 5px 8px; - background-color:#ffffff; - border:1px solid #9eadc0; - border-top:none; -} -ul.blockList ul.blockList ul.blockList ul.blockList li.blockList { - margin-left:0; - padding-left:0; - padding-bottom:15px; - border:none; - border-bottom:1px solid #9eadc0; -} -ul.blockList ul.blockList ul.blockList ul.blockList li.blockListLast { - list-style:none; - border-bottom:none; - padding-bottom:0; -} -table tr td dl, table tr td dl dt, table tr td dl dd { - margin-top:0; - margin-bottom:1px; -} -/* -Table styles -*/ -.contentContainer table, .classUseContainer table, .constantValuesContainer table { - border-bottom:1px solid #9eadc0; - width:100%; -} -.contentContainer ul li table, .classUseContainer ul li table, .constantValuesContainer ul li table { - width:100%; -} -.contentContainer .description table, .contentContainer .details table { - border-bottom:none; -} -.contentContainer ul li table th.colOne, .contentContainer ul li table th.colFirst, .contentContainer ul li table th.colLast, .classUseContainer ul li table th, .constantValuesContainer ul li table th, .contentContainer ul li table td.colOne, .contentContainer ul li table td.colFirst, .contentContainer ul li table td.colLast, .classUseContainer ul li table td, .constantValuesContainer ul li table td{ - vertical-align:top; - padding-right:20px; -} -.contentContainer ul li table th.colLast, .classUseContainer ul li table th.colLast,.constantValuesContainer ul li table th.colLast, -.contentContainer ul li table td.colLast, .classUseContainer ul li table td.colLast,.constantValuesContainer ul li table td.colLast, -.contentContainer ul li table th.colOne, .classUseContainer ul li table th.colOne, -.contentContainer ul li table td.colOne, .classUseContainer ul li table td.colOne { - padding-right:3px; -} -.overviewSummary caption, .packageSummary caption, .contentContainer ul.blockList li.blockList caption, .summary caption, .classUseContainer caption, .constantValuesContainer caption { - position:relative; - text-align:left; - background-repeat:no-repeat; - color:#FFFFFF; - font-weight:bold; - clear:none; - overflow:hidden; - padding:0px; - margin:0px; -} -caption a:link, caption a:hover, caption a:active, caption a:visited { - color:#FFFFFF; -} -.overviewSummary caption span, .packageSummary caption span, .contentContainer ul.blockList li.blockList caption span, .summary caption span, .classUseContainer caption span, .constantValuesContainer caption span { - white-space:nowrap; - padding-top:8px; - padding-left:8px; - display:block; - float:left; - background-image:url(resources/titlebar.gif); - height:18px; -} -.overviewSummary .tabEnd, .packageSummary .tabEnd, .contentContainer ul.blockList li.blockList .tabEnd, .summary .tabEnd, .classUseContainer .tabEnd, .constantValuesContainer .tabEnd { - width:10px; - background-image:url(resources/titlebar_end.gif); - background-repeat:no-repeat; - background-position:top right; - position:relative; - float:left; -} -ul.blockList ul.blockList li.blockList table { - margin:0 0 12px 0px; - width:100%; -} -.tableSubHeadingColor { - background-color: #EEEEFF; -} -.altColor { - background-color:#eeeeef; -} -.rowColor { - background-color:#ffffff; -} -.overviewSummary td, .packageSummary td, .contentContainer ul.blockList li.blockList td, .summary td, .classUseContainer td, .constantValuesContainer td { - text-align:left; - padding:3px 3px 3px 7px; -} -th.colFirst, th.colLast, th.colOne, .constantValuesContainer th { - background:#dee3e9; - border-top:1px solid #9eadc0; - border-bottom:1px solid #9eadc0; - text-align:left; - padding:3px 3px 3px 7px; -} -td.colOne a:link, td.colOne a:active, td.colOne a:visited, td.colOne a:hover, td.colFirst a:link, td.colFirst a:active, td.colFirst a:visited, td.colFirst a:hover, td.colLast a:link, td.colLast a:active, td.colLast a:visited, td.colLast a:hover, .constantValuesContainer td a:link, .constantValuesContainer td a:active, .constantValuesContainer td a:visited, .constantValuesContainer td a:hover { - font-weight:bold; -} -td.colFirst, th.colFirst { - border-left:1px solid #9eadc0; - white-space:nowrap; -} -td.colLast, th.colLast { - border-right:1px solid #9eadc0; -} -td.colOne, th.colOne { - border-right:1px solid #9eadc0; - border-left:1px solid #9eadc0; -} -table.overviewSummary { - padding:0px; - margin-left:0px; -} -table.overviewSummary td.colFirst, table.overviewSummary th.colFirst, -table.overviewSummary td.colOne, table.overviewSummary th.colOne { - width:25%; - vertical-align:middle; -} -table.packageSummary td.colFirst, table.overviewSummary th.colFirst { - width:25%; - vertical-align:middle; -} -/* -Content styles -*/ -.description pre { - margin-top:0; -} -.deprecatedContent { - margin:0; - padding:10px 0; -} -.docSummary { - padding:0; -} -/* -Formatting effect styles -*/ -.sourceLineNo { - color:green; - padding:0 30px 0 0; -} -h1.hidden { - visibility:hidden; - overflow:hidden; - font-size:.9em; -} -.block { - display:block; - margin:3px 0 0 0; -} -.strong { - font-weight:bold; -} diff --git a/pom.xml b/pom.xml index 68ede9a..6015aab 100644 --- a/pom.xml +++ b/pom.xml @@ -6,23 +6,76 @@ 4.0.0 wordpress-java jwordpress - 0.5.1 + 0.6 wordpress-java This is a small client library and a command line interface for interacting with the xmlrpc interface of wordpress. + + + MIT License + https://raw.githubusercontent.com/canbican/wordpress-java/master/COPYING-MIT + repo + + + GNU General Public License + https://raw.githubusercontent.com/canbican/wordpress-java/master/COPYING-GPL + repo + + + + maven-project-info-reports-plugin + + true + + 2.8 + org.apache.maven.plugins maven-javadoc-plugin 2.10.3 - - + + + default + + javadoc + + + + aggregate + + aggregate + + + + + + org.apache.maven.wagon + wagon-scm + 2.9 + + + org.apache.maven.scm + maven-scm-manager-plexus + 1.9.4 + + + org.apache.maven.scm + maven-scm-provider-gitexe + 1.9.4 + + + + org.apache.maven.plugins + maven-site-plugin + 3.3 + com.googlecode.maven-gcu-plugin maven-gcu-plugin @@ -138,8 +191,8 @@ maven-compiler-plugin 2.3.2 - 1.7 - 1.7 + 1.8 + 1.8 @@ -189,11 +242,10 @@ - - false - googlecode - svn:https://wordpress-java.googlecode.com/svn/repo - + + git-wordpressjava + scm:git:ssh://git@github.com/canbican/wordpress-java.git + diff --git a/src/net/bican/wordpress/Attachment.java b/src/net/bican/wordpress/Attachment.java index 6e136c5..5f39c43 100644 --- a/src/net/bican/wordpress/Attachment.java +++ b/src/net/bican/wordpress/Attachment.java @@ -1,9 +1,9 @@ /* * * Wordpress-java - * http://code.google.com/p/wordpress-java/ + * https://github.com/canbican/wordpress-java/ * - * Copyright 2012 Can Bican + * Copyright 2012-2015 Can Bican * See the file 'COPYING' in the distribution for licensing terms. * */ @@ -13,7 +13,7 @@ * * Class that represents a wordpress attachment. * - * @author Can Bican <can@bican.net> + * @author Can Bican * */ class Attachment extends XmlRpcMapped { @@ -56,28 +56,28 @@ public String getType() { /** * @param bits the bits to set */ - public void setBits(byte[] bits) { + public void setBits(final byte[] bits) { this.bits = bits; } /** * @param name the name to set */ - public void setName(String name) { + public void setName(final String name) { this.name = name; } /** * @param overwrite the overwrite to set */ - public void setOverwrite(Boolean overwrite) { + public void setOverwrite(final Boolean overwrite) { this.overwrite = overwrite; } /** * @param type the type to set */ - public void setType(String type) { + public void setType(final String type) { this.type = type; } } diff --git a/src/net/bican/wordpress/Author.java b/src/net/bican/wordpress/Author.java index 31626b5..8526de9 100644 --- a/src/net/bican/wordpress/Author.java +++ b/src/net/bican/wordpress/Author.java @@ -1,28 +1,28 @@ /* * * Wordpress-java - * http://code.google.com/p/wordpress-java/ + * https://github.com/canbican/wordpress-java/ * - * Copyright 2012 Can Bican + * Copyright 2012-2015 Can Bican * See the file 'COPYING' in the distribution for licensing terms. * */ package net.bican.wordpress; +import net.bican.wordpress.util.StringHeader; + /** - * * Author object for a blog. * - * @author Can Bican <can@bican.net> - * + * @author Can Bican */ public class Author extends XmlRpcMapped implements StringHeader { String display_name; - - String user_id; - + + Integer user_id; + String user_login; - + /** * Display Name of the author. * @@ -31,16 +31,16 @@ public class Author extends XmlRpcMapped implements StringHeader { public String getDisplay_name() { return this.display_name; } - + /** * User id of the author. * * @return the user_id */ - public String getUser_id() { + public Integer getUser_id() { return this.user_id; } - + /** * Login name of the author. * @@ -49,38 +49,41 @@ public String getUser_id() { public String getUser_login() { return this.user_login; } - + /** * Display name of the author. * - * @param display_name the display_name to set + * @param display_name + * the display_name to set */ - public void setDisplay_name(String display_name) { + public void setDisplay_name(final String display_name) { this.display_name = display_name; } - + /** * User id of the author. * - * @param user_id the user_id to set + * @param user_id + * the user_id to set */ - public void setUser_id(String user_id) { + public void setUser_id(final Integer user_id) { this.user_id = user_id; } - + /** * Login name of the author. * - * @param user_login the user_login to set + * @param user_login + * the user_login to set */ - public void setUser_login(String user_login) { + public void setUser_login(final String user_login) { this.user_login = user_login; } - + /** * (non-Javadoc) * - * @see net.bican.wordpress.StringHeader#getStringHeader() + * @see net.bican.wordpress.util.StringHeader#getStringHeader() */ @Override @SuppressWarnings("nls") diff --git a/src/net/bican/wordpress/Blog.java b/src/net/bican/wordpress/Blog.java deleted file mode 100644 index f58156b..0000000 --- a/src/net/bican/wordpress/Blog.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * - * Wordpress-java - * http://code.google.com/p/wordpress-java/ - * - * Copyright 2012 Can Bican - * See the file 'COPYING' in the distribution for licensing terms. - * - */ -package net.bican.wordpress; - -/** - * - * Class that keeps the information on a blog for a user - * - * @author Can Bican <can@bican.net> - * - */ -public class Blog extends XmlRpcMapped { - Boolean isAdmin; - - String url; - - String blogid; - - String blogName; - - /** - * @return the isAdmin - */ - public Boolean getIsAdmin() { - return this.isAdmin; - } - - /** - * @param isAdmin the isAdmin to set - */ - public void setIsAdmin(Boolean isAdmin) { - this.isAdmin = isAdmin; - } - - /** - * @return the url - */ - public String getUrl() { - return this.url; - } - - /** - * @param url the url to set - */ - public void setUrl(String url) { - this.url = url; - } - - /** - * @return the blogid - */ - public String getBlogid() { - return this.blogid; - } - - /** - * @param blogid the blogid to set - */ - public void setBlogid(String blogid) { - this.blogid = blogid; - } - - /** - * @return the blogName - */ - public String getBlogName() { - return this.blogName; - } - - /** - * @param blogName the blogName to set - */ - public void setBlogName(String blogName) { - this.blogName = blogName; - } -} diff --git a/src/net/bican/wordpress/Cap.java b/src/net/bican/wordpress/Cap.java index bb2e8de..5c96785 100644 --- a/src/net/bican/wordpress/Cap.java +++ b/src/net/bican/wordpress/Cap.java @@ -1,9 +1,20 @@ +/* + * + * Wordpress-java + * https://github.com/canbican/wordpress-java/ + * + * Copyright 2012-2015 Can Bican + * See the file 'COPYING' in the distribution for licensing terms. + * + */ package net.bican.wordpress; +import net.bican.wordpress.util.StringHeader; + /** * Cap object for a blog. * - * @author Can Bican <can@bican.net> + * @author Can Bican */ public class Cap extends XmlRpcMapped implements StringHeader { String manage_terms; @@ -43,7 +54,7 @@ public String getManage_terms() { * @param assign_terms * the assign terms */ - public void setAssign_terms(String assign_terms) { + public void setAssign_terms(final String assign_terms) { this.assign_terms = assign_terms; } @@ -51,7 +62,7 @@ public void setAssign_terms(String assign_terms) { * @param delete_terms * the delete terms */ - public void setDelete_terms(String delete_terms) { + public void setDelete_terms(final String delete_terms) { this.delete_terms = delete_terms; } @@ -59,7 +70,7 @@ public void setDelete_terms(String delete_terms) { * @param edit_terms * the edit terms */ - public void setEdit_terms(String edit_terms) { + public void setEdit_terms(final String edit_terms) { this.edit_terms = edit_terms; } @@ -67,7 +78,7 @@ public void setEdit_terms(String edit_terms) { * @param manage_terms * the manage terms */ - public void setManage_terms(String manage_terms) { + public void setManage_terms(final String manage_terms) { this.manage_terms = manage_terms; } diff --git a/src/net/bican/wordpress/Category.java b/src/net/bican/wordpress/Category.java deleted file mode 100644 index 92572c9..0000000 --- a/src/net/bican/wordpress/Category.java +++ /dev/null @@ -1,128 +0,0 @@ -/* - * - * Wordpress-java - * http://code.google.com/p/wordpress-java/ - * - * Copyright 2012 Can Bican - * See the file 'COPYING' in the distribution for licensing terms. - * - */ -package net.bican.wordpress; - -/** - * - * Category object for a blog. - * - * @author Can Bican <can@bican.net> - * - */ -public class Category extends XmlRpcMapped implements StringHeader { - String categoryId = null; - - String categoryName = null; - - String description = null; - - String htmlUrl = null; - - String parentId = null; - - String rssUrl = null; - - /** - * @return the categoryId - */ - public String getCategoryId() { - return this.categoryId; - } - - /** - * @return the categoryName - */ - public String getCategoryName() { - return this.categoryName; - } - - /** - * @return the description - */ - public String getDescription() { - return this.description; - } - - /** - * @return the htmlUrl - */ - public String getHtmlUrl() { - return this.htmlUrl; - } - - /** - * @return the parentId - */ - public String getParentId() { - return this.parentId; - } - - /** - * @return the rssUrl - */ - public String getRssUrl() { - return this.rssUrl; - } - - /** - * @param categoryId the categoryId to set - */ - public void setCategoryId(String categoryId) { - this.categoryId = categoryId; - } - - /** - * @param categoryName the categoryName to set - */ - public void setCategoryName(String categoryName) { - this.categoryName = categoryName; - } - - /** - * @param description the description to set - */ - public void setDescription(String description) { - this.description = description; - } - - /** - * @param htmlUrl the htmlUrl to set - */ - public void setHtmlUrl(String htmlUrl) { - this.htmlUrl = htmlUrl; - } - - /** - * @param parentId the parentId to set - */ - public void setParentId(String parentId) { - this.parentId = parentId; - } - - /** - * @param rssUrl the rssUrl to set - */ - public void setRssUrl(String rssUrl) { - this.rssUrl = rssUrl; - } - - /** - * (non-Javadoc) - * - * @see net.bican.wordpress.StringHeader#getStringHeader() - */ - @Override - @SuppressWarnings("nls") - public String getStringHeader() { - final String TAB = ":"; - return "Category Id" + TAB + "Category Name" + TAB + "Description" + TAB - + "Html Url" + TAB + "Parent Id" + TAB + "Rss Url"; - } -} diff --git a/src/net/bican/wordpress/Comment.java b/src/net/bican/wordpress/Comment.java index ac4f734..68cac08 100644 --- a/src/net/bican/wordpress/Comment.java +++ b/src/net/bican/wordpress/Comment.java @@ -1,7 +1,11 @@ /* - * Wordpress-java http://code.google.com/p/wordpress-java/ Copyright 2012 Can - * Bican See the file 'COPYING' in the distribution for - * licensing terms. + * + * Wordpress-java + * https://github.com/canbican/wordpress-java/ + * + * Copyright 2012-2015 Can Bican + * See the file 'COPYING' in the distribution for licensing terms. + * */ package net.bican.wordpress; @@ -12,12 +16,15 @@ import java.io.IOException; import java.util.Date; +import net.bican.wordpress.exceptions.InvalidPostFormatException; +import net.bican.wordpress.util.FileParser; +import net.bican.wordpress.util.StringHeader; import redstone.xmlrpc.XmlRpcStruct; /** * A WordPress Comment object * - * @author Fred Potter <fpoptter@gmail.com> + * @author Fred Potter */ public class Comment extends XmlRpcMapped implements StringHeader { @@ -58,7 +65,7 @@ public Date getDate_created_gmt() { * @param dateCreatedGmt * the date_created_gmt to set */ - public void setDate_created_gmt(Date dateCreatedGmt) { + public void setDate_created_gmt(final Date dateCreatedGmt) { this.date_created_gmt = dateCreatedGmt; } @@ -73,7 +80,7 @@ public Integer getUser_id() { * @param userId * the user_id to set */ - public void setUser_id(Integer userId) { + public void setUser_id(final Integer userId) { this.user_id = userId; } @@ -88,7 +95,7 @@ public Integer getComment_id() { * @param commentId * the comment_id to set */ - public void setComment_id(Integer commentId) { + public void setComment_id(final Integer commentId) { this.comment_id = commentId; } @@ -103,7 +110,7 @@ public Integer getParent() { * @param parent * the parent to set */ - public void setParent(Integer parent) { + public void setParent(final Integer parent) { this.parent = parent; } @@ -118,7 +125,7 @@ public String getStatus() { * @param status * the status to set */ - public void setStatus(String status) { + public void setStatus(final String status) { this.status = status; } @@ -133,7 +140,7 @@ public String getContent() { * @param content * the content to set */ - public void setContent(String content) { + public void setContent(final String content) { this.content = content; } @@ -148,7 +155,7 @@ public String getLink() { * @param link * the link to set */ - public void setLink(String link) { + public void setLink(final String link) { this.link = link; } @@ -163,7 +170,7 @@ public Integer getPost_id() { * @param postId * the post_id to set */ - public void setPost_id(Integer postId) { + public void setPost_id(final Integer postId) { this.post_id = postId; } @@ -178,7 +185,7 @@ public String getPost_title() { * @param postTitle * the post_title to set */ - public void setPost_title(String postTitle) { + public void setPost_title(final String postTitle) { this.post_title = postTitle; } @@ -193,7 +200,7 @@ public String getAuthor() { * @param author * the author to set */ - public void setAuthor(String author) { + public void setAuthor(final String author) { this.author = author; } @@ -208,7 +215,7 @@ public String getAuthor_url() { * @param authorUrl * the author_url to set */ - public void setAuthor_url(String authorUrl) { + public void setAuthor_url(final String authorUrl) { this.author_url = authorUrl; } @@ -223,7 +230,7 @@ public String getAuthor_email() { * @param authorEmail * the author_email to set */ - public void setAuthor_email(String authorEmail) { + public void setAuthor_email(final String authorEmail) { this.author_email = authorEmail; } @@ -238,14 +245,14 @@ public String getAuthor_ip() { * @param authorIp * the author_ip to set */ - public void setAuthor_ip(String authorIp) { + public void setAuthor_ip(final String authorIp) { this.author_ip = authorIp; } /** * (non-Javadoc) * - * @see net.bican.wordpress.StringHeader#getStringHeader() + * @see net.bican.wordpress.util.StringHeader#getStringHeader() */ @Override @SuppressWarnings("nls") @@ -270,11 +277,11 @@ public String getStringHeader() { * @throws InvalidPostFormatException * when the file format is invalid */ - public static Comment fromFile(File file) throws FileNotFoundException, + public static Comment fromFile(final File file) throws FileNotFoundException, IOException, InvalidPostFormatException { try (BufferedReader br = new BufferedReader(new FileReader(file))) { - XmlRpcStruct c = FileParser.parseFile(br); - Comment result = new Comment(); + final XmlRpcStruct c = FileParser.parseFile(br); + final Comment result = new Comment(); result.fromXmlRpcStruct(c); return result; } diff --git a/src/net/bican/wordpress/CommentCount.java b/src/net/bican/wordpress/CommentCount.java index fed2c6e..392a131 100644 --- a/src/net/bican/wordpress/CommentCount.java +++ b/src/net/bican/wordpress/CommentCount.java @@ -1,18 +1,20 @@ /* * * Wordpress-java - * http://code.google.com/p/wordpress-java/ + * https://github.com/canbican/wordpress-java/ * - * Copyright 2012 Can Bican + * Copyright 2012-2015 Can Bican * See the file 'COPYING' in the distribution for licensing terms. * */ package net.bican.wordpress; +import net.bican.wordpress.util.StringHeader; + /** * Comment Count object for a blog post. * - * @author Fred Potter <fpoptter@gmail.com> + * @author Fred Potter * */ public class CommentCount extends XmlRpcMapped implements StringHeader { @@ -32,7 +34,7 @@ public Integer getApproved() { /** * @param approved Sets number of approved comments. */ - public void setApproved(Integer approved) { + public void setApproved(final Integer approved) { this.approved = approved; } @@ -46,7 +48,7 @@ public Integer getAwaiting_moderation() { /** * @param awaitingModeration Number of comments awaiting moderation. */ - public void setAwaiting_moderation(Integer awaitingModeration) { + public void setAwaiting_moderation(final Integer awaitingModeration) { this.awaiting_moderation = awaitingModeration; } @@ -60,7 +62,7 @@ public Integer getSpam() { /** * @param spam Number of comments that are spam */ - public void setSpam(Integer spam) { + public void setSpam(final Integer spam) { this.spam = spam; } @@ -74,14 +76,14 @@ public Integer getTotal_comments() { /** * @param totalComments Total number of comments. */ - public void setTotal_comments(Integer totalComments) { + public void setTotal_comments(final Integer totalComments) { this.total_comments = totalComments; } /** * (non-Javadoc) * - * @see net.bican.wordpress.StringHeader#getStringHeader() + * @see net.bican.wordpress.util.StringHeader#getStringHeader() */ @Override @SuppressWarnings("nls") diff --git a/src/net/bican/wordpress/CommentStatusList.java b/src/net/bican/wordpress/CommentStatusList.java index 5eafd20..4758151 100644 --- a/src/net/bican/wordpress/CommentStatusList.java +++ b/src/net/bican/wordpress/CommentStatusList.java @@ -1,19 +1,21 @@ /* * * Wordpress-java - * http://code.google.com/p/wordpress-java/ + * https://github.com/canbican/wordpress-java/ * - * Copyright 2012 Can Bican + * Copyright 2012-2015 Can Bican * See the file 'COPYING' in the distribution for licensing terms. * */ package net.bican.wordpress; +import net.bican.wordpress.util.StringHeader; + /** * * Comment status names for the blog * - * @author Can Bican <can@bican.net> + * @author Can Bican * */ public class CommentStatusList extends XmlRpcMapped implements StringHeader { @@ -47,7 +49,7 @@ public String getSpam() { /** * (non-Javadoc) - * @see net.bican.wordpress.StringHeader#getStringHeader() + * @see net.bican.wordpress.util.StringHeader#getStringHeader() */ @Override @SuppressWarnings("nls") diff --git a/src/net/bican/wordpress/CustomField.java b/src/net/bican/wordpress/CustomField.java index b61d80c..086b7a0 100644 --- a/src/net/bican/wordpress/CustomField.java +++ b/src/net/bican/wordpress/CustomField.java @@ -1,13 +1,20 @@ /* - * Wordpress-java http://code.google.com/p/wordpress-java/ Copyright 2012 Can - * Bican See the file 'COPYING' in the distribution for - * licensing terms. + * + * Wordpress-java + * https://github.com/canbican/wordpress-java/ + * + * Copyright 2012-2015 Can Bican + * See the file 'COPYING' in the distribution for licensing terms. + * */ package net.bican.wordpress; import org.json.JSONException; import org.json.JSONObject; +import net.bican.wordpress.util.JSONConvertable; +import net.bican.wordpress.util.StringHeader; + /** * This class represents custom fields in wordpress. * @@ -24,7 +31,7 @@ public class CustomField extends XmlRpcMapped implements StringHeader, /** * (non-Javadoc) * - * @see net.bican.wordpress.StringHeader#getStringHeader() + * @see net.bican.wordpress.util.StringHeader#getStringHeader() */ @Override @SuppressWarnings("nls") @@ -41,12 +48,12 @@ public String getStringHeader() { @SuppressWarnings("nls") @Override public String toString() { - JSONObject o = new JSONObject(); + final JSONObject o = new JSONObject(); try { o.put("id", this.getId()); o.put("key", this.getKey()); o.put("value", this.getValue()); - } catch (JSONException e) { + } catch (final JSONException e) { // TODO Auto-generated catch block e.printStackTrace(); } @@ -64,7 +71,7 @@ public String getId() { * @param id * id to set */ - public void setId(String id) { + public void setId(final String id) { this.id = id; } @@ -79,7 +86,7 @@ public String getKey() { * @param key * key to set */ - public void setKey(String key) { + public void setKey(final String key) { this.key = key; } @@ -94,31 +101,31 @@ public String getValue() { * @param value * the value to set */ - public void setValue(String value) { + public void setValue(final String value) { this.value = value; } /** * (non-Javadoc) * - * @see net.bican.wordpress.JSONConvertable#fromJSONObject(org.json.JSONObject) + * @see net.bican.wordpress.util.JSONConvertable#fromJSONObject(org.json.JSONObject) */ @Override @SuppressWarnings("nls") - public void fromJSONObject(JSONObject o) { + public void fromJSONObject(final JSONObject o) { try { this.setId(o.getString("id")); - } catch (JSONException e) { + } catch (final JSONException e) { this.setId(null); } try { this.setKey(o.getString("key")); - } catch (JSONException e) { + } catch (final JSONException e) { this.setKey(null); } try { this.setValue(o.getString("value")); - } catch (JSONException e) { + } catch (final JSONException e) { this.setValue(null); } } diff --git a/src/net/bican/wordpress/Enclosure.java b/src/net/bican/wordpress/Enclosure.java new file mode 100644 index 0000000..5ded192 --- /dev/null +++ b/src/net/bican/wordpress/Enclosure.java @@ -0,0 +1,66 @@ +/* + * + * Wordpress-java + * https://github.com/canbican/wordpress-java/ + * + * Copyright 2012-2015 Can Bican + * See the file 'COPYING' in the distribution for licensing terms. + * + */ +package net.bican.wordpress; + +/** + * Enclosure data in a post + * + * @author Can Bican + */ +public class Enclosure extends XmlRpcMapped { + String url; + Integer length; + String type; + + /** + * @return the url + */ + public final String getUrl() { + return this.url; + } + + /** + * @param url + * the url to set + */ + public final void setUrl(final String url) { + this.url = url; + } + + /** + * @return the length + */ + public final Integer getLength() { + return this.length; + } + + /** + * @param length + * the length to set + */ + public final void setLength(final Integer length) { + this.length = length; + } + + /** + * @return the type + */ + public final String getType() { + return this.type; + } + + /** + * @param type + * the type to set + */ + public final void setType(final String type) { + this.type = type; + } +} diff --git a/src/net/bican/wordpress/FilterMediaItem.java b/src/net/bican/wordpress/FilterMediaItem.java new file mode 100644 index 0000000..3fe483f --- /dev/null +++ b/src/net/bican/wordpress/FilterMediaItem.java @@ -0,0 +1,82 @@ +/* + * + * Wordpress-java + * https://github.com/canbican/wordpress-java/ + * + * Copyright 2012-2015 Can Bican + * See the file 'COPYING' in the distribution for licensing terms. + * + */ +package net.bican.wordpress; + +/** + * Class for filtering media library result + * + * @author Can Bican + */ +public class FilterMediaItem extends XmlRpcMapped { + Integer number; + Integer offset; + Integer parent_id; + String mime_type; + + /** + * @return the number + */ + public final Integer getNumber() { + return this.number; + } + + /** + * @param number + * the number to set + */ + public final void setNumber(final Integer number) { + this.number = number; + } + + /** + * @return the offset + */ + public final Integer getOffset() { + return this.offset; + } + + /** + * @param offset + * the offset to set + */ + public final void setOffset(final Integer offset) { + this.offset = offset; + } + + /** + * @return the parent_id + */ + public final Integer getParent_id() { + return this.parent_id; + } + + /** + * @param parent_id + * the parent_id to set + */ + public final void setParent_id(final Integer parent_id) { + this.parent_id = parent_id; + } + + /** + * @return the mime_type + */ + public final String getMime_type() { + return this.mime_type; + } + + /** + * @param mime_type + * the mime_type to set + */ + public final void setMime_type(final String mime_type) { + this.mime_type = mime_type; + } +} diff --git a/src/net/bican/wordpress/FilterPost.java b/src/net/bican/wordpress/FilterPost.java new file mode 100644 index 0000000..44569ea --- /dev/null +++ b/src/net/bican/wordpress/FilterPost.java @@ -0,0 +1,115 @@ +/* + * + * Wordpress-java + * https://github.com/canbican/wordpress-java/ + * + * Copyright 2012-2015 Can Bican + * See the file 'COPYING' in the distribution for licensing terms. + * + */ +package net.bican.wordpress; + +/** + * Filter for retrieving posts + * + * @author Can Bican + * + */ +public class FilterPost extends XmlRpcMapped { + String post_type; + String post_status; + Integer number; + Integer offset; + String orderby; + String order; + + /** + * @return the post_type + */ + public final String getPost_type() { + return this.post_type; + } + + /** + * @param post_type + * the post_type to set + */ + public final void setPost_type(final String post_type) { + this.post_type = post_type; + } + + /** + * @return the post_status + */ + public final String getPost_status() { + return this.post_status; + } + + /** + * @param post_status + * the post_status to set + */ + public final void setPost_status(final String post_status) { + this.post_status = post_status; + } + + /** + * @return the number + */ + public final Integer getNumber() { + return this.number; + } + + /** + * @param number + * the number to set + */ + public final void setNumber(final Integer number) { + this.number = number; + } + + /** + * @return the offset + */ + public final Integer getOffset() { + return this.offset; + } + + /** + * @param offset + * the offset to set + */ + public final void setOffset(final Integer offset) { + this.offset = offset; + } + + /** + * @return the orderby + */ + public final String getOrderby() { + return this.orderby; + } + + /** + * @param orderby + * the orderby to set + */ + public final void setOrderby(final String orderby) { + this.orderby = orderby; + } + + /** + * @return the order + */ + public final String getOrder() { + return this.order; + } + + /** + * @param order + * the order to set + */ + public final void setOrder(final String order) { + this.order = order; + } +} diff --git a/src/net/bican/wordpress/FilterUser.java b/src/net/bican/wordpress/FilterUser.java new file mode 100644 index 0000000..72d3a66 --- /dev/null +++ b/src/net/bican/wordpress/FilterUser.java @@ -0,0 +1,143 @@ +/* + * + * Wordpress-java + * https://github.com/canbican/wordpress-java/ + * + * Copyright 2012-2015 Can Bican + * See the file 'COPYING' in the distribution for licensing terms. + * + */ +package net.bican.wordpress; + +import redstone.xmlrpc.XmlRpcStruct; + +/** + * Used for filtering users in getUsers() + * + * @author Can Bican + */ +public class FilterUser { + String role; + String who; + Integer number; + Integer offset; + String orderby; + String order; + + /** + * @return the role + */ + public final String getRole() { + return this.role; + } + + /** + * @param role + * the role to set + */ + public final void setRole(final String role) { + this.role = role; + } + + /** + * @return the who + */ + public final String getWho() { + return this.who; + } + + /** + * @param who + * the who to set + */ + public final void setWho(final String who) { + this.who = who; + } + + /** + * @return the number + */ + public final Integer getNumber() { + return this.number; + } + + /** + * @param number + * the number to set + */ + public final void setNumber(final Integer number) { + this.number = number; + } + + /** + * @return the offset + */ + public final Integer getOffset() { + return this.offset; + } + + /** + * @param offset + * the offset to set + */ + public final void setOffset(final Integer offset) { + this.offset = offset; + } + + /** + * @return the orderby + */ + public final String getOrderby() { + return this.orderby; + } + + /** + * @param orderby + * the orderby to set + */ + public final void setOrderby(final String orderby) { + this.orderby = orderby; + } + + /** + * @return the order + */ + public final String getOrder() { + return this.order; + } + + /** + * @param order + * the order to set + */ + public final void setOrder(final String order) { + this.order = order; + } + + /** + * @return only with non-null values + */ + @SuppressWarnings("unchecked") + public XmlRpcStruct buildWithNonNullValues() { + final XmlRpcStruct r = new XmlRpcStruct(); + if (this.role != null) { + r.put("role", this.role); //$NON-NLS-1$ + } + if (this.who != null) { + r.put("who", this.who); //$NON-NLS-1$ + } + if (this.number != null) { + r.put("number", this.number); //$NON-NLS-1$ + } + if (this.offset != null) { + r.put("offset", this.offset); //$NON-NLS-1$ + } + if (this.orderby != null) { + r.put("orderby", this.orderby); //$NON-NLS-1$ + } + if (this.order != null) { + r.put("order", this.order); //$NON-NLS-1$ + } + return r; + } +} diff --git a/src/net/bican/wordpress/Labels.java b/src/net/bican/wordpress/Labels.java index f167299..0f08689 100644 --- a/src/net/bican/wordpress/Labels.java +++ b/src/net/bican/wordpress/Labels.java @@ -1,9 +1,20 @@ +/* + * + * Wordpress-java + * https://github.com/canbican/wordpress-java/ + * + * Copyright 2012-2015 Can Bican + * See the file 'COPYING' in the distribution for licensing terms. + * + */ package net.bican.wordpress; +import net.bican.wordpress.util.StringHeader; + /** * Labels object for blog. * - * @author Can Bican <can@bican.net> + * @author Can Bican */ public class Labels extends XmlRpcMapped implements StringHeader { String name; @@ -144,7 +155,7 @@ public String getView_item() { * @param add_new_item * add new item text to set */ - public void setAdd_new_item(String add_new_item) { + public void setAdd_new_item(final String add_new_item) { this.add_new_item = add_new_item; } @@ -152,7 +163,7 @@ public void setAdd_new_item(String add_new_item) { * @param add_or_remove_items * add or remove items text to set */ - public void setAdd_or_remove_items(String add_or_remove_items) { + public void setAdd_or_remove_items(final String add_or_remove_items) { this.add_or_remove_items = add_or_remove_items; } @@ -160,7 +171,7 @@ public void setAdd_or_remove_items(String add_or_remove_items) { * @param all_items * all items text to set */ - public void setAll_items(String all_items) { + public void setAll_items(final String all_items) { this.all_items = all_items; } @@ -168,7 +179,7 @@ public void setAll_items(String all_items) { * @param choose_from_most_used * choose from most used text to set */ - public void setChoose_from_most_used(String choose_from_most_used) { + public void setChoose_from_most_used(final String choose_from_most_used) { this.choose_from_most_used = choose_from_most_used; } @@ -176,7 +187,7 @@ public void setChoose_from_most_used(String choose_from_most_used) { * @param edit_item * edit item text to set */ - public void setEdit_item(String edit_item) { + public void setEdit_item(final String edit_item) { this.edit_item = edit_item; } @@ -184,7 +195,7 @@ public void setEdit_item(String edit_item) { * @param name * name to set */ - public void setName(String name) { + public void setName(final String name) { this.name = name; } @@ -192,7 +203,7 @@ public void setName(String name) { * @param new_item_name * new item name text to set */ - public void setNew_item_name(String new_item_name) { + public void setNew_item_name(final String new_item_name) { this.new_item_name = new_item_name; } @@ -200,7 +211,7 @@ public void setNew_item_name(String new_item_name) { * @param not_found * not found text to set */ - public void setNot_found(String not_found) { + public void setNot_found(final String not_found) { this.not_found = not_found; } @@ -208,7 +219,7 @@ public void setNot_found(String not_found) { * @param parent_item * parent item text to set */ - public void setParent_item(String parent_item) { + public void setParent_item(final String parent_item) { this.parent_item = parent_item; } @@ -216,7 +227,7 @@ public void setParent_item(String parent_item) { * @param parent_item_colon * parent item colon text to set */ - public void setParent_item_colon(String parent_item_colon) { + public void setParent_item_colon(final String parent_item_colon) { this.parent_item_colon = parent_item_colon; } @@ -224,7 +235,7 @@ public void setParent_item_colon(String parent_item_colon) { * @param popular_items * popular items text to set */ - public void setPopular_items(String popular_items) { + public void setPopular_items(final String popular_items) { this.popular_items = popular_items; } @@ -232,7 +243,7 @@ public void setPopular_items(String popular_items) { * @param search_items * search items text to set */ - public void setSearch_items(String search_items) { + public void setSearch_items(final String search_items) { this.search_items = search_items; } @@ -240,7 +251,7 @@ public void setSearch_items(String search_items) { * @param separate_items_with_commas * separate items with commas text to set */ - public void setSeparate_items_with_commas(String separate_items_with_commas) { + public void setSeparate_items_with_commas(final String separate_items_with_commas) { this.separate_items_with_commas = separate_items_with_commas; } @@ -248,7 +259,7 @@ public void setSeparate_items_with_commas(String separate_items_with_commas) { * @param singular_name * singular name to set */ - public void setSingular_name(String singular_name) { + public void setSingular_name(final String singular_name) { this.singular_name = singular_name; } @@ -256,7 +267,7 @@ public void setSingular_name(String singular_name) { * @param update_item * update item text to set */ - public void setUpdate_item(String update_item) { + public void setUpdate_item(final String update_item) { this.update_item = update_item; } @@ -264,7 +275,7 @@ public void setUpdate_item(String update_item) { * @param view_item * view item text to set */ - public void setView_item(String view_item) { + public void setView_item(final String view_item) { this.view_item = view_item; } } diff --git a/src/net/bican/wordpress/Main.java b/src/net/bican/wordpress/Main.java index 885a43b..481be4e 100644 --- a/src/net/bican/wordpress/Main.java +++ b/src/net/bican/wordpress/Main.java @@ -1,23 +1,29 @@ /* * * Wordpress-java - * http://code.google.com/p/wordpress-java/ + * https://github.com/canbican/wordpress-java/ * - * Copyright 2012 Can Bican + * Copyright 2012-2015 Can Bican * See the file 'COPYING' in the distribution for licensing terms. * */ package net.bican.wordpress; import java.io.File; +import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.net.MalformedURLException; import java.util.List; - -import javax.activation.MimetypesFileTypeMap; +import java.util.Map; import net.bican.wordpress.configuration.WpCliConfiguration; +import net.bican.wordpress.exceptions.FileUploadException; +import net.bican.wordpress.exceptions.InsufficientRightsException; +import net.bican.wordpress.exceptions.InvalidArgumentsException; +import net.bican.wordpress.exceptions.InvalidPostFormatException; +import net.bican.wordpress.exceptions.ObjectNotFoundException; +import net.bican.wordpress.util.StringHeader; import org.apache.commons.cli.HelpFormatter; import org.apache.commons.cli.Options; @@ -26,11 +32,9 @@ import redstone.xmlrpc.XmlRpcFault; /** - * * Main Application class for the command line interface. * - * @author Can Bican <can@bican.net> - * + * @author Can Bican */ public class Main { /** @@ -38,11 +42,21 @@ public class Main { * execute with "-?" for an explanation of args * @throws ParseException * When the command line options cannot be parsed + * @throws InvalidArgumentsException + * thrown from a wordpress call + * @throws InsufficientRightsException + * thrown from a wordpress call + * @throws ObjectNotFoundException + * thrown from a wordpress call + * @throws FileUploadException + * thrown from a wordpress call */ @SuppressWarnings({ "nls", "boxing" }) - public static void main(String[] args) throws ParseException { + public static void main(final String[] args) + throws ParseException, InsufficientRightsException, + InvalidArgumentsException, ObjectNotFoundException, FileUploadException { try { - Options options = new Options(); + final Options options = new Options(); options.addOption("?", "help", false, "Print usage information"); options.addOption("h", "url", true, "Specify the url to xmlrpc.php"); options.addOption("u", "user", true, "User name"); @@ -50,42 +64,24 @@ public static void main(String[] args) throws ParseException { options.addOption("a", "authors", false, "Get author list"); options.addOption("s", "slug", true, "Slug for categories"); options.addOption("pi", "parentid", true, "Parent id for categories"); - options.addOption("oi", "postid", true, "Post id for pages and posts"); + options.addOption("oi", "postid", true, "Post id for posts"); options.addOption("c", "categories", false, "Get category list"); options.addOption("cn", "newcategory", true, "New category (uses --slug and --parentid)"); options.addOption("cr", "deletecategory", true, "Delete category "); - options.addOption("pg", "pages", false, "Get page list (full)"); - options.addOption("pl", "pagelist", false, "Get page list"); - options.addOption("ps", "page", true, "Get page"); - options.addOption("pn", "newpage", true, - "New page from file (needs --publish)"); - options.addOption("pe", "editpage", true, - "Edit page (needs --postid and --publish"); - options.addOption("pd", "deletepage", true, - "Delete page (needs --publish)"); - options.addOption("l", "publish", true, - "Publish status for \"new\" options"); options.addOption("us", "userinfo", false, "Get user information"); options.addOption("or", "recentposts", true, "Get recent posts"); options.addOption("os", "getpost", true, "Get post"); - options.addOption("on", "newpost", true, - "New post from file (needs --publish)"); - options.addOption("oe", "editpost", true, - "Edit post (needs --postid and --publish"); - options.addOption("od", "deletepost", true, - "Delete post (needs --publish)"); - options.addOption("sm", "supportedmethods", false, - "List supported methods"); - options.addOption("st", "supportedfilters", false, - "List supported text filters"); + options.addOption("on", "newpost", true, "New post from file "); + options.addOption("oe", "editpost", true, "Edit post (needs --postid)"); + options.addOption("od", "deletepost", true, "Delete post"); options.addOption("mn", "newmedia", true, "New media file (uses --overwrite)"); options.addOption("ov", "overwrite", false, "Allow overwrite in uploading new media"); options.addOption("so", "supportedstatus", false, - "Print supported page and post status values"); + "Print supported post status values"); options.addOption("cs", "commentstatus", false, "Print comment status names for the blog"); options.addOption("cc", "commentcount", true, @@ -102,125 +98,111 @@ public static void main(String[] args) throws ParseException { options.addOption("cm", "commentnumber", true, "Comment # (for --getcomments)"); try { - WpCliConfiguration config = new WpCliConfiguration(args, options, + final WpCliConfiguration config = new WpCliConfiguration(args, options, Main.class); if (config.hasOption("help")) { showHelp(options); - } else if ((!config.hasOption("url")) || (!config.hasOption("user")) - || (!config.hasOption("pass"))) { + } else if (!config.hasOption("url") || !config.hasOption("user") + || !config.hasOption("pass")) { System.err.println("Specify --user, --pass and --url"); } else { try { - Wordpress wp = new Wordpress(config.getOptionValue("user"), + final Wordpress wp = new Wordpress(config.getOptionValue("user"), config.getOptionValue("pass"), config.getOptionValue("url")); if (config.hasOption("authors")) { printList(wp.getAuthors(), Author.class, true); } else if (config.hasOption("categories")) { - printList(wp.getCategories(), Category.class, true); + printList(wp.getTerms("category"), Term.class, true); } else if (config.hasOption("deletecategory")) { - Integer category_id = Integer.valueOf(config - .getOptionValue("deletecategory")); - int r = wp.deleteCategory(category_id); + final Integer category_id = Integer + .valueOf(config.getOptionValue("deletecategory")); + final boolean r = wp.deleteTerm("category", category_id); System.out.println(r); } else if (config.hasOption("newcategory")) { String slug = config.getOptionValue("slug"); Integer parentId = getInteger("parentid", config); - if (slug == null) + if (slug == null) { slug = ""; - if (parentId == null) + } + if (parentId == null) { parentId = 0; - System.out.println(wp.newCategory( - config.getOptionValue("newcategory"), slug, parentId)); - } else if (config.hasOption("pages")) { - printList(wp.getPages(), Page.class, false); - } else if (config.hasOption("pagelist")) { - printList(wp.getPageList(), PageDefinition.class, false); - } else if (config.hasOption("page")) { - printItem(wp.getPage(getInteger("page", config)), Page.class); + } + final Term term = new Term(); + term.setSlug(slug); + term.setParent(parentId); + term.setName(config.getOptionValue("newcategory")); + System.out.println(wp.newTerm(term)); } else if (config.hasOption("userinfo")) { - printItem(wp.getUserInfo(), User.class); + final FilterUser filter = new FilterUser(); + filter.setWho(config.getOptionValue("user")); + printItem(wp.getUsers(filter).get(0), User.class); } else if (config.hasOption("recentposts")) { - printList(wp.getRecentPosts(getInteger("recentposts", config)), - Page.class, false); + final FilterPost filter = new FilterPost(); + filter.setNumber(getInteger("recentposts", config)); + printList(wp.getPosts(filter), Post.class, false); } else if (config.hasOption("getpost")) { - printItem(wp.getPost(getInteger("getpost", config)), Page.class); - } else if (config.hasOption("supportedmethods")) { - printList(wp.supportedMethods(), String.class, false); - } else if (config.hasOption("supportedfilters")) { - printList(wp.supportedTextFilters(), String.class, false); - } else if (config.hasOption("newpage")) { - if (!config.hasOption("publish")) { - showHelp(options); - } else { - System.out.println(wp.newPage( - Page.fromFile(new File(config.getOptionValue("newpage"))), - config.getOptionValue("publish"))); - } - } else if (config.hasOption("editpage")) { - edit(options, config, wp, "editpage", true); + printItem(wp.getPost(getInteger("getpost", config)), Post.class); } else if (config.hasOption("editpost")) { edit(options, config, wp, "editpost", false); - } else if (config.hasOption("deletepage")) { - delete(options, config, wp, "deletepage", true); } else if (config.hasOption("deletepost")) { delete(options, config, wp, "deletepost", false); } else if (config.hasOption("newpost")) { - if (!config.hasOption("publish")) { - showHelp(options); - } else { - System.out.println(wp.newPost( - Page.fromFile(new File(config.getOptionValue("newpost"))), - Boolean.valueOf(config.getOptionValue("publish")))); - } + System.out.println(wp.newPost( + Post.fromFile(new File(config.getOptionValue("newpost"))))); } else if (config.hasOption("newmedia")) { - String fileName = config.getOptionValue("newmedia"); - File file = new File(fileName); - String mimeType = new MimetypesFileTypeMap().getContentType(file); + final String fileName = config.getOptionValue("newmedia"); + final File file = new File(fileName); Boolean overwrite = Boolean.FALSE; - if (config.hasOption("overwrite")) + if (config.hasOption("overwrite")) { overwrite = Boolean.TRUE; - MediaObject result = wp.newMediaObject(mimeType, file, overwrite); - if (result != null) { - System.out.println(result); + } + try (FileInputStream fis = new FileInputStream(file)) { + final MediaItemUploadResult result = wp.uploadFile(fis, fileName, + overwrite); + if (result != null) { + System.out.println(result); + } } } else if (config.hasOption("supportedstatus")) { System.out.println("Recognized status values for posts:"); - printList(wp.getPostStatusList(), PostAndPageStatus.class, true); - System.out.println("\nRecognized status values for pages:"); - printList(wp.getPageStatusList(), PostAndPageStatus.class, true); + final Map psl = wp.getPostStatusList(); + for (final String k : psl.keySet()) { + System.out.println(k + " : " + psl.get(k)); + } } else if (config.hasOption("commentstatus")) { showCommentStatus(wp); } else if (config.hasOption("commentcount")) { showCommentCount(config, wp); } else if (config.hasOption("newcomment")) { - editComment(wp, config.getOptionValue("newcomment"), "newcomment"); + editComment(wp, config.getOptionValue("newcomment"), + "newcomment"); } else if (config.hasOption("editcomment")) { editComment(wp, config.getOptionValue("editcomment"), "editcomment"); } else if (config.hasOption("deletecomment")) { - System.err.println(Integer.valueOf(config - .getOptionValue("deletecomment"))); + System.err.println( + Integer.valueOf(config.getOptionValue("deletecomment"))); deleteComment(wp, Integer.valueOf(config.getOptionValue("deletecomment"))); } else if (config.hasOption("getcomment")) { printComment(wp, Integer.valueOf(config.getOptionValue("getcomment"))); } else if (config.hasOption("getcomments")) { - Integer postID = Integer.valueOf(config - .getOptionValue("getcomments")); - String commentStatus = config.getOptionValue("commentstatus"); + final Integer postID = Integer + .valueOf(config.getOptionValue("getcomments")); + final String commentStatus = config.getOptionValue("commentstatus"); Integer commentOffset; try { - commentOffset = Integer.valueOf(config - .getOptionValue("commentoffset")); - } catch (NumberFormatException e) { + commentOffset = Integer + .valueOf(config.getOptionValue("commentoffset")); + } catch (final NumberFormatException e) { commentOffset = null; } Integer commentNumber; try { - commentNumber = Integer.valueOf(config - .getOptionValue("commentnumber")); - } catch (Exception e) { + commentNumber = Integer + .valueOf(config.getOptionValue("commentnumber")); + } catch (final Exception e) { commentNumber = null; } printComments(wp, postID, commentStatus, commentOffset, @@ -228,156 +210,149 @@ public static void main(String[] args) throws ParseException { } else { showHelp(options); } - } catch (MalformedURLException e) { + } catch (final MalformedURLException e) { System.err.println("URL \"" + config.getOptionValue("url") + "\" is invalid, reason is: " + e.getLocalizedMessage()); - } catch (IOException e) { - System.err.println("Can't read from file, reason is: " - + e.getLocalizedMessage()); - } catch (InvalidPostFormatException e) { + } catch (final IOException e) { + System.err.println( + "Can't read from file, reason is: " + e.getLocalizedMessage()); + } catch (final InvalidPostFormatException e) { System.err.println("Input format is invalid."); } } - } catch (ParseException e) { + } catch (final ParseException e) { System.err.println("Can't process command line arguments, reason is: " + e.getLocalizedMessage()); } - } catch (XmlRpcFault e) { - String reason = e.getLocalizedMessage(); + } catch (final XmlRpcFault e) { + final String reason = e.getLocalizedMessage(); System.err.println("Operation failed, reason is: " + reason); } } - + @SuppressWarnings("nls") - private static void printComments(Wordpress wp, Integer postID, - String commentStatus, Integer commentOffset, Integer commentNumber) - throws XmlRpcFault { - List r = wp.getComments(commentStatus, postID, commentNumber, + private static void printComments(final Wordpress wp, final Integer postID, + final String commentStatus, final Integer commentOffset, final Integer commentNumber) + throws XmlRpcFault, InsufficientRightsException { + final List r = wp.getComments(commentStatus, postID, commentNumber, commentOffset); - for (Comment comment : r) { + for (final Comment comment : r) { System.out.println("--- BEGIN COMMENT"); System.out.println(comment); System.out.println("--- END COMMENT"); } } - - private static void printComment(Wordpress wp, Integer commentID) - throws XmlRpcFault { - Comment r = wp.getComment(commentID); + + private static void printComment(final Wordpress wp, final Integer commentID) + throws XmlRpcFault, InsufficientRightsException, ObjectNotFoundException { + final Comment r = wp.getComment(commentID); System.out.println(r); } - + @SuppressWarnings("nls") - private static void deleteComment(Wordpress wp, int commentID) - throws XmlRpcFault { - boolean result = wp.deleteComment(commentID); - if (result) + private static void deleteComment(final Wordpress wp, final int commentID) + throws XmlRpcFault, InsufficientRightsException, ObjectNotFoundException { + final boolean result = wp.deleteComment(Integer.valueOf(commentID)); + if (result) { System.out.println("Comment deleted."); - else + } else { System.out.println("Comment not deleted"); + } } - + @SuppressWarnings({ "nls", "boxing" }) - private static void editComment(Wordpress wp, String fileName, - String operation) throws XmlRpcFault, FileNotFoundException, IOException, - InvalidPostFormatException { - Comment comment = Comment.fromFile(new File(fileName)); + private static void editComment(final Wordpress wp, final String fileName, + final String operation) throws XmlRpcFault, FileNotFoundException, IOException, + InvalidPostFormatException, InsufficientRightsException, + ObjectNotFoundException, InvalidArgumentsException { + final Comment comment = Comment.fromFile(new File(fileName)); System.err.println(comment.getPost_id()); System.err.println(comment.getContent()); if (operation.equals("newcomment")) { - Integer r = wp.newComment(comment.getPost_id(), comment.getParent(), + final Integer r = wp.newComment(comment.getPost_id(), comment.getParent(), comment.getContent(), comment.getAuthor(), comment.getAuthor_url(), comment.getAuthor_email()); System.err.println("Comment ID: " + r); } else if (operation.equals("editcomment")) { - Boolean r = wp.editComment(comment); - if (r) + final Boolean r = wp.editComment(comment); + if (r) { System.err.println("Comment edited."); - else + } else { System.err.println("Comment not edited."); + } } } - + @SuppressWarnings("nls") - private static void showCommentCount(WpCliConfiguration config, Wordpress wp) { - Integer post_ID = getInteger("commentcount", config); + private static void showCommentCount(final WpCliConfiguration config, final Wordpress wp) + throws InsufficientRightsException { + final Integer post_ID = getInteger("commentcount", config); try { - CommentCount result = wp.getCommentsCount(post_ID); + final CommentCount result = wp.getCommentsCount(post_ID); System.out.println(result); - } catch (XmlRpcFault e) { - String reason = e.getLocalizedMessage(); + } catch (final XmlRpcFault e) { + final String reason = e.getLocalizedMessage(); System.err.println("Operation failed, reason is: " + reason); } } - - private static void showCommentStatus(Wordpress wp) { + + private static void showCommentStatus(final Wordpress wp) throws XmlRpcFault { printItem(wp.getCommentStatusList(), CommentStatusList.class); } - - @SuppressWarnings({ "nls", "boxing" }) - private static void delete(Options options, WpCliConfiguration config, - Wordpress wp, String opt, boolean deletePage) throws XmlRpcFault { - Integer post_ID = getInteger(opt, config); - String publish = config.getOptionValue("publish"); - if ((publish != null) && (post_ID != null)) { - if (deletePage) { - System.out.println(wp.deletePage(post_ID, publish)); - } else { - System.out.println(wp.deletePost(post_ID, publish)); - } + + private static void delete(final Options options, final WpCliConfiguration config, + final Wordpress wp, final String opt, final boolean deletePage) throws XmlRpcFault, + InsufficientRightsException, ObjectNotFoundException { + final Integer post_ID = getInteger(opt, config); + if (post_ID != null) { + System.out.println(wp.deletePost(post_ID)); } else { showHelp(options); } } - - @SuppressWarnings({ "nls", "boxing" }) - private static void edit(Options options, WpCliConfiguration config, - Wordpress wp, String opt, boolean isPage) throws IOException, - InvalidPostFormatException, XmlRpcFault { - Integer post_ID = getInteger("postid", config); - String publish = config.getOptionValue("publish"); - Page page = Page.fromFile(new File(config.getOptionValue(opt))); - if ((publish != null) && (post_ID != null)) { - Boolean result = false; - if (isPage) { - result = wp.editPage(post_ID, page, publish); - } else { - result = wp.editPost(post_ID, page, publish); - } - System.out.println(result); + + @SuppressWarnings({ "nls" }) + private static void edit(final Options options, final WpCliConfiguration config, + final Wordpress wp, final String opt, final boolean isPage) throws IOException, + InvalidPostFormatException, XmlRpcFault, InsufficientRightsException, + InvalidArgumentsException, ObjectNotFoundException { + final Integer post_ID = getInteger("postid", config); + final Post post = Post.fromFile(new File(config.getOptionValue(opt))); + if (post_ID != null) { + System.out.println(wp.editPost(post_ID, post)); } else { showHelp(options); } } - - private static Integer getInteger(String c, WpCliConfiguration config) { + + private static Integer getInteger(final String c, final WpCliConfiguration config) { Integer post_ID = null; try { post_ID = Integer.valueOf(config.getOptionValue(c)); - } catch (NumberFormatException e) { + } catch (final NumberFormatException e) { // leave it null } return post_ID; } - + @SuppressWarnings("nls") - private static void showHelp(Options options) { - HelpFormatter help = new HelpFormatter(); + private static void showHelp(final Options options) { + final HelpFormatter help = new HelpFormatter(); help.printHelp(" ", options); } - - private static void printItem(Object o, Class cl) { + + private static void printItem(final Object o, final Class cl) { cl.cast(o); System.out.println(((StringHeader) o).getStringHeader()); System.out.println(o); } - - private static void printList(List r, Class cl, boolean oneLiner) { + + private static void printList(final List r, final Class cl, final boolean oneLiner) { boolean headerPrinted = false; - for (Object o : r) { + for (final Object o : r) { cl.cast(o); if (!headerPrinted) { - if ((!(o instanceof String)) && (oneLiner)) { + if (!(o instanceof String) && oneLiner) { System.out.println(((StringHeader) o).getStringHeader()); } headerPrinted = true; diff --git a/src/net/bican/wordpress/MediaItem.java b/src/net/bican/wordpress/MediaItem.java new file mode 100644 index 0000000..b512c2d --- /dev/null +++ b/src/net/bican/wordpress/MediaItem.java @@ -0,0 +1,164 @@ +/* + * + * Wordpress-java + * https://github.com/canbican/wordpress-java/ + * + * Copyright 2012-2015 Can Bican + * See the file 'COPYING' in the distribution for licensing terms. + * + */ +package net.bican.wordpress; + +import java.util.Date; + +/** + * Class for an media item object for a blog + * + * @author Can Bican + */ +public class MediaItem extends XmlRpcMapped { + Integer attachment_id; + Date date_created_gmt; + Integer parent; + String link; + String title; + String caption; + String description; + MediaItemMetadata metadata; + String thumbnail; + + /** + * @return the attachment_id + */ + public final Integer getAttachment_id() { + return this.attachment_id; + } + + /** + * @param attachment_id + * the attachment_id to set + */ + public final void setAttachment_id(final Integer attachment_id) { + this.attachment_id = attachment_id; + } + + /** + * @return the date_created_gmt + */ + public final Date getDate_created_gmt() { + return this.date_created_gmt; + } + + /** + * @param date_created_gmt + * the date_created_gmt to set + */ + public final void setDate_created_gmt(final Date date_created_gmt) { + this.date_created_gmt = date_created_gmt; + } + + /** + * @return the parent + */ + public final Integer getParent() { + return this.parent; + } + + /** + * @param parent + * the parent to set + */ + public final void setParent(final Integer parent) { + this.parent = parent; + } + + /** + * @return the link + */ + public final String getLink() { + return this.link; + } + + /** + * @param link + * the link to set + */ + public final void setLink(final String link) { + this.link = link; + } + + /** + * @return the title + */ + public final String getTitle() { + return this.title; + } + + /** + * @param title + * the title to set + */ + public final void setTitle(final String title) { + this.title = title; + } + + /** + * @return the caption + */ + public final String getCaption() { + return this.caption; + } + + /** + * @param caption + * the caption to set + */ + public final void setCaption(final String caption) { + this.caption = caption; + } + + /** + * @return the description + */ + public final String getDescription() { + return this.description; + } + + /** + * @param description + * the description to set + */ + public final void setDescription(final String description) { + this.description = description; + } + + /** + * @return the metadata + */ + public final MediaItemMetadata getMetadata() { + return this.metadata; + } + + /** + * @param metadata + * the metadata to set + */ + public final void setMetadata(final MediaItemMetadata metadata) { + this.metadata = metadata; + } + + /** + * @return the thumbnail + */ + public final String getThumbnail() { + return this.thumbnail; + } + + /** + * @param thumbnail + * the thumbnail to set + */ + public final void setThumbnail(final String thumbnail) { + this.thumbnail = thumbnail; + } +} diff --git a/src/net/bican/wordpress/MediaItemMetadata.java b/src/net/bican/wordpress/MediaItemMetadata.java new file mode 100644 index 0000000..2f6d323 --- /dev/null +++ b/src/net/bican/wordpress/MediaItemMetadata.java @@ -0,0 +1,98 @@ +/* + * + * Wordpress-java + * https://github.com/canbican/wordpress-java/ + * + * Copyright 2012-2015 Can Bican + * See the file 'COPYING' in the distribution for licensing terms. + * + */ +package net.bican.wordpress; + +/** + * Meta data of a media object in a MediaItem class + * + * @author Can Bican + */ +public class MediaItemMetadata extends XmlRpcMapped { + Integer width; + Integer height; + String file; + MediaItemSizes sizes; + PostThumbnailImageMeta image_meta; + + /** + * @return the width + */ + public final Integer getWidth() { + return this.width; + } + + /** + * @param width + * the width to set + */ + public final void setWidth(final Integer width) { + this.width = width; + } + + /** + * @return the height + */ + public final Integer getHeight() { + return this.height; + } + + /** + * @param height + * the height to set + */ + public final void setHeight(final Integer height) { + this.height = height; + } + + /** + * @return the file + */ + public final String getFile() { + return this.file; + } + + /** + * @param file + * the file to set + */ + public final void setFile(final String file) { + this.file = file; + } + + /** + * @return the sizes + */ + public final MediaItemSizes getSizes() { + return this.sizes; + } + + /** + * @param sizes + * the sizes to set + */ + public final void setSizes(final MediaItemSizes sizes) { + this.sizes = sizes; + } + + /** + * @return the image_meta + */ + public final PostThumbnailImageMeta getImage_meta() { + return this.image_meta; + } + + /** + * @param image_meta + * the image_meta to set + */ + public final void setImage_meta(final PostThumbnailImageMeta image_meta) { + this.image_meta = image_meta; + } +} diff --git a/src/net/bican/wordpress/MediaItemSize.java b/src/net/bican/wordpress/MediaItemSize.java new file mode 100644 index 0000000..d636dc7 --- /dev/null +++ b/src/net/bican/wordpress/MediaItemSize.java @@ -0,0 +1,99 @@ +/* + * + * Wordpress-java + * https://github.com/canbican/wordpress-java/ + * + * Copyright 2012-2015 Can Bican + * See the file 'COPYING' in the distribution for licensing terms. + * + */ +package net.bican.wordpress; + +import redstone.xmlrpc.XmlRpcStruct; + +/** + * Class that holds media item info for different media items + * + * @author Can Bican + */ +public class MediaItemSize extends XmlRpcMapped { + private static final String MIME_TYPE_FIELD = "mime-type"; //$NON-NLS-1$ + String file; + Integer width; + Integer height; + String mimeType; + + @Override + public void fromXmlRpcStruct(final XmlRpcStruct x) { + super.fromXmlRpcStruct(x); + this.setMimeType((String) x.get(MIME_TYPE_FIELD)); + } + + @SuppressWarnings("unchecked") + @Override + public XmlRpcStruct toXmlRpcStruct() { + final XmlRpcStruct result = super.toXmlRpcStruct(); + result.put(MIME_TYPE_FIELD, this.getMimeType()); + return result; + } + + /** + * @return the file + */ + public final String getFile() { + return this.file; + } + + /** + * @param file + * the file to set + */ + public final void setFile(final String file) { + this.file = file; + } + + /** + * @return the width + */ + public final Integer getWidth() { + return this.width; + } + + /** + * @param width + * the width to set + */ + public final void setWidth(final Integer width) { + this.width = width; + } + + /** + * @return the height + */ + public final Integer getHeight() { + return this.height; + } + + /** + * @param height + * the height to set + */ + public final void setHeight(final Integer height) { + this.height = height; + } + + /** + * @return the mimeType + */ + public final String getMimeType() { + return this.mimeType; + } + + /** + * @param mimeType + * the mimeType to set + */ + public final void setMimeType(final String mimeType) { + this.mimeType = mimeType; + } +} diff --git a/src/net/bican/wordpress/MediaItemSizes.java b/src/net/bican/wordpress/MediaItemSizes.java new file mode 100644 index 0000000..0e941e9 --- /dev/null +++ b/src/net/bican/wordpress/MediaItemSizes.java @@ -0,0 +1,82 @@ +/* + * + * Wordpress-java + * https://github.com/canbican/wordpress-java/ + * + * Copyright 2012-2015 Can Bican + * See the file 'COPYING' in the distribution for licensing terms. + * + */ +package net.bican.wordpress; + +/** + * Class that keeps info for different sizes of a media item + * + * @author Can Bican + */ +public class MediaItemSizes extends XmlRpcMapped { + MediaItemSize thumbnail; + MediaItemSize post_thumbnail; + MediaItemSize medium; + MediaItemSize large; + + /** + * @return the thumbnail + */ + public final MediaItemSize getThumbnail() { + return this.thumbnail; + } + + /** + * @param thumbnail + * the thumbnail to set + */ + public final void setThumbnail(final MediaItemSize thumbnail) { + this.thumbnail = thumbnail; + } + + /** + * @return the post_thumbnail + */ + public final MediaItemSize getPost_thumbnail() { + return this.post_thumbnail; + } + + /** + * @param post_thumbnail + * the post_thumbnail to set + */ + public final void setPost_thumbnail(final MediaItemSize post_thumbnail) { + this.post_thumbnail = post_thumbnail; + } + + /** + * @return the medium + */ + public final MediaItemSize getMedium() { + return this.medium; + } + + /** + * @param medium + * the medium to set + */ + public final void setMedium(final MediaItemSize medium) { + this.medium = medium; + } + + /** + * @return the large + */ + public final MediaItemSize getLarge() { + return this.large; + } + + /** + * @param large + * the large to set + */ + public final void setLarge(final MediaItemSize large) { + this.large = large; + } +} diff --git a/src/net/bican/wordpress/MediaItemUploadResult.java b/src/net/bican/wordpress/MediaItemUploadResult.java new file mode 100644 index 0000000..933a85f --- /dev/null +++ b/src/net/bican/wordpress/MediaItemUploadResult.java @@ -0,0 +1,82 @@ +/* + * + * Wordpress-java + * https://github.com/canbican/wordpress-java/ + * + * Copyright 2012-2015 Can Bican + * See the file 'COPYING' in the distribution for licensing terms. + * + */ +package net.bican.wordpress; + +/** + * Represents the result of an uploadFile() + * + * @author Can Bican + */ +public class MediaItemUploadResult extends XmlRpcMapped { + Integer id; + String file; + String url; + String type; + + /** + * @return the id + */ + public final Integer getId() { + return this.id; + } + + /** + * @param id + * the id to set + */ + public final void setId(final Integer id) { + this.id = id; + } + + /** + * @return the file + */ + public final String getFile() { + return this.file; + } + + /** + * @param file + * the file to set + */ + public final void setFile(final String file) { + this.file = file; + } + + /** + * @return the url + */ + public final String getUrl() { + return this.url; + } + + /** + * @param url + * the url to set + */ + public final void setUrl(final String url) { + this.url = url; + } + + /** + * @return the type + */ + public final String getType() { + return this.type; + } + + /** + * @param type + * the type to set + */ + public final void setType(final String type) { + this.type = type; + } +} diff --git a/src/net/bican/wordpress/MediaObject.java b/src/net/bican/wordpress/MediaObject.java deleted file mode 100644 index e6745b2..0000000 --- a/src/net/bican/wordpress/MediaObject.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Wordpress-java http://code.google.com/p/wordpress-java/ Copyright 2012 Can - * Bican See the file 'COPYING' in the distribution for - * licensing terms. - */ -package net.bican.wordpress; - -/** - * Media Object, as the result of an upload; - * - * @author Can Bican <can@bican.net> - */ -public class MediaObject extends XmlRpcMapped { - String url; - - String file; - - String type; - - String id; - - /** - * @return the ID of the Media Object - */ - public String getId() { - return this.id; - } - - /** - * @param id - * set the ID of the Media Object - */ - public void setId(String id) { - this.id = id; - } - - /** - * @return the url - */ - public String getUrl() { - return this.url; - } - - /** - * @param url - * the url to set - */ - public void setUrl(String url) { - this.url = url; - } - - /** - * @return the file - */ - public String getFile() { - return this.file; - } - - /** - * @param file - * the file to set - */ - public void setFile(String file) { - this.file = file; - } - - /** - * @return the type - */ - public String getType() { - return this.type; - } - - /** - * @param type - * the type to set - */ - public void setType(String type) { - this.type = type; - } -} diff --git a/src/net/bican/wordpress/Option.java b/src/net/bican/wordpress/Option.java index a5e3f0e..d6bb889 100644 --- a/src/net/bican/wordpress/Option.java +++ b/src/net/bican/wordpress/Option.java @@ -1,9 +1,20 @@ +/* + * + * Wordpress-java + * https://github.com/canbican/wordpress-java/ + * + * Copyright 2012-2015 Can Bican + * See the file 'COPYING' in the distribution for licensing terms. + * + */ package net.bican.wordpress; +import net.bican.wordpress.util.StringHeader; + /** * Option object for a blog. * - * @author Can Bican <can@bican.net> + * @author Can Bican */ public class Option extends XmlRpcMapped implements StringHeader { String name; @@ -22,7 +33,7 @@ public String getName() { * @param name * name to set */ - public void setName(String name) { + public void setName(final String name) { this.name = name; } @@ -51,7 +62,7 @@ public Boolean isReadonly() { * @param desc * description to set */ - public void setDesc(String desc) { + public void setDesc(final String desc) { this.desc = desc; } @@ -59,7 +70,7 @@ public void setDesc(String desc) { * @param readonly * read-only status to set */ - public void setReadonly(Boolean readonly) { + public void setReadonly(final Boolean readonly) { this.readonly = readonly; } @@ -67,7 +78,7 @@ public void setReadonly(Boolean readonly) { * @param value * value to set */ - public void setValue(String value) { + public void setValue(final String value) { this.value = value; } diff --git a/src/net/bican/wordpress/Page.java b/src/net/bican/wordpress/Page.java deleted file mode 100644 index c5359e0..0000000 --- a/src/net/bican/wordpress/Page.java +++ /dev/null @@ -1,539 +0,0 @@ -/* - * Wordpress-java http://code.google.com/p/wordpress-java/ Copyright 2012 Can - * Bican See the file 'COPYING' in the distribution for - * licensing terms. - */ -package net.bican.wordpress; - -import java.io.BufferedReader; -import java.io.File; -import java.io.FileReader; -import java.io.IOException; -import java.util.Date; - -import redstone.xmlrpc.XmlRpcArray; -import redstone.xmlrpc.XmlRpcStruct; - -/** - * Page object for a blog. - * - * @author Can Bican <can@bican.net> - */ -public class Page extends XmlRpcMapped implements StringHeader { - /** - * Generates a new page class from the given file - * - * @param file - * file that contains the page information - * @return new Page object - * @throws IOException - * when the file cannot be read - * @throws InvalidPostFormatException - * when the file format is not recognized - */ - public static Page fromFile(File file) throws IOException, - InvalidPostFormatException { - try (BufferedReader input = new BufferedReader(new FileReader(file))) { - Page result = new Page(); - XmlRpcStruct page = FileParser.parseFile(input); - result.fromXmlRpcStruct(page); - return result; - } - } - - XmlRpcArray categories; - - XmlRpcArray custom_fields; - - Date date_created_gmt; - - Date dateCreated; - - String description; - - String link; - - Integer mt_allow_comments; - - Integer mt_allow_pings; - - String mt_excerpt; - - String mt_keywords; - - String mt_text_more; - - Integer page_id; - - String page_status; - - String permaLink; - - String post_status; - - String post_type; - - Integer postid; - - String title; - - String userid; - - String wp_author; - - String wp_author_display_name; - - String wp_author_id; - - Integer wp_page_order; - - Integer wp_page_parent_id; - - String wp_page_parent_title; - - String wp_password; - - String wp_post_thumbnail; - - String wp_slug; - - /** - * @return the categories - */ - public XmlRpcArray getCategories() { - return this.categories; - } - - /** - * @return the custom_fields - */ - public XmlRpcArray getCustom_fields() { - return this.custom_fields; - } - - /** - * @return the date_created_gmt - */ - public Date getDate_created_gmt() { - return this.date_created_gmt; - } - - /** - * @return the dateCreated - */ - public Date getDateCreated() { - return this.dateCreated; - } - - /** - * @return the description - */ - public String getDescription() { - return this.description; - } - - /** - * @return the excerpt - */ - public String getExcerpt() { - return this.mt_excerpt; - } - - /** - * @return the link - */ - public String getLink() { - return this.link; - } - - /** - * @return the mt_allow_comments - */ - public Integer getMt_allow_comments() { - return this.mt_allow_comments; - } - - /** - * @return the mt_allow_pings - */ - public Integer getMt_allow_pings() { - return this.mt_allow_pings; - } - - /** - * @return the mt_keywords - */ - public String getMt_keywords() { - return this.mt_keywords; - } - - /** - * @return text_more - */ - public String getMt_text_more() { - return this.mt_text_more; - } - - /** - * @return the page_id - */ - public Integer getPage_id() { - return this.page_id; - } - - /** - * @return the page_status - */ - public String getPage_status() { - return this.page_status; - } - - /** - * @return the permaLink - */ - public String getPermaLink() { - return this.permaLink; - } - - /** - * @return the post_status - */ - public String getPost_status() { - return this.post_status; - } - - /** - * @return the post_type - */ - public String getPost_type() { - return this.post_type; - } - - /** - * @return the postid - */ - public Integer getPostid() { - return this.postid; - } - - /** - * (non-Javadoc) - * - * @see net.bican.wordpress.StringHeader#getStringHeader() - */ - @Override - @SuppressWarnings("nls") - public String getStringHeader() { - return ""; // this is not a tabulated list - } - - /** - * @return the title - */ - public String getTitle() { - return this.title; - } - - /** - * @return the userid - */ - public String getUserid() { - return this.userid; - } - - /** - * @return the wp_author - */ - public String getWp_author() { - return this.wp_author; - } - - /** - * @return the wp_author_display_name - */ - public String getWp_author_display_name() { - return this.wp_author_display_name; - } - - /** - * @return the wp_author_id - */ - public String getWp_author_id() { - return this.wp_author_id; - } - - /** - * @return the wp_page_order - */ - public Integer getWp_page_order() { - return this.wp_page_order; - } - - /** - * @return the wp_page_parent_id - */ - public Integer getWp_page_parent_id() { - return this.wp_page_parent_id; - } - - /** - * @return the wp_page_parent_title - */ - public String getWp_page_parent_title() { - return this.wp_page_parent_title; - } - - /** - * @return the wp_password - */ - public String getWp_password() { - return this.wp_password; - } - - /** - * @return the wp_slug - */ - public String getWp_slug() { - return this.wp_slug; - } - - /** - * @param categories - * the categories to set - */ - public void setCategories(XmlRpcArray categories) { - this.categories = categories; - } - - /** - * @param custom_fields - * the custom_fields to set - */ - public void setCustom_fields(XmlRpcArray custom_fields) { - this.custom_fields = custom_fields; - } - - /** - * @param date_created_gmt - * the date_created_gmt to set - */ - public void setDate_created_gmt(Date date_created_gmt) { - this.date_created_gmt = date_created_gmt; - // one of dateCreated() and date_created_gmt() has to be null - // or the behavior when two of them are different is undefined - if (this.date_created_gmt != null) - this.dateCreated = null; - } - - /** - * @param dateCreated - * the dateCreated to set - */ - public void setDateCreated(Date dateCreated) { - this.dateCreated = dateCreated; - // one of dateCreated() and date_created_gmt() has to be null - // or the behavior when two of them are different is undefined - if (this.dateCreated != null) - this.date_created_gmt = null; - } - - /** - * @param description - * the description to set - */ - public void setDescription(String description) { - this.description = description; - } - - /** - * @param excerpt - * the excerpt to set - */ - public void setExcerpt(String excerpt) { - this.mt_excerpt = excerpt; - } - - /** - * @param link - * the link to set - */ - public void setLink(String link) { - this.link = link; - } - - /** - * @param mt_allow_comments - * the mt_allow_comments to set - */ - public void setMt_allow_comments(Integer mt_allow_comments) { - this.mt_allow_comments = mt_allow_comments; - } - - /** - * @param mt_allow_pings - * the mt_allow_pings to set - */ - public void setMt_allow_pings(Integer mt_allow_pings) { - this.mt_allow_pings = mt_allow_pings; - } - - /** - * @param mt_keywords - * the mt_keywords to set - */ - public void setMt_keywords(String mt_keywords) { - this.mt_keywords = mt_keywords; - } - - /** - * @param mt_text_more - * to set - */ - public void setMt_text_more(String mt_text_more) { - this.mt_text_more = mt_text_more; - } - - /** - * @param page_id - * the page_id to set - */ - public void setPage_id(Integer page_id) { - this.page_id = page_id; - } - - /** - * @param page_status - * the page_status to set - */ - public void setPage_status(String page_status) { - this.page_status = page_status; - } - - /** - * @param permaLink - * the permaLink to set - */ - public void setPermaLink(String permaLink) { - this.permaLink = permaLink; - } - - /** - * @param postStatus - * the post_status to set - */ - public void setPost_status(String postStatus) { - this.post_status = postStatus; - } - - /** - * @param post_type - * the post_type to set - */ - public void setPost_type(String post_type) { - this.post_type = post_type; - } - - /** - * @param postid - * the postid to set - */ - public void setPostid(Integer postid) { - this.postid = postid; - } - - /** - * @param title - * the title to set - */ - public void setTitle(String title) { - this.title = title; - } - - /** - * @param userid - * the userid to set - */ - public void setUserid(String userid) { - this.userid = userid; - } - - /** - * @param wp_author - * the wp_author to set - */ - public void setWp_author(String wp_author) { - this.wp_author = wp_author; - } - - /** - * @param wp_author_display_name - * the wp_author_display_name to set - */ - public void setWp_author_display_name(String wp_author_display_name) { - this.wp_author_display_name = wp_author_display_name; - } - - /** - * @param wp_author_id - * the wp_author_id to set - */ - public void setWp_author_id(String wp_author_id) { - this.wp_author_id = wp_author_id; - } - - /** - * @param wp_page_order - * the wp_page_order to set - */ - public void setWp_page_order(Integer wp_page_order) { - this.wp_page_order = wp_page_order; - } - - /** - * @param wp_page_parent_id - * the wp_page_parent_id to set - */ - public void setWp_page_parent_id(Integer wp_page_parent_id) { - this.wp_page_parent_id = wp_page_parent_id; - } - - /** - * @param wp_page_parent_title - * the wp_page_parent_title to set - */ - public void setWp_page_parent_title(String wp_page_parent_title) { - this.wp_page_parent_title = wp_page_parent_title; - } - - /** - * @param wp_password - * the wp_password to set - */ - public void setWp_password(String wp_password) { - this.wp_password = wp_password; - } - - /** - * @return thumbnail ID. This is the ID of the MediaObject in Wordpress - */ - public String getWp_post_thumbnail() { - return this.wp_post_thumbnail; - } - - /** - * @param wp_post_thumbnail - * set the post thumbnail (feature image). This is the ID of the - * Media object already created with MediaObject class - */ - public void setWp_post_thumbnail(String wp_post_thumbnail) { - this.wp_post_thumbnail = wp_post_thumbnail; - } - - /** - * @param wp_slug - * the wp_slug to set - */ - public void setWp_slug(String wp_slug) { - this.wp_slug = wp_slug; - } -} diff --git a/src/net/bican/wordpress/PageDefinition.java b/src/net/bican/wordpress/PageDefinition.java deleted file mode 100644 index e82a5eb..0000000 --- a/src/net/bican/wordpress/PageDefinition.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * - * Wordpress-java - * http://code.google.com/p/wordpress-java/ - * - * Copyright 2012 Can Bican - * See the file 'COPYING' in the distribution for licensing terms. - * - */ -package net.bican.wordpress; - -import java.util.Date; - -/** - * - * A trimmed version of Page object, that is returned in lists - * - * @author Can Bican <can@bican.net> - * - */ -public class PageDefinition extends XmlRpcMapped implements StringHeader { - String page_title; - - String page_parent_id; - - Date dateCreated; - - Date date_created_gmt; - - /** - * @return the page_title - */ - public String getPage_title() { - return this.page_title; - } - - /** - * @param page_title the page_title to set - */ - public void setPage_title(String page_title) { - this.page_title = page_title; - } - - /** - * @return the page_parent_id - */ - public String getPage_parent_id() { - return this.page_parent_id; - } - - /** - * @param page_parent_id the page_parent_id to set - */ - public void setPage_parent_id(String page_parent_id) { - this.page_parent_id = page_parent_id; - } - - /** - * @return the dateCreated - */ - public Date getDateCreated() { - return this.dateCreated; - } - - /** - * @param dateCreated the dateCreated to set - */ - public void setDateCreated(Date dateCreated) { - this.dateCreated = dateCreated; - } - - /** - * @return the date_created_gmt - */ - public Date getDate_created_gmt() { - return this.date_created_gmt; - } - - /** - * @param date_created_gmt the date_created_gmt to set - */ - public void setDate_created_gmt(Date date_created_gmt) { - this.date_created_gmt = date_created_gmt; - } - - /** - * (non-Javadoc) - * - * @see net.bican.wordpress.StringHeader#getStringHeader() - */ - @Override - @SuppressWarnings("nls") - public String getStringHeader() { - final String TAB = ":"; - return "Date Created" + TAB + "Date Created(GMT)" + TAB + "Parent ID" + TAB - + "Page Title"; - } - -} diff --git a/src/net/bican/wordpress/Ping.java b/src/net/bican/wordpress/Ping.java deleted file mode 100644 index 9e96b8b..0000000 --- a/src/net/bican/wordpress/Ping.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * - * Wordpress-java - * http://code.google.com/p/wordpress-java/ - * - * Copyright 2012 Can Bican - * See the file 'COPYING' in the distribution for licensing terms. - * - */ -package net.bican.wordpress; - -/** - * - * Class that hold trackback information - * - * @author Can Bican <can@bican.net> - * - */ -public class Ping extends XmlRpcMapped { - String pingTitle; - - String pingURL; - - String pingIP; - - /** - * @return the pingTitle - */ - public String getPingTitle() { - return this.pingTitle; - } - - /** - * @param pingTitle the pingTitle to set - */ - public void setPingTitle(String pingTitle) { - this.pingTitle = pingTitle; - } - - /** - * @return the pingURL - */ - public String getPingURL() { - return this.pingURL; - } - - /** - * @param pingURL the pingURL to set - */ - public void setPingURL(String pingURL) { - this.pingURL = pingURL; - } - - /** - * @return the pingIP - */ - public String getPingIP() { - return this.pingIP; - } - - /** - * @param pingIP the pingIP to set - */ - public void setPingIP(String pingIP) { - this.pingIP = pingIP; - } -} diff --git a/src/net/bican/wordpress/PingbackBridge.java b/src/net/bican/wordpress/PingbackBridge.java new file mode 100644 index 0000000..de42ff2 --- /dev/null +++ b/src/net/bican/wordpress/PingbackBridge.java @@ -0,0 +1,16 @@ +/* + * + * Wordpress-java + * https://github.com/canbican/wordpress-java/ + * + * Copyright 2012-2015 Can Bican + * See the file 'COPYING' in the distribution for licensing terms. + * + */ +package net.bican.wordpress; + +import redstone.xmlrpc.XmlRpcFault; + +interface PingbackBridge { + String ping(String pagelinkedfrom, String pagelinkedto) throws XmlRpcFault; +} diff --git a/src/net/bican/wordpress/PingbackExtensionsBridge.java b/src/net/bican/wordpress/PingbackExtensionsBridge.java new file mode 100644 index 0000000..9424842 --- /dev/null +++ b/src/net/bican/wordpress/PingbackExtensionsBridge.java @@ -0,0 +1,17 @@ +/* + * + * Wordpress-java + * https://github.com/canbican/wordpress-java/ + * + * Copyright 2012-2015 Can Bican + * See the file 'COPYING' in the distribution for licensing terms. + * + */ +package net.bican.wordpress; + +import redstone.xmlrpc.XmlRpcArray; +import redstone.xmlrpc.XmlRpcFault; + +interface PingbackExtensionsBridge { + XmlRpcArray getPingbacks(String url) throws XmlRpcFault; +} diff --git a/src/net/bican/wordpress/Post.java b/src/net/bican/wordpress/Post.java new file mode 100644 index 0000000..119d167 --- /dev/null +++ b/src/net/bican/wordpress/Post.java @@ -0,0 +1,470 @@ +/* + * + * Wordpress-java + * https://github.com/canbican/wordpress-java/ + * + * Copyright 2012-2015 Can Bican + * See the file 'COPYING' in the distribution for licensing terms. + * + */ +package net.bican.wordpress; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileReader; +import java.io.IOException; +import java.util.Date; +import java.util.List; + +import net.bican.wordpress.exceptions.InvalidPostFormatException; +import net.bican.wordpress.util.FileParser; +import redstone.xmlrpc.XmlRpcStruct; + +/** + * A wordpress post + * + * @author Can Bican + */ +public class Post extends XmlRpcMapped { + Integer post_id; + String post_title; + Date post_date; + Date post_date_gmt; + Date post_modified; + Date post_modified_gmt; + String post_status; + String post_type; + String post_format; + String post_name; + Integer post_author; + String post_password; + String post_excerpt; + String post_content; + Integer post_parent; + String post_mime_type; + String link; + String guid; + Integer menu_order; + String comment_status; + String ping_status; + Boolean sticky; + List post_thumbnail; + List terms; + List customFields; + Enclosure enclosure; + + /** + * @return the post_id + */ + public final Integer getPost_id() { + return this.post_id; + } + + /** + * @param post_id + * the post_id to set + */ + public final void setPost_id(final Integer post_id) { + this.post_id = post_id; + } + + /** + * @return the post_title + */ + public final String getPost_title() { + return this.post_title; + } + + /** + * @param post_title + * the post_title to set + */ + public final void setPost_title(final String post_title) { + this.post_title = post_title; + } + + /** + * @return the post_date + */ + public final Date getPost_date() { + return this.post_date; + } + + /** + * @param post_date + * the post_date to set + */ + public final void setPost_date(final Date post_date) { + this.post_date = post_date; + } + + /** + * @return the post_date_gmt + */ + public final Date getPost_date_gmt() { + return this.post_date_gmt; + } + + /** + * @param post_date_gmt + * the post_date_gmt to set + */ + public final void setPost_date_gmt(final Date post_date_gmt) { + this.post_date_gmt = post_date_gmt; + } + + /** + * @return the post_modified + */ + public final Date getPost_modified() { + return this.post_modified; + } + + /** + * @param post_modified + * the post_modified to set + */ + public final void setPost_modified(final Date post_modified) { + this.post_modified = post_modified; + } + + /** + * @return the post_modified_gmt + */ + public final Date getPost_modified_gmt() { + return this.post_modified_gmt; + } + + /** + * @param post_modified_gmt + * the post_modified_gmt to set + */ + public final void setPost_modified_gmt(final Date post_modified_gmt) { + this.post_modified_gmt = post_modified_gmt; + } + + /** + * @return the post_status + */ + public final String getPost_status() { + return this.post_status; + } + + /** + * @param post_status + * the post_status to set + */ + public final void setPost_status(final String post_status) { + this.post_status = post_status; + } + + /** + * @return the post_type + */ + public final String getPost_type() { + return this.post_type; + } + + /** + * @param post_type + * the post_type to set + */ + public final void setPost_type(final String post_type) { + this.post_type = post_type; + } + + /** + * @return the post_format + */ + public final String getPost_format() { + return this.post_format; + } + + /** + * @param post_format + * the post_format to set + */ + public final void setPost_format(final String post_format) { + this.post_format = post_format; + } + + /** + * @return the post_name + */ + public final String getPost_name() { + return this.post_name; + } + + /** + * @param post_name + * the post_name to set + */ + public final void setPost_name(final String post_name) { + this.post_name = post_name; + } + + /** + * @return the post_author + */ + public final Integer getPost_author() { + return this.post_author; + } + + /** + * @param post_author + * the post_author to set + */ + public final void setPost_author(final Integer post_author) { + this.post_author = post_author; + } + + /** + * @return the post_password + */ + public final String getPost_password() { + return this.post_password; + } + + /** + * @param post_password + * the post_password to set + */ + public final void setPost_password(final String post_password) { + this.post_password = post_password; + } + + /** + * @return the post_excerpt + */ + public final String getPost_excerpt() { + return this.post_excerpt; + } + + /** + * @param post_excerpt + * the post_excerpt to set + */ + public final void setPost_excerpt(final String post_excerpt) { + this.post_excerpt = post_excerpt; + } + + /** + * @return the post_content + */ + public final String getPost_content() { + return this.post_content; + } + + /** + * @param post_content + * the post_content to set + */ + public final void setPost_content(final String post_content) { + this.post_content = post_content; + } + + /** + * @return the post_parent + */ + public final Integer getPost_parent() { + return this.post_parent; + } + + /** + * @param post_parent + * the post_parent to set + */ + public final void setPost_parent(final Integer post_parent) { + this.post_parent = post_parent; + } + + /** + * @return the post_mime_type + */ + public final String getPost_mime_type() { + return this.post_mime_type; + } + + /** + * @param post_mime_type + * the post_mime_type to set + */ + public final void setPost_mime_type(final String post_mime_type) { + this.post_mime_type = post_mime_type; + } + + /** + * @return the link + */ + public final String getLink() { + return this.link; + } + + /** + * @param link + * the link to set + */ + public final void setLink(final String link) { + this.link = link; + } + + /** + * @return the guid + */ + public final String getGuid() { + return this.guid; + } + + /** + * @param guid + * the guid to set + */ + public final void setGuid(final String guid) { + this.guid = guid; + } + + /** + * @return the menu_order + */ + public final Integer getMenu_order() { + return this.menu_order; + } + + /** + * @param menu_order + * the menu_order to set + */ + public final void setMenu_order(final Integer menu_order) { + this.menu_order = menu_order; + } + + /** + * @return the comment_status + */ + public final String getComment_status() { + return this.comment_status; + } + + /** + * @param comment_status + * the comment_status to set + */ + public final void setComment_status(final String comment_status) { + this.comment_status = comment_status; + } + + /** + * @return the ping_status + */ + public final String getPing_status() { + return this.ping_status; + } + + /** + * @param ping_status + * the ping_status to set + */ + public final void setPing_status(final String ping_status) { + this.ping_status = ping_status; + } + + /** + * @return the sticky + */ + public final Boolean isSticky() { + return this.sticky; + } + + /** + * @param sticky + * the sticky to set + */ + public final void setSticky(final Boolean sticky) { + this.sticky = sticky; + } + + /** + * @return the post_thumbnail + */ + public final List getPost_thumbnail() { + return this.post_thumbnail; + } + + /** + * @param post_thumbnail + * the post_thumbnail to set + */ + public final void setPost_thumbnail( + final List post_thumbnail) { + this.post_thumbnail = post_thumbnail; + } + + /** + * @return the terms + */ + public final List getTerms() { + return this.terms; + } + + /** + * @param terms + * the terms to set + */ + public final void setTerms(final List terms) { + this.terms = terms; + } + + /** + * @return the customFields + */ + public final List getCustomFields() { + return this.customFields; + } + + /** + * @param customFields + * the customFields to set + */ + public final void setCustomFields(final List customFields) { + this.customFields = customFields; + } + + /** + * @return the enclosure + */ + public final Enclosure getEnclosure() { + return this.enclosure; + } + + /** + * @param enclosure + * the enclosure to set + */ + public final void setEnclosure(final Enclosure enclosure) { + this.enclosure = enclosure; + } + + /** + * creates a post object from file + * + * @param file + * input file + * @return new Post object + * @throws FileNotFoundException + * when the file is absent + * @throws IOException + * when the file cannot be read + * @throws InvalidPostFormatException + * when the file format is invalid + */ + public static Post fromFile(final File file) + throws FileNotFoundException, IOException, InvalidPostFormatException { + try (BufferedReader br = new BufferedReader(new FileReader(file))) { + final XmlRpcStruct c = FileParser.parseFile(br); + final Post result = new Post(); + result.fromXmlRpcStruct(c); + return result; + } + } +} diff --git a/src/net/bican/wordpress/PostAndPageStatus.java b/src/net/bican/wordpress/PostAndPageStatus.java deleted file mode 100644 index d52fe07..0000000 --- a/src/net/bican/wordpress/PostAndPageStatus.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Wordpress-java http://code.google.com/p/wordpress-java/ Copyright 2012 Can - * Bican See the file 'COPYING' in the distribution for - * licensing terms. - */ -package net.bican.wordpress; - -/** - * Status values for posts and pages - * - * @author Can Bican <can@bican.net> - */ -public class PostAndPageStatus extends XmlRpcMapped implements StringHeader { - String status; - - String description; - - /** - * @return the status - */ - public String getStatus() { - return this.status; - } - - /** - * @param status - * the status to set - */ - public void setStatus(String status) { - this.status = status; - } - - /** - * @return the description - */ - public String getDescription() { - return this.description; - } - - /** - * @param description - * the description to set - */ - public void setDescription(String description) { - this.description = description; - } - - /** - * (non-Javadoc) - * - * @see net.bican.wordpress.StringHeader#getStringHeader() - */ - @Override - @SuppressWarnings("nls") - public String getStringHeader() { - return ""; - } -} diff --git a/src/net/bican/wordpress/PostThumbnailImageMeta.java b/src/net/bican/wordpress/PostThumbnailImageMeta.java new file mode 100644 index 0000000..0386845 --- /dev/null +++ b/src/net/bican/wordpress/PostThumbnailImageMeta.java @@ -0,0 +1,197 @@ +/* + * + * Wordpress-java + * https://github.com/canbican/wordpress-java/ + * + * Copyright 2012-2015 Can Bican + * See the file 'COPYING' in the distribution for licensing terms. + * + */ +package net.bican.wordpress; + +/** + * Class for keeping image meta data + * + * @author Can Bican + */ +public class PostThumbnailImageMeta extends XmlRpcMapped { + Double aperture; // TODO wordpress codex tells it's integer but should be + // double + String credit; + String camera; + String caption; + Integer created_timestamp; + String copyright; + Double focal_length; // TODO wordpress codex tells it's integer but exif + // accepts doubles + String iso; + Double shutter_speed;// TODO wordpress codex tells it's integer but exif + // accepts doubles + String title; + Integer orientation; // wordpress codex does not include this TODO + + /** + * @return the aperture + */ + public final Double getAperture() { + return this.aperture; + } + + /** + * @param aperture + * the aperture to set + */ + public final void setAperture(final Double aperture) { + this.aperture = aperture; + } + + /** + * @return the credit + */ + public final String getCredit() { + return this.credit; + } + + /** + * @param credit + * the credit to set + */ + public final void setCredit(final String credit) { + this.credit = credit; + } + + /** + * @return the camera + */ + public final String getCamera() { + return this.camera; + } + + /** + * @param camera + * the camera to set + */ + public final void setCamera(final String camera) { + this.camera = camera; + } + + /** + * @return the caption + */ + public final String getCaption() { + return this.caption; + } + + /** + * @param caption + * the caption to set + */ + public final void setCaption(final String caption) { + this.caption = caption; + } + + /** + * @return the created_timestamp + */ + public final Integer getCreated_timestamp() { + return this.created_timestamp; + } + + /** + * @param created_timestamp + * the created_timestamp to set + */ + public final void setCreated_timestamp(final Integer created_timestamp) { + this.created_timestamp = created_timestamp; + } + + /** + * @return the copyright + */ + public final String getCopyright() { + return this.copyright; + } + + /** + * @param copyright + * the copyright to set + */ + public final void setCopyright(final String copyright) { + this.copyright = copyright; + } + + /** + * @return the focal_length + */ + public final Double getFocal_length() { + return this.focal_length; + } + + /** + * @param focal_length + * the focal_length to set + */ + public final void setFocal_length(final Double focal_length) { + this.focal_length = focal_length; + } + + /** + * @return the iso + */ + public final String getIso() { + return this.iso; + } + + /** + * @param iso + * the iso to set + */ + public final void setIso(final String iso) { + this.iso = iso; + } + + /** + * @return the shutter_speed + */ + public final Double getShutter_speed() { + return this.shutter_speed; + } + + /** + * @param shutter_speed + * the shutter_speed to set + */ + public final void setShutter_speed(final Double shutter_speed) { + this.shutter_speed = shutter_speed; + } + + /** + * @return the title + */ + public final String getTitle() { + return this.title; + } + + /** + * @param title + * the title to set + */ + public final void setTitle(final String title) { + this.title = title; + } + + /** + * @return the orientation + */ + public final Integer getOrientation() { + return this.orientation; + } + + /** + * @param orientation + * the orientation to set + */ + public final void setOrientation(final Integer orientation) { + this.orientation = orientation; + } +} diff --git a/src/net/bican/wordpress/PostType.java b/src/net/bican/wordpress/PostType.java new file mode 100644 index 0000000..196be53 --- /dev/null +++ b/src/net/bican/wordpress/PostType.java @@ -0,0 +1,260 @@ +/* + * + * Wordpress-java + * https://github.com/canbican/wordpress-java/ + * + * Copyright 2012-2015 Can Bican + * See the file 'COPYING' in the distribution for licensing terms. + * + */ +package net.bican.wordpress; + +import java.util.List; + +/** + * Post types for posts + * + * @author Can Bican + */ +public class PostType extends XmlRpcMapped { + String name; + String label; + boolean hierarchical; + boolean _public; + boolean show_ui; + boolean _builtin; + boolean has_archive; + Support supports; + Labels labels; + PostTypeCap cap; + boolean map_meta_cap; + int menu_position; + String menu_icon; + boolean show_in_menu; + List taxonomies; + + /** + * @return the name + */ + public final String getName() { + return this.name; + } + + /** + * @param name + * the name to set + */ + public final void setName(final String name) { + this.name = name; + } + + /** + * @return the label + */ + public final String getLabel() { + return this.label; + } + + /** + * @param label + * the label to set + */ + public final void setLabel(final String label) { + this.label = label; + } + + /** + * @return the hierarchical + */ + public final boolean isHierarchical() { + return this.hierarchical; + } + + /** + * @param hierarchical + * the hierarchical to set + */ + public final void setHierarchical(final boolean hierarchical) { + this.hierarchical = hierarchical; + } + + /** + * @return the _public + */ + public final boolean isPublic() { + return this._public; + } + + /** + * @param _public + * the _public to set + */ + public final void setPublic(final boolean _public) { + this._public = _public; + } + + /** + * @return the show_ui + */ + public final boolean isShow_ui() { + return this.show_ui; + } + + /** + * @param show_ui + * the show_ui to set + */ + public final void setShow_ui(final boolean show_ui) { + this.show_ui = show_ui; + } + + /** + * @return the _builtin + */ + public final boolean is_builtin() { + return this._builtin; + } + + /** + * @param _builtin + * the _builtin to set + */ + public final void set_builtin(final boolean _builtin) { + this._builtin = _builtin; + } + + /** + * @return the has_archive + */ + public final boolean isHas_archive() { + return this.has_archive; + } + + /** + * @param has_archive + * the has_archive to set + */ + public final void setHas_archive(final boolean has_archive) { + this.has_archive = has_archive; + } + + /** + * @return the supports + */ + public final Support getSupports() { + return this.supports; + } + + /** + * @param supports + * the supports to set + */ + public final void setSupports(final Support supports) { + this.supports = supports; + } + + /** + * @return the labels + */ + public final Labels getLabels() { + return this.labels; + } + + /** + * @param labels + * the labels to set + */ + public final void setLabels(final Labels labels) { + this.labels = labels; + } + + /** + * @return the cap + */ + public final PostTypeCap getCap() { + return this.cap; + } + + /** + * @param cap + * the cap to set + */ + public final void setCap(final PostTypeCap cap) { + this.cap = cap; + } + + /** + * @return the map_meta_cap + */ + public final boolean isMap_meta_cap() { + return this.map_meta_cap; + } + + /** + * @param map_meta_cap + * the map_meta_cap to set + */ + public final void setMap_meta_cap(final boolean map_meta_cap) { + this.map_meta_cap = map_meta_cap; + } + + /** + * @return the menu_position + */ + public final int getMenu_position() { + return this.menu_position; + } + + /** + * @param menu_position + * the menu_position to set + */ + public final void setMenu_position(final int menu_position) { + this.menu_position = menu_position; + } + + /** + * @return the menu_icon + */ + public final String getMenu_icon() { + return this.menu_icon; + } + + /** + * @param menu_icon + * the menu_icon to set + */ + public final void setMenu_icon(final String menu_icon) { + this.menu_icon = menu_icon; + } + + /** + * @return the show_in_menu + */ + public final boolean isShow_in_menu() { + return this.show_in_menu; + } + + /** + * @param show_in_menu + * the show_in_menu to set + */ + public final void setShow_in_menu(final boolean show_in_menu) { + this.show_in_menu = show_in_menu; + } + + /** + * @return the taxonomies + */ + public final List getTaxonomies() { + return this.taxonomies; + } + + /** + * @param taxonomies + * the taxonomies to set + */ + public final void setTaxonomies(final List taxonomies) { + this.taxonomies = taxonomies; + } +} diff --git a/src/net/bican/wordpress/PostTypeCap.java b/src/net/bican/wordpress/PostTypeCap.java new file mode 100644 index 0000000..f65d92a --- /dev/null +++ b/src/net/bican/wordpress/PostTypeCap.java @@ -0,0 +1,258 @@ +/* + * + * Wordpress-java + * https://github.com/canbican/wordpress-java/ + * + * Copyright 2012-2015 Can Bican + * See the file 'COPYING' in the distribution for licensing terms. + * + */ +package net.bican.wordpress; + +/** + * Capabilities for a post type + * + * @author Can Bican + */ +public class PostTypeCap extends XmlRpcMapped { + String edit_posts; + String delete_others_posts; + String read; + String publish_posts; + String read_post; + String edit_others_posts; + String edit_published_posts; + String delete_posts; + String delete_published_posts; + String read_private_posts; + String edit_post; + String edit_private_posts; + String delete_post; + String delete_private_posts; + String create_posts; + + /** + * @return the edit_posts + */ + public final String getEdit_posts() { + return this.edit_posts; + } + + /** + * @param edit_posts + * the edit_posts to set + */ + public final void setEdit_posts(final String edit_posts) { + this.edit_posts = edit_posts; + } + + /** + * @return the delete_others_posts + */ + public final String getDelete_others_posts() { + return this.delete_others_posts; + } + + /** + * @param delete_others_posts + * the delete_others_posts to set + */ + public final void setDelete_others_posts(final String delete_others_posts) { + this.delete_others_posts = delete_others_posts; + } + + /** + * @return the read + */ + public final String getRead() { + return this.read; + } + + /** + * @param read + * the read to set + */ + public final void setRead(final String read) { + this.read = read; + } + + /** + * @return the publish_posts + */ + public final String getPublish_posts() { + return this.publish_posts; + } + + /** + * @param publish_posts + * the publish_posts to set + */ + public final void setPublish_posts(final String publish_posts) { + this.publish_posts = publish_posts; + } + + /** + * @return the read_post + */ + public final String getRead_post() { + return this.read_post; + } + + /** + * @param read_post + * the read_post to set + */ + public final void setRead_post(final String read_post) { + this.read_post = read_post; + } + + /** + * @return the edit_others_posts + */ + public final String getEdit_others_posts() { + return this.edit_others_posts; + } + + /** + * @param edit_others_posts + * the edit_others_posts to set + */ + public final void setEdit_others_posts(final String edit_others_posts) { + this.edit_others_posts = edit_others_posts; + } + + /** + * @return the edit_published_posts + */ + public final String getEdit_published_posts() { + return this.edit_published_posts; + } + + /** + * @param edit_published_posts + * the edit_published_posts to set + */ + public final void setEdit_published_posts(final String edit_published_posts) { + this.edit_published_posts = edit_published_posts; + } + + /** + * @return the delete_posts + */ + public final String getDelete_posts() { + return this.delete_posts; + } + + /** + * @param delete_posts + * the delete_posts to set + */ + public final void setDelete_posts(final String delete_posts) { + this.delete_posts = delete_posts; + } + + /** + * @return the delete_published_posts + */ + public final String getDelete_published_posts() { + return this.delete_published_posts; + } + + /** + * @param delete_published_posts + * the delete_published_posts to set + */ + public final void setDelete_published_posts(final String delete_published_posts) { + this.delete_published_posts = delete_published_posts; + } + + /** + * @return the read_private_posts + */ + public final String getRead_private_posts() { + return this.read_private_posts; + } + + /** + * @param read_private_posts + * the read_private_posts to set + */ + public final void setRead_private_posts(final String read_private_posts) { + this.read_private_posts = read_private_posts; + } + + /** + * @return the edit_post + */ + public final String getEdit_post() { + return this.edit_post; + } + + /** + * @param edit_post + * the edit_post to set + */ + public final void setEdit_post(final String edit_post) { + this.edit_post = edit_post; + } + + /** + * @return the edit_private_posts + */ + public final String getEdit_private_posts() { + return this.edit_private_posts; + } + + /** + * @param edit_private_posts + * the edit_private_posts to set + */ + public final void setEdit_private_posts(final String edit_private_posts) { + this.edit_private_posts = edit_private_posts; + } + + /** + * @return the delete_post + */ + public final String getDelete_post() { + return this.delete_post; + } + + /** + * @param delete_post + * the delete_post to set + */ + public final void setDelete_post(final String delete_post) { + this.delete_post = delete_post; + } + + /** + * @return the delete_private_posts + */ + public final String getDelete_private_posts() { + return this.delete_private_posts; + } + + /** + * @param delete_private_posts + * the delete_private_posts to set + */ + public final void setDelete_private_posts(final String delete_private_posts) { + this.delete_private_posts = delete_private_posts; + } + + /** + * @return the create_posts + */ + public final String getCreate_posts() { + return this.create_posts; + } + + /** + * @param create_posts + * the create_posts to set + */ + public final void setCreate_posts(final String create_posts) { + this.create_posts = create_posts; + } +} diff --git a/src/net/bican/wordpress/Support.java b/src/net/bican/wordpress/Support.java new file mode 100644 index 0000000..fb65c16 --- /dev/null +++ b/src/net/bican/wordpress/Support.java @@ -0,0 +1,208 @@ +/* + * + * Wordpress-java + * https://github.com/canbican/wordpress-java/ + * + * Copyright 2012-2015 Can Bican + * See the file 'COPYING' in the distribution for licensing terms. + * + */ +package net.bican.wordpress; + +import redstone.xmlrpc.XmlRpcStruct; + +/** + * support list for a post type + * + * @author Can Bican + */ +public class Support extends XmlRpcMapped { + private static final String CUSTOM_FIELDS_FIELD = "custom-fields"; //$NON-NLS-1$ + private static final String POST_FORMATS_FIELD = "post-formats"; //$NON-NLS-1$ + Boolean editor; + Boolean thumbnail; + Boolean comments; + Boolean trackbacks; + Boolean author; + Boolean revisions; + Boolean postFormats; + Boolean title; + Boolean excerpt; + Boolean customFields; + + @Override + public void fromXmlRpcStruct(final XmlRpcStruct x) { + super.fromXmlRpcStruct(x); + final Boolean pf = (Boolean) x.get(POST_FORMATS_FIELD); + if (pf != null) { + this.setPostFormats(pf); + } + final Boolean pf2 = (Boolean) x.get(CUSTOM_FIELDS_FIELD); + if (pf2 != null) { + this.setCustomFields(pf2); + } + } + + @SuppressWarnings("unchecked") + @Override + public XmlRpcStruct toXmlRpcStruct() { + final XmlRpcStruct result = super.toXmlRpcStruct(); + if (this.isPostFormats() != null) { + result.put(POST_FORMATS_FIELD, this.isPostFormats()); + } + if (this.isCustomFields() != null) { + result.put(CUSTOM_FIELDS_FIELD, this.isCustomFields()); + } + return result; + } + + /** + * @return the editor + */ + public final Boolean isEditor() { + return this.editor; + } + + /** + * @param editor + * the editor to set + */ + public final void setEditor(final Boolean editor) { + this.editor = editor; + } + + /** + * @return the thumbnail + */ + public final Boolean isThumbnail() { + return this.thumbnail; + } + + /** + * @param thumbnail + * the thumbnail to set + */ + public final void setThumbnail(final Boolean thumbnail) { + this.thumbnail = thumbnail; + } + + /** + * @return the comments + */ + public final Boolean isComments() { + return this.comments; + } + + /** + * @param comments + * the comments to set + */ + public final void setComments(final Boolean comments) { + this.comments = comments; + } + + /** + * @return the trackbacks + */ + public final Boolean isTrackbacks() { + return this.trackbacks; + } + + /** + * @param trackbacks + * the trackbacks to set + */ + public final void setTrackbacks(final Boolean trackbacks) { + this.trackbacks = trackbacks; + } + + /** + * @return the author + */ + public final Boolean isAuthor() { + return this.author; + } + + /** + * @param author + * the author to set + */ + public final void setAuthor(final Boolean author) { + this.author = author; + } + + /** + * @return the revisions + */ + public final Boolean isRevisions() { + return this.revisions; + } + + /** + * @param revisions + * the revisions to set + */ + public final void setRevisions(final Boolean revisions) { + this.revisions = revisions; + } + + /** + * @return the postFormats + */ + public final Boolean isPostFormats() { + return this.postFormats; + } + + /** + * @param postFormats + * the postFormats to set + */ + public final void setPostFormats(final Boolean postFormats) { + this.postFormats = postFormats; + } + + /** + * @return the title + */ + public final Boolean isTitle() { + return this.title; + } + + /** + * @param title + * the title to set + */ + public final void setTitle(final Boolean title) { + this.title = title; + } + + /** + * @return the excerpt + */ + public final Boolean isExcerpt() { + return this.excerpt; + } + + /** + * @param excerpt + * the excerpt to set + */ + public final void setExcerpt(final Boolean excerpt) { + this.excerpt = excerpt; + } + + /** + * @return the customFields + */ + public final Boolean isCustomFields() { + return this.customFields; + } + + /** + * @param customFields + * the customFields to set + */ + public final void setCustomFields(final Boolean customFields) { + this.customFields = customFields; + } +} diff --git a/src/net/bican/wordpress/Taxonomy.java b/src/net/bican/wordpress/Taxonomy.java index 2a75f25..da13e59 100644 --- a/src/net/bican/wordpress/Taxonomy.java +++ b/src/net/bican/wordpress/Taxonomy.java @@ -1,11 +1,22 @@ +/* + * + * Wordpress-java + * https://github.com/canbican/wordpress-java/ + * + * Copyright 2012-2015 Can Bican + * See the file 'COPYING' in the distribution for licensing terms. + * + */ package net.bican.wordpress; import java.util.List; +import net.bican.wordpress.util.StringHeader; + /** * Taxonomy object for a blog * - * @author Can Bican <can@bican.net> + * @author Can Bican */ public class Taxonomy extends XmlRpcMapped implements StringHeader { String name; @@ -29,7 +40,7 @@ public List getObject_type() { * @param object_type * object type list to set */ - public void setObject_type(List object_type) { + public void setObject_type(final List object_type) { this.object_type = object_type; } @@ -44,7 +55,7 @@ public Cap getCap() { * @param cap * cap to set */ - public void setCap(Cap cap) { + public void setCap(final Cap cap) { this.cap = cap; } @@ -52,7 +63,7 @@ public void setCap(Cap cap) { * @param _builtin * built-in status */ - public void set_builtin(boolean _builtin) { + public void set_builtin(final boolean _builtin) { this._builtin = _builtin; } @@ -60,7 +71,7 @@ public void set_builtin(boolean _builtin) { * @param hierarchical * hierarchical status */ - public void setHierarchical(boolean hierarchical) { + public void setHierarchical(final boolean hierarchical) { this.hierarchical = hierarchical; } @@ -68,7 +79,7 @@ public void setHierarchical(boolean hierarchical) { * @param label * label to set */ - public void setLabel(String label) { + public void setLabel(final String label) { this.label = label; } @@ -76,7 +87,7 @@ public void setLabel(String label) { * @param name * name to set */ - public void setName(String name) { + public void setName(final String name) { this.name = name; } @@ -84,7 +95,7 @@ public void setName(String name) { * @param p * public status */ - public void setPublic(boolean p) { + public void setPublic(final boolean p) { this.p = p; } @@ -92,7 +103,7 @@ public void setPublic(boolean p) { * @param show_ui * show-ui status */ - public void setShow_ui(boolean show_ui) { + public void setShow_ui(final boolean show_ui) { this.show_ui = show_ui; } @@ -149,7 +160,7 @@ public Labels getLabels() { * @param labels * labels to set */ - public void setLabels(Labels labels) { + public void setLabels(final Labels labels) { this.labels = labels; } @@ -157,4 +168,4 @@ public void setLabels(Labels labels) { public String getStringHeader() { return ""; // this is not a tabulated list //$NON-NLS-1$ } -} \ No newline at end of file +} diff --git a/src/net/bican/wordpress/Term.java b/src/net/bican/wordpress/Term.java index f1b3952..5cc41f3 100644 --- a/src/net/bican/wordpress/Term.java +++ b/src/net/bican/wordpress/Term.java @@ -1,9 +1,20 @@ +/* + * + * Wordpress-java + * https://github.com/canbican/wordpress-java/ + * + * Copyright 2012-2015 Can Bican + * See the file 'COPYING' in the distribution for licensing terms. + * + */ package net.bican.wordpress; +import net.bican.wordpress.util.StringHeader; + /** * Term object for a blog. * - * @author Can Bican <can@bican.net> + * @author Can Bican */ public class Term extends XmlRpcMapped implements StringHeader { Integer term_id; @@ -15,6 +26,7 @@ public class Term extends XmlRpcMapped implements StringHeader { String description; Integer parent; Integer count; + String filter; /** * @return the term id @@ -27,7 +39,7 @@ public Integer getTerm_id() { * @param term_id * term id to set */ - public void setTerm_id(Integer term_id) { + public void setTerm_id(final Integer term_id) { this.term_id = term_id; } @@ -42,7 +54,7 @@ public String getName() { * @param name * name to set */ - public void setName(String name) { + public void setName(final String name) { this.name = name; } @@ -57,7 +69,7 @@ public String getSlug() { * @param slug * slug to set */ - public void setSlug(String slug) { + public void setSlug(final String slug) { this.slug = slug; } @@ -72,7 +84,7 @@ public String getTerm_group() { * @param term_group * term group to set */ - public void setTerm_group(String term_group) { + public void setTerm_group(final String term_group) { this.term_group = term_group; } @@ -87,7 +99,7 @@ public String getTerm_taxonomy_id() { * @param term_taxonomy_id * taxonomy id to set */ - public void setTerm_taxonomy_id(String term_taxonomy_id) { + public void setTerm_taxonomy_id(final String term_taxonomy_id) { this.term_taxonomy_id = term_taxonomy_id; } @@ -102,7 +114,7 @@ public String getTaxonomy() { * @param taxonomy * taxonomy to set */ - public void setTaxonomy(String taxonomy) { + public void setTaxonomy(final String taxonomy) { this.taxonomy = taxonomy; } @@ -117,7 +129,7 @@ public String getDescription() { * @param description * description to set */ - public void setDescription(String description) { + public void setDescription(final String description) { this.description = description; } @@ -132,7 +144,7 @@ public Integer getParent() { * @param parent * parent to set */ - public void setParent(Integer parent) { + public void setParent(final Integer parent) { this.parent = parent; } @@ -147,7 +159,7 @@ public Integer getCount() { * @param count * count to set */ - public void setCount(Integer count) { + public void setCount(final Integer count) { this.count = count; } @@ -156,4 +168,19 @@ public String getStringHeader() { return ""; //$NON-NLS-1$ } + /** + * @return the filter + */ + public final String getFilter() { + return this.filter; + } + + /** + * @param filter + * the filter to set + */ + public final void setFilter(final String filter) { + this.filter = filter; + } + } diff --git a/src/net/bican/wordpress/TermFilter.java b/src/net/bican/wordpress/TermFilter.java index 0c1167a..f949036 100644 --- a/src/net/bican/wordpress/TermFilter.java +++ b/src/net/bican/wordpress/TermFilter.java @@ -1,9 +1,18 @@ +/* + * + * Wordpress-java + * https://github.com/canbican/wordpress-java/ + * + * Copyright 2012-2015 Can Bican + * See the file 'COPYING' in the distribution for licensing terms. + * + */ package net.bican.wordpress; /** * Object for filtering terms during search * - * @author Can Bican <can@bican.net> + * @author Can Bican */ public class TermFilter extends XmlRpcMapped { Integer number; @@ -24,7 +33,7 @@ public Integer getNumber() { * @param number * number to set */ - public void setNumber(Integer number) { + public void setNumber(final Integer number) { this.number = number; } @@ -39,7 +48,7 @@ public Integer getOffset() { * @param offset * offset to set */ - public void setOffset(Integer offset) { + public void setOffset(final Integer offset) { this.offset = offset; } @@ -54,7 +63,7 @@ public String getOrderby() { * @param orderby * order-by to set */ - public void setOrderby(String orderby) { + public void setOrderby(final String orderby) { this.orderby = orderby; } @@ -69,7 +78,7 @@ public String getOrder() { * @param order * order to set */ - public void setOrder(String order) { + public void setOrder(final String order) { this.order = order; } @@ -84,7 +93,7 @@ public boolean isHide_empty() { * @param hide_empty * hide-empty status to set */ - public void setHide_empty(boolean hide_empty) { + public void setHide_empty(final boolean hide_empty) { this.hide_empty = hide_empty; } @@ -99,7 +108,7 @@ public String getSearch() { * @param search * search terms to set */ - public void setSearch(String search) { + public void setSearch(final String search) { this.search = search; } } diff --git a/src/net/bican/wordpress/User.java b/src/net/bican/wordpress/User.java index 78e63b4..252b413 100644 --- a/src/net/bican/wordpress/User.java +++ b/src/net/bican/wordpress/User.java @@ -1,36 +1,42 @@ /* * * Wordpress-java - * http://code.google.com/p/wordpress-java/ + * https://github.com/canbican/wordpress-java/ * - * Copyright 2012 Can Bican + * Copyright 2012-2015 Can Bican * See the file 'COPYING' in the distribution for licensing terms. * */ package net.bican.wordpress; +import java.util.Date; +import java.util.List; + +import net.bican.wordpress.util.StringHeader; + /** - * * Class that keeps user information from blogger style calls * - * @author Can Bican <can@bican.net> - * + * @author Can Bican */ public class User extends XmlRpcMapped implements StringHeader { + Integer user_id; + String username; + String first_name; + String last_name; + String bio; + String email; String nickname; - - Integer userid; - + String nicename; String url; - - String lastname; - - String firstname; - + String display_name; + Date registered; + List roles; + /** * (non-Javadoc) * - * @see net.bican.wordpress.StringHeader#getStringHeader() + * @see net.bican.wordpress.util.StringHeader#getStringHeader() */ @Override @SuppressWarnings("nls") @@ -39,75 +45,184 @@ public String getStringHeader() { return "First name" + TAB + "Last name" + TAB + "Nick name" + TAB + "Url" + TAB + "User ID"; } - + + /** + * @return the user_id + */ + public final Integer getUser_id() { + return this.user_id; + } + + /** + * @param user_id + * the user_id to set + */ + public final void setUser_id(final Integer user_id) { + this.user_id = user_id; + } + + /** + * @return the username + */ + public final String getUsername() { + return this.username; + } + + /** + * @param username + * the username to set + */ + public final void setUsername(final String username) { + this.username = username; + } + + /** + * @return the first_name + */ + public final String getFirst_name() { + return this.first_name; + } + + /** + * @param first_name + * the first_name to set + */ + public final void setFirst_name(final String first_name) { + this.first_name = first_name; + } + + /** + * @return the last_name + */ + public final String getLast_name() { + return this.last_name; + } + + /** + * @param last_name + * the last_name to set + */ + public final void setLast_name(final String last_name) { + this.last_name = last_name; + } + + /** + * @return the bio + */ + public final String getBio() { + return this.bio; + } + + /** + * @param bio + * the bio to set + */ + public final void setBio(final String bio) { + this.bio = bio; + } + + /** + * @return the email + */ + public final String getEmail() { + return this.email; + } + + /** + * @param email + * the email to set + */ + public final void setEmail(final String email) { + this.email = email; + } + /** * @return the nickname */ - public String getNickname() { + public final String getNickname() { return this.nickname; } - + /** - * @param nickname the nickname to set + * @param nickname + * the nickname to set */ - public void setNickname(String nickname) { + public final void setNickname(final String nickname) { this.nickname = nickname; } - + /** - * @return the userid + * @return the nicename */ - public Integer getUserid() { - return this.userid; + public final String getNicename() { + return this.nicename; } - + /** - * @param userid the userid to set + * @param nicename + * the nicename to set */ - public void setUserid(Integer userid) { - this.userid = userid; + public final void setNicename(final String nicename) { + this.nicename = nicename; } - + /** * @return the url */ - public String getUrl() { + public final String getUrl() { return this.url; } - + /** - * @param url the url to set + * @param url + * the url to set */ - public void setUrl(String url) { + public final void setUrl(final String url) { this.url = url; } - + /** - * @return the lastname + * @return the display_name */ - public String getLastname() { - return this.lastname; + public final String getDisplay_name() { + return this.display_name; } - + /** - * @param lastname the lastname to set + * @param display_name + * the display_name to set */ - public void setLastname(String lastname) { - this.lastname = lastname; + public final void setDisplay_name(final String display_name) { + this.display_name = display_name; } - + /** - * @return the firstname + * @return the registered */ - public String getFirstname() { - return this.firstname; + public final Date getRegistered() { + return this.registered; } - + /** - * @param firstname the firstname to set + * @param registered + * the registered to set */ - public void setFirstname(String firstname) { - this.firstname = firstname; + public final void setRegistered(final Date registered) { + this.registered = registered; + } + + /** + * @return the roles + */ + public final List getRoles() { + return this.roles; + } + + /** + * @param roles + * the roles to set + */ + public final void setRoles(final List roles) { + this.roles = roles; } - } diff --git a/src/net/bican/wordpress/UserBlog.java b/src/net/bican/wordpress/UserBlog.java new file mode 100644 index 0000000..fa109de --- /dev/null +++ b/src/net/bican/wordpress/UserBlog.java @@ -0,0 +1,99 @@ +/* + * + * Wordpress-java + * https://github.com/canbican/wordpress-java/ + * + * Copyright 2012-2015 Can Bican + * See the file 'COPYING' in the distribution for licensing terms. + * + */ +package net.bican.wordpress; + +/** + * The class for keeping user blog entries + * + * @author Can Bican + */ +public class UserBlog extends XmlRpcMapped { + Integer blogid; + String blogName; + String url; + String xmlrpc; + boolean isAdmin; + + /** + * @return the blog id + */ + public Integer getBlogid() { + return this.blogid; + } + + /** + * @param blogid + * blog id to set + */ + public void setBlogid(final Integer blogid) { + this.blogid = blogid; + } + + /** + * @return the blog name + */ + public String getBlogName() { + return this.blogName; + } + + /** + * @param blogName + * blog name to set + */ + public void setBlogName(final String blogName) { + this.blogName = blogName; + } + + /** + * @return the url + */ + public String getUrl() { + return this.url; + } + + /** + * @param url + * url to set + */ + public void setUrl(final String url) { + this.url = url; + } + + /** + * @return the xml rpc url + */ + public String getXmlrpc() { + return this.xmlrpc; + } + + /** + * @param xmlrpc + * xml rpc url to set + */ + public void setXmlrpc(final String xmlrpc) { + this.xmlrpc = xmlrpc; + } + + /** + * @return the admin status + */ + public boolean isAdmin() { + return this.isAdmin; + } + + /** + * @param isAdmin + * admin status to set + */ + public void setAdmin(final boolean isAdmin) { + this.isAdmin = isAdmin; + } + +} diff --git a/src/net/bican/wordpress/Wordpress.java b/src/net/bican/wordpress/Wordpress.java index 6f65f7d..9af8542 100644 --- a/src/net/bican/wordpress/Wordpress.java +++ b/src/net/bican/wordpress/Wordpress.java @@ -1,321 +1,47 @@ /* - * Wordpress-java http://code.google.com/p/wordpress-java/ Copyright 2012 Can - * Bican See the file 'COPYING' in the distribution for - * licensing terms. + * + * Wordpress-java + * https://github.com/canbican/wordpress-java/ + * + * Copyright 2012-2015 Can Bican + * See the file 'COPYING' in the distribution for licensing terms. + * */ package net.bican.wordpress; +import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; -import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.net.MalformedURLException; import java.net.URL; +import java.nio.file.Files; +import java.nio.file.StandardCopyOption; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; +import javax.activation.MimetypesFileTypeMap; + +import net.bican.wordpress.exceptions.FileUploadException; +import net.bican.wordpress.exceptions.InsufficientRightsException; +import net.bican.wordpress.exceptions.InvalidArgumentsException; +import net.bican.wordpress.exceptions.ObjectNotFoundException; import redstone.xmlrpc.XmlRpcArray; import redstone.xmlrpc.XmlRpcFault; import redstone.xmlrpc.XmlRpcProxy; import redstone.xmlrpc.XmlRpcStruct; -@Deprecated -interface BloggerBridge { - /** - * @param blogid - * Blog id, not used in wordpress - * @param username - * User name - * @param password - * Password - * @param post_ID - * Page ID to delete - * @param publish - * Publish status - * @return result of deletion - * @throws XmlRpcFault - * when there is a faulty response from the server - */ - Boolean deletePost(Integer blogid, Integer post_ID, String username, - String password, String publish) throws XmlRpcFault; - - /** - * @param placeHolder - * No reference about what it is in xmlrpc.php, but it's not used - * @param blogid - * Blog id, not used in wordpress - * @param username - * User name - * @param password - * Password - * @param template - * Template, not used in wordpress - * @return Template page - * @throws XmlRpcFault - * when there is a faulty response from the server - */ - String getTemplate(Integer placeHolder, Integer blogid, String username, - String password, String template) throws XmlRpcFault; - - /** - * @param placeHolder - * No reference about what it is in xmlrpc.php, but it's not used - * @param username - * User name - * @param password - * Password - * @return User information - * @throws XmlRpcFault - * when there is a faulty response from the server - */ - XmlRpcStruct getUserInfo(Integer placeHolder, String username, String password) - throws XmlRpcFault; - - /** - * @param placeHolder - * No reference about what it is in xmlrpc.php, but it's not used - * @param username - * User name - * @param password - * Password - * @return Blog that user has - * @throws XmlRpcFault - * when there is a faulty response from the server - */ - XmlRpcArray getUsersBlogs(Integer placeHolder, String username, - String password) throws XmlRpcFault; - - /** - * @param placeHolder - * No reference about what it is in xmlrpc.php, but it's not used - * @param blogid - * Blog id, not used in wordpress - * @param username - * User name - * @param password - * Password - * @param content - * Content of the template - * @param template - * Template, not used in wordpress - * @return Result of the operation - * @throws XmlRpcFault - * when there is a faulty response from the server - */ - Boolean setTemplate(Integer placeHolder, Integer blogid, String username, - String password, String content, String template) throws XmlRpcFault; -} - -interface DemoBridge { - /** - * @param number1 - * first number - * @param number2 - * second number - * @return addition of the arguments - * @throws XmlRpcFault - * when there is a faulty response from the server - */ - Double addTwoNumbers(Double number1, Double number2) throws XmlRpcFault; - - /** - * @return A very important message - * @throws XmlRpcFault - * when there is a faulty response from the server - */ - String sayHello() throws XmlRpcFault; -} - -@Deprecated -interface MetaWebLogBridge { - /** - * @param post_ID - * ID of the post to edit - * @param username - * User name - * @param password - * Password - * @param post - * Page information - * @param publish - * Post status - * @return result of edit - * @throws XmlRpcFault - * when there is a faulty response from the server - */ - Boolean editPost(Integer post_ID, String username, String password, - XmlRpcStruct post, String publish) throws XmlRpcFault; - - /** - * @param post_ID - * ID of the post to retrieve - * @param username - * User name - * @param password - * Password - * @return Page information - * @throws XmlRpcFault - * when there is a faulty response from the server - */ - XmlRpcStruct getPost(Integer post_ID, String username, String password) - throws XmlRpcFault; - - /** - * @param blogid - * Blog id (not used in wordpress) - * @param username - * User name - * @param password - * Password - * @param num_posts - * Number of posts to retrieve - * @return List of pages - * @throws XmlRpcFault - * when there is a faulty response from the server - */ - XmlRpcArray getRecentPosts(Integer blogid, String username, String password, - Integer num_posts) throws XmlRpcFault; - - /** - * @param blogid - * Blog id (not used in wordpress) - * @param username - * User name - * @param password - * Password - * @param data - * Data Structure (type,bits,overwrite) - * @return result of the upload - * @throws XmlRpcFault - * when there is a faulty response from the server - */ - XmlRpcStruct newMediaObject(Integer blogid, String username, String password, - XmlRpcStruct data) throws XmlRpcFault; - - /** - * @param blogid - * Blog id (not used in wordpress) - * @param username - * User name - * @param password - * Password - * @param post - * Post structure - * @param publish - * Publish status - * @return post id - * @throws XmlRpcFault - * when there is a faulty response from the server - */ - String newPost(Integer blogid, String username, String password, - XmlRpcStruct post, Boolean publish) throws XmlRpcFault; -} - -interface MovableTypeBridge { - /** - * @return List of methods the server supports - * @throws XmlRpcFault - * when there is a faulty response from the server - */ - XmlRpcArray supportedMethods() throws XmlRpcFault; - - /** - * @return List of supported text filters - * @throws XmlRpcFault - * when there is a faulty response from the server - */ - @Deprecated - XmlRpcArray supportedTextFilters() throws XmlRpcFault; - - /** - * @param PostId - * Post id - * @return List of trackbacks for the post - * @throws XmlRpcFault - * when there is a faulty response from the server - */ - XmlRpcArray getTrackbackPings(Integer PostId) throws XmlRpcFault; -} - -interface PingbackBridge { - /** - * @param pagelinkedfrom - * Source - * @param pagelinkedto - * Destination - * @return response string - * @throws XmlRpcFault - * when there is a faulty response from the server - */ - String ping(String pagelinkedfrom, String pagelinkedto) throws XmlRpcFault; -} - -interface PingbackExtensionsBridge { - /** - * @param url - * url of the page queried - * @return Array of URLs - * @throws XmlRpcFault - * when there is a faulty response from the server - */ - XmlRpcArray getPingbacks(String url) throws XmlRpcFault; -} - /** * The utility class that links xmlrpc calls to Java functions. * - * @author Can Bican <can@bican.net> + * @author Can Bican */ public class Wordpress { - private static byte[] getBytesFromFile(File file) { - byte[] result = null; - try (InputStream is = new FileInputStream(file)) { - - // Get the size of the file - long length = file.length(); - - // You cannot create an array using a long type. - // It needs to be an int type. - // Before converting to an int type, check - // to ensure that file is not larger than Integer.MAX_VALUE. - if (length > Integer.MAX_VALUE) { - // File is too large - } - - // Create the byte array to hold the data - byte[] bytes = new byte[(int) length]; - - // Read in the bytes - int offset = 0; - int numRead = 0; - while (offset < bytes.length - && (numRead = is.read(bytes, offset, bytes.length - offset)) >= 0) { - offset += numRead; - } - - // Ensure all the bytes have been read in - if (offset < bytes.length) { - throw new IOException( - "Could not completely read file " + file.getName()); //$NON-NLS-1$ - } - result = bytes; - } catch (FileNotFoundException e) { - e.printStackTrace(); - } catch (IOException e) { - e.printStackTrace(); - } - return result; - } - - private BloggerBridge blogger; - - private DemoBridge demo = null; - - private MovableTypeBridge mt = null; - - private MetaWebLogBridge mw = null; + private static final Integer BLOGID = Integer.valueOf(0); private String password = null; @@ -344,7 +70,7 @@ private Wordpress() { * @throws MalformedURLException * If the URL is faulty */ - public Wordpress(String username, String password, String xmlRpcUrl) + public Wordpress(final String username, final String password, final String xmlRpcUrl) throws MalformedURLException { this.username = username; this.password = password; @@ -352,98 +78,14 @@ public Wordpress(String username, String password, String xmlRpcUrl) initMetaWebLog(); } - /** - * @param number1 - * First number - * @param number2 - * Second number - * @return addition of two numbers - * @throws XmlRpcFault - * Generic exception for xml-rpc operations - */ - @SuppressWarnings("boxing") - public double addTwoNumbers(double number1, double number2) - throws XmlRpcFault { - return this.demo.addTwoNumbers(number1, number2); - } - - /** - * @param post_ID - * ID of the page to delete - * @param publish - * Publish status - * @return Result of deletion - * @throws XmlRpcFault - * Generic exception for xml-rpc operations - */ - @SuppressWarnings("boxing") - public Boolean deletePage(int post_ID, String publish) throws XmlRpcFault { - return this.wp.deletePage(0, this.username, this.password, - Integer.valueOf(post_ID), publish); - } - - /** - * @param post_ID - * ID of the post to delete - * @param publish - * Publish status - * @return result of deletion - * @throws XmlRpcFault - * Generic exception for xml-rpc operations - */ - @SuppressWarnings("boxing") - @Deprecated - public Boolean deletePost(int post_ID, String publish) throws XmlRpcFault { - return this.blogger.deletePost(0, post_ID, this.username, this.password, - publish); - } - - /** - * @param post_ID - * ID of the post to edit - * @param page - * Page information - * @param publish - * Publish status - * @return Result of edit - * @throws XmlRpcFault - * Generic exception for xml-rpc operations - */ - @SuppressWarnings("boxing") - public Boolean editPage(int post_ID, Page page, String publish) - throws XmlRpcFault { - XmlRpcStruct post = page.toXmlRpcStruct(); - return this.wp.editPage(0, post_ID, this.username, this.password, post, - publish); - } - - /** - * @param post_ID - * ID of the post to edit - * @param page - * Page information - * @param publish - * Publish status - * @return result of edit - * @throws XmlRpcFault - * Generic exception for xml-rpc operations - */ - @SuppressWarnings("boxing") - public Boolean editPost(int post_ID, Page page, String publish) - throws XmlRpcFault { - XmlRpcStruct post = page.toXmlRpcStruct(); - return this.mw.editPost(post_ID, this.username, this.password, post, - publish); - } - @SuppressWarnings("unchecked") private static List fillFromXmlRpcArray( - XmlRpcArray r, Class cl, T item) { + final XmlRpcArray r, final Class cl, final T item) { List result = null; try { result = new ArrayList<>(); - for (Object o : r) { - XmlRpcMapped n = cl.newInstance(); + for (final Object o : r) { + final XmlRpcMapped n = cl.newInstance(); if (o instanceof String) { result.add((T) o); // TODO ??? mükerrer? } else { @@ -451,94 +93,14 @@ private static List fillFromXmlRpcArray( } result.add((T) n); } - } catch (InstantiationException e) { + } catch (final InstantiationException e) { e.printStackTrace(); - } catch (IllegalAccessException e) { + } catch (final IllegalAccessException e) { e.printStackTrace(); } return result; } - @SuppressWarnings("static-method") - private List fromStringArray(XmlRpcArray r) { - List result; - result = new ArrayList<>(); - for (Object object : r) { - result.add((String) object); - } - return result; - } - - /** - * @return List of authors - * @throws XmlRpcFault - * Generic exception for xml-rpc operations - */ - public List getAuthors() throws XmlRpcFault { - XmlRpcArray r = this.wp.getAuthors(0, this.username, this.password); - return fillFromXmlRpcArray(r, Author.class, new Author()); - } - - /** - * @return List of categories - * @throws XmlRpcFault - * Generic exception for xml-rpc operations - */ - public List getCategories() throws XmlRpcFault { - XmlRpcArray r = this.wp.getCategories(0, this.username, this.password); - return fillFromXmlRpcArray(r, Category.class, new Category()); - } - - /** - * @param pageid - * Page ID - * @return The Page object. - * @throws XmlRpcFault - * Generic exception for xml-rpc operations - */ - @SuppressWarnings("boxing") - public Page getPage(int pageid) throws XmlRpcFault { - XmlRpcStruct r = this.wp.getPage(0, pageid, this.username, this.password); - Page result = new Page(); - result.fromXmlRpcStruct(r); - return result; - } - - /** - * @return List of Pages, short format - * @throws XmlRpcFault - * Generic exception for xml-rpc operations - */ - @SuppressWarnings("boxing") - public List getPageList() throws XmlRpcFault { - XmlRpcArray r = this.wp.getPageList(0, this.username, this.password); - return fillFromXmlRpcArray(r, PageDefinition.class, new PageDefinition()); - } - - /** - * @return List of Pages, in full format - * @throws XmlRpcFault - * Generic exception for xml-rpc operations - */ - @SuppressWarnings("boxing") - public List getPages() throws XmlRpcFault { - XmlRpcArray r = this.wp.getPages(0, this.username, this.password); - return fillFromXmlRpcArray(r, Page.class, new Page()); - } - - /** - * @param postId - * Post ID - * @return Trackbacks for the post - * @throws XmlRpcFault - * Generic exception for xml-rpc operations - */ - @SuppressWarnings("boxing") - public List getTrackbackPings(int postId) throws XmlRpcFault { - XmlRpcArray r = this.mt.getTrackbackPings(postId); - return fillFromXmlRpcArray(r, Ping.class, new Ping()); - } - /** * @param url * Url of the page queried @@ -546,184 +108,32 @@ public List getTrackbackPings(int postId) throws XmlRpcFault { * @throws XmlRpcFault * Generic exception for xml-rpc operations */ - public List getPingbacks(String url) throws XmlRpcFault { + public List getPingbacks(final String url) throws XmlRpcFault { List result = null; try { - XmlRpcArray r = this.pingbackExt.getPingbacks(url); + final XmlRpcArray r = this.pingbackExt.getPingbacks(url); result = new ArrayList<>(); - for (Object rec : r) { + for (final Object rec : r) { result.add(new URL((String) rec)); } - } catch (MalformedURLException e) { + } catch (final MalformedURLException e) { e.printStackTrace(); } return result; } - /** - * @param post_ID - * ID of the post to retrieve - * @return Page information - * @throws XmlRpcFault - * Generic exception for xml-rpc operations - */ - @SuppressWarnings("boxing") - public Page getPost(int post_ID) throws XmlRpcFault { - XmlRpcStruct r = this.mw.getPost(post_ID, this.username, this.password); - Page result = new Page(); - result.fromXmlRpcStruct(r); - return result; - } - - /** - * @param num_posts - * Number of posts to be retrieved. - * @return List of pages. - * @throws XmlRpcFault - * Generic exception for xml-rpc operations - */ - @SuppressWarnings("boxing") - public List getRecentPosts(int num_posts) throws XmlRpcFault { - XmlRpcArray r = this.mw.getRecentPosts(0, this.username, this.password, - num_posts); - return fillFromXmlRpcArray(r, Page.class, new Page()); - } - - /** - * @return Template page - * @throws XmlRpcFault - * Generic exception for xml-rpc operations - */ - @SuppressWarnings({ "boxing", "nls" }) - @Deprecated - public String getTemplate() throws XmlRpcFault { - return this.blogger.getTemplate(0, 0, this.username, this.password, ""); - } - - /** - * @return The user information - * @throws XmlRpcFault - * Generic exception for xml-rpc operations - */ - @SuppressWarnings("boxing") - @Deprecated - public User getUserInfo() throws XmlRpcFault { - XmlRpcStruct r = this.blogger.getUserInfo(0, this.username, this.password); - User result = new User(); - result.fromXmlRpcStruct(r); - return result; - } - - /** - * @return List of blogs the user has (only one in wordpress case) - * @throws XmlRpcFault - * Generic exception for xml-rpc operations - */ - @SuppressWarnings("boxing") - @Deprecated - public List getUsersBlogs() throws XmlRpcFault { - XmlRpcArray r = this.blogger.getUsersBlogs(0, this.username, this.password); - return fillFromXmlRpcArray(r, Blog.class, new Blog()); - } - @SuppressWarnings("nls") private void initMetaWebLog() throws MalformedURLException { final URL url = new URL(this.xmlRpcUrl); this.wp = (WordpressBridge) XmlRpcProxy.createProxy(url, "wp", new Class[] { WordpressBridge.class }, true); - this.mw = (MetaWebLogBridge) XmlRpcProxy.createProxy(url, "metaWeblog", - new Class[] { MetaWebLogBridge.class }, true); - this.mt = (MovableTypeBridge) XmlRpcProxy.createProxy(url, "mt", - new Class[] { MovableTypeBridge.class }, true); - this.demo = (DemoBridge) XmlRpcProxy.createProxy(url, "demo", - new Class[] { DemoBridge.class }, true); this.pingback = (PingbackBridge) XmlRpcProxy.createProxy(url, "pingback", new Class[] { PingbackBridge.class }, true); - this.blogger = (BloggerBridge) XmlRpcProxy.createProxy(url, "blogger", - new Class[] { BloggerBridge.class }, true); this.pingbackExt = (PingbackExtensionsBridge) XmlRpcProxy.createProxy(url, "pingback.extensions", new Class[] { PingbackExtensionsBridge.class }, true); } - /** - * @param name - * Category name - * @param slug - * Category short name - * @param parentId - * Parent ID - * @return New category id - * @throws XmlRpcFault - * Generic exception for xml-rpc operations - */ - @SuppressWarnings({ "unchecked", "nls", "boxing" }) - public int newCategory(String name, String slug, int parentId) - throws XmlRpcFault { - XmlRpcStruct h = new XmlRpcStruct(); - h.put("name", name); - h.put("slug", slug); - h.put("parent_id", parentId); - return this.wp.newCategory(0, this.username, this.password, h); - } - - /** - * @param mimeType - * Mime type of the file - * @param file - * File name - * @param overwrite - * true/false - * @return new object location - * @throws XmlRpcFault - * Generic exception for xml-rpc operations - */ - @SuppressWarnings("boxing") - @Deprecated - public MediaObject newMediaObject(String mimeType, File file, - Boolean overwrite) throws XmlRpcFault { - Attachment att = new Attachment(); - att.setType(mimeType); - att.setOverwrite(overwrite); - att.setName(file.getName()); - att.setBits(getBytesFromFile(file)); - XmlRpcStruct d = att.toXmlRpcStruct(); - XmlRpcStruct r = this.mw.newMediaObject(0, this.username, this.password, d); - MediaObject result = new MediaObject(); - result.fromXmlRpcStruct(r); - return result; - } - - /** - * @param post - * Page information - * @param publish - * Publish status - * @return Post ID - * @throws XmlRpcFault - * Generic exception for xml-rpc operations - */ - @SuppressWarnings("boxing") - public String newPage(Page post, String publish) throws XmlRpcFault { - return this.wp.newPage(0, this.username, this.password, - post.toXmlRpcStruct(), publish); - } - - /** - * @param page - * Post information - * @param publish - * Publish status - * @return Post id - * @throws XmlRpcFault - * Generic exception for xml-rpc operations - */ - @SuppressWarnings("boxing") - public String newPost(Page page, boolean publish) throws XmlRpcFault { - return this.mw.newPost(0, this.username, this.password, - page.toXmlRpcStruct(), publish); - } - /** * @param pagelinkedfrom * Source @@ -733,124 +143,42 @@ public String newPost(Page page, boolean publish) throws XmlRpcFault { * @throws XmlRpcFault * Generic exception for xml-rpc operations */ - public String ping(String pagelinkedfrom, String pagelinkedto) + public String ping(final String pagelinkedfrom, final String pagelinkedto) throws XmlRpcFault { return this.pingback.ping(pagelinkedfrom, pagelinkedto); } /** - * @return A very important message - * @throws XmlRpcFault - * Generic exception for xml-rpc operations - */ - public String sayHello() throws XmlRpcFault { - return this.demo.sayHello(); - } - - /** - * @param content - * Content of the template - * @return Result of the operation - * @throws XmlRpcFault - * Generic exception for xml-rpc operations - */ - @SuppressWarnings({ "boxing", "nls" }) - @Deprecated - public boolean setTemplate(String content) throws XmlRpcFault { - return this.blogger.setTemplate(0, 0, this.username, this.password, - content, ""); - } - - /** - * @param category - * Category to search - * @param max_results - * Maximum results to return - * @return List of suggested categories - * @throws XmlRpcFault - * Generic exception for xml-rpc operations - */ - @SuppressWarnings("static-method") - public List suggestCategories(String category, Integer max_results) - throws XmlRpcFault { - throw new UnsupportedOperationException(); // couldn't quite figure out the - // response. - } - - /** - * @return List of supported methods - * @throws XmlRpcFault - * Generic exception for xml-rpc operations - */ - public List supportedMethods() throws XmlRpcFault { - return fromStringArray(this.mt.supportedMethods()); - } - - /** - * @return List of supported text filters - * @throws XmlRpcFault - * Generic exception for xml-rpc operations - */ - public List supportedTextFilters() throws XmlRpcFault { - return fromStringArray(this.mt.supportedTextFilters()); - } - - /** - * @return List of supported post status values - * @throws XmlRpcFault - * Generic exception for xml-rpc operations - */ - @SuppressWarnings("boxing") - public List getPostStatusList() throws XmlRpcFault { - return processKeyValList(this.wp.getPostStatusList(0, this.username, - this.password)); - } - - /** - * @return List of supported page status values - * @throws XmlRpcFault - * Generic exception for xml-rpc operations - */ - @SuppressWarnings("boxing") - public List getPageStatusList() throws XmlRpcFault { - return processKeyValList(this.wp.getPageStatusList(0, this.username, - this.password)); - } - - @SuppressWarnings({ "static-method", "nls" }) - private List processKeyValList(XmlRpcStruct r) { - String response = r.toString(); - response = response.replaceAll("[{}]", "").replaceAll(", *", ","); - String[] responses = response.split(","); - List result = new ArrayList<>(); - for (String rp : responses) { - String[] keyval = rp.split("="); - PostAndPageStatus pp = new PostAndPageStatus(); - pp.setStatus(keyval[0]); - pp.setDescription(keyval[1]); - result.add(pp); - } - return result; - } - - /** - * @param post_ID + * @param postId * Blog Post ID * @return Number of comments (approved, spam, otherwise) * @throws XmlRpcFault - * Generic exception for xml-rpc operations + * if there is a generic error during request + * @throws InsufficientRightsException + * if the user does not have the edit_posts cap */ - @SuppressWarnings("boxing") - public CommentCount getCommentsCount(Integer post_ID) throws XmlRpcFault { - XmlRpcStruct struct; - if (post_ID != -1) - struct = this.wp - .getCommentCount(0, this.username, this.password, post_ID); - else - struct = this.wp.getCommentCount(0, this.username, this.password); - CommentCount cc = new CommentCount(); - cc.fromXmlRpcStruct(struct); - return cc; + public CommentCount getCommentsCount(final Integer postId) + throws XmlRpcFault, InsufficientRightsException { + try { + XmlRpcStruct struct; + if (postId.intValue() != -1) { + struct = this.wp.getCommentCount(BLOGID, this.username, this.password, + postId); + } else { + struct = this.wp.getCommentCount(BLOGID, this.username, this.password); + } + final CommentCount cc = new CommentCount(); + cc.fromXmlRpcStruct(struct); + return cc; + } catch (final XmlRpcFault e) { + final int err = e.getErrorCode(); + switch (err) { + case 403: + throw new InsufficientRightsException(); + default: + throw e; + } + } } /** @@ -863,52 +191,73 @@ public CommentCount getCommentsCount(Integer post_ID) throws XmlRpcFault { * @param offset * The offset into the set of comments to return, or null for 0 * @return A list of Comment objects + * @throws InsufficientRightsException + * if the user does not have the moderate_comments cap * @throws XmlRpcFault - * Generic exception for xml-rpc operations + * if there is a generic error during request */ - @SuppressWarnings({ "unchecked", "boxing" }) - public List getComments(String status, Integer post_id, - Integer number, Integer offset) throws XmlRpcFault { - - XmlRpcStruct filter = new XmlRpcStruct(); - - if (status != null) { - filter.put("status", status); //$NON-NLS-1$ - } - - if (post_id != null) { - filter.put("post_id", post_id); //$NON-NLS-1$ - } - - if (number != null) { - filter.put("number", number); //$NON-NLS-1$ - } - - if (offset != null) { - filter.put("offset", offset); //$NON-NLS-1$ + @SuppressWarnings({ "unchecked" }) + public List getComments(final String status, final Integer post_id, + final Integer number, final Integer offset) + throws InsufficientRightsException, XmlRpcFault { + try { + final XmlRpcStruct filter = new XmlRpcStruct(); + if (status != null) { + filter.put("status", status); //$NON-NLS-1$ + } + if (post_id != null) { + filter.put("post_id", post_id); //$NON-NLS-1$ + } + if (number != null) { + filter.put("number", number); //$NON-NLS-1$ + } + if (offset != null) { + filter.put("offset", offset); //$NON-NLS-1$ + } + final XmlRpcArray r = this.wp.getComments(BLOGID, this.username, this.password, + filter); + return fillFromXmlRpcArray(r, Comment.class, new Comment()); + } catch (final XmlRpcFault e) { + final int err = e.getErrorCode(); + switch (err) { + case 401: + throw new InsufficientRightsException(); + default: + throw e; + } } - - XmlRpcArray r = this.wp - .getComments(0, this.username, this.password, filter); - return fillFromXmlRpcArray(r, Comment.class, new Comment()); } /** * @param comment_id * comment_id to fetch * @return A Comment object + * @throws InsufficientRightsException + * if the user does not have the moderate_comments cap + * @throws ObjectNotFoundException + * if no comment with that comment_id exists * @throws XmlRpcFault - * Generic exception for xml-rpc operations + * if there is a generic error during request */ - @SuppressWarnings("boxing") - public Comment getComment(Integer comment_id) throws XmlRpcFault { - XmlRpcStruct struct = this.wp.getComment(0, this.username, this.password, - comment_id); - - Comment comment = new Comment(); - comment.fromXmlRpcStruct(struct); - - return comment; + public Comment getComment(final Integer comment_id) + throws XmlRpcFault, InsufficientRightsException, ObjectNotFoundException { + try { + final XmlRpcStruct struct = this.wp.getComment(BLOGID, this.username, + this.password, comment_id); + final Comment comment = new Comment(); + comment.fromXmlRpcStruct(struct); + return comment; + } catch (final XmlRpcFault e) { + final int err = e.getErrorCode(); + switch (err) { + case 403: + throw new InsufficientRightsException(); + case 404: + throw new ObjectNotFoundException(); + default: + throw e; + } + } } /** @@ -925,41 +274,60 @@ public Comment getComment(Integer comment_id) throws XmlRpcFault { * @param author_email * Author's Email Address * @return the id for the newly created comment. + * @throws InsufficientRightsException + * if anonymous comments are disallowed and invalid credentials are + * supplied, or if comment does not follow required comment fields + * configuration. + * @throws ObjectNotFoundException + * if no post with that post_id exists * @throws XmlRpcFault - * Generic exception for xml-rpc operations + * if there is a generic error during request */ - @SuppressWarnings({ "unchecked", "nls", "boxing" }) - public Integer newComment(Integer post_id, Integer comment_parent, - String content, String author, String author_url, String author_email) - throws XmlRpcFault { - - XmlRpcStruct comment = new XmlRpcStruct(); - - if (comment_parent != null) { - comment.put("comment_parent", comment_parent); + @SuppressWarnings({ "unchecked", "nls" }) + public Integer newComment(final Integer post_id, final Integer comment_parent, + final String content, final String author, final String author_url, final String author_email) + throws InsufficientRightsException, ObjectNotFoundException, + XmlRpcFault { + try { + final XmlRpcStruct comment = new XmlRpcStruct(); + if (comment_parent != null) { + comment.put("comment_parent", comment_parent); + } + comment.put("content", content); + if (author != null) { + comment.put("author", author); + } + if (author_url != null) { + comment.put("author_url", author_url); + } + if (author_email != null) { + comment.put("author_email", author_email); + } + final Integer comment_id = this.wp.newComment(BLOGID, this.username, + this.password, post_id, comment); + return comment_id; + } catch (final XmlRpcFault e) { + final int err = e.getErrorCode(); + switch (err) { + case 403: + throw new InsufficientRightsException(); + case 404: + throw new ObjectNotFoundException(); + default: + throw e; + } } - - comment.put("content", content); - if (author != null) - comment.put("author", author); - if (author_url != null) - comment.put("author_url", author_url); - if (author_email != null) - comment.put("author_email", author_email); - - Integer comment_id = this.wp.newComment(0, this.username, this.password, - post_id, comment); - - return comment_id; } /** * @return the comment status list + * @throws XmlRpcFault + * if there is a generic error during request */ - public CommentStatusList getCommentStatusList() { - XmlRpcStruct csl = this.wp.getCommentStatusList(0, this.username, + public CommentStatusList getCommentStatusList() throws XmlRpcFault { + final XmlRpcStruct csl = this.wp.getCommentStatusList(BLOGID, this.username, this.password); - CommentStatusList result = new CommentStatusList(); + final CommentStatusList result = new CommentStatusList(); result.fromXmlRpcStruct(csl); return result; } @@ -968,50 +336,76 @@ public CommentStatusList getCommentStatusList() { * @param commentID * comment id to delete * @return result of the operation + * @throws InsufficientRightsException + * if the user does not have the moderate_comments cap or if the + * user does not have permission to edit this comment + * @throws ObjectNotFoundException + * if no comment with that comment_id exists * @throws XmlRpcFault - * when there is a faulty response from the server + * if there is a generic error during request */ - @SuppressWarnings("boxing") - public boolean deleteComment(int commentID) throws XmlRpcFault { - return this.wp.deleteComment(0, this.username, this.password, commentID); + public boolean deleteComment(final Integer commentID) + throws InsufficientRightsException, ObjectNotFoundException, XmlRpcFault { + try { + return this.wp + .deleteComment(BLOGID, this.username, this.password, commentID) + .booleanValue(); + } catch (final XmlRpcFault e) { + final int err = e.getErrorCode(); + switch (err) { + case 403: + throw new InsufficientRightsException(); + case 404: + throw new ObjectNotFoundException(); + default: + throw e; + } + } } /** * @param comment * edited form of the comment object * @return Result of the operation + * @throws InvalidArgumentsException + * if status is not a valid comment status + * @throws InsufficientRightsException + * if the user does not have the moderate_comments cap or if the + * user does not have permission to edit this comment. + * @throws ObjectNotFoundException + * if no comment with that comment_id exists * @throws XmlRpcFault - * when there is a faulty response from the server - */ - @SuppressWarnings("boxing") - public boolean editComment(Comment comment) throws XmlRpcFault { - Boolean r = this.wp.editComment(0, this.username, this.password, - comment.getComment_id(), comment); - return r; - } - - /** - * @param categoryId - * category id to delete - * @return Result of the operation - * @throws XmlRpcFault - * when there is a faulty response from the server + * if there is a generic error during request */ - @SuppressWarnings("boxing") - public int deleteCategory(int categoryId) throws XmlRpcFault { - Object r = this.wp.deleteCategory(0, this.username, this.password, - categoryId); - if (r instanceof Boolean) - return 0; - return (Integer) r; + public boolean editComment(final Comment comment) throws InvalidArgumentsException, + InsufficientRightsException, ObjectNotFoundException, XmlRpcFault { + Boolean r; + try { + r = this.wp.editComment(BLOGID, this.username, this.password, + comment.getComment_id(), comment); + return r.booleanValue(); + } catch (final XmlRpcFault e) { + final int err = e.getErrorCode(); + switch (err) { + case 401: + throw new InvalidArgumentsException(); + case 403: + throw new InsufficientRightsException(); + case 404: + throw new ObjectNotFoundException(); + default: + throw e; + } + } } /** * @return the taxonomies + * @throws XmlRpcFault + * when there is an error with the request */ - @SuppressWarnings("boxing") - public List getTaxonomies() { - XmlRpcArray r = this.wp.getTaxonomies(0, this.username, this.password); + public List getTaxonomies() throws XmlRpcFault { + final XmlRpcArray r = this.wp.getTaxonomies(BLOGID, this.username, this.password); return fillFromXmlRpcArray(r, Taxonomy.class, new Taxonomy()); } @@ -1019,22 +413,49 @@ public List getTaxonomies() { * @param taxonomy * taxonomy to get * @return the taxonomy + * @throws InsufficientRightsException + * if the user does not have the assign_terms cap for this taxonomy + * @throws InvalidArgumentsException + * if invalid taxonomy name is specified + * @throws XmlRpcFault + * if there is a generic error during request */ - @SuppressWarnings("boxing") - public Taxonomy getTaxonomy(String taxonomy) { - XmlRpcStruct r = this.wp.getTaxonomy(0, this.username, this.password, - taxonomy); - Taxonomy t = new Taxonomy(); - t.fromXmlRpcStruct(r); - return t; + public Taxonomy getTaxonomy(final String taxonomy) + throws InsufficientRightsException, InvalidArgumentsException, + XmlRpcFault { + try { + final XmlRpcStruct r = this.wp.getTaxonomy(BLOGID, this.username, this.password, + taxonomy); + final Taxonomy t = new Taxonomy(); + t.fromXmlRpcStruct(r); + return t; + } catch (final XmlRpcFault e) { + final int err = e.getErrorCode(); + switch (err) { + case 401: + throw new InsufficientRightsException(); + case 403: + throw new InvalidArgumentsException(taxonomy); + default: + throw e; + } + } } /** * @param taxonomy * taxonomy name * @return the list of terms + * @throws InsufficientRightsException + * if the user does not have the assign_terms cap for this taxonomy + * @throws InvalidArgumentsException + * if invalid taxonomy name is specified + * @throws XmlRpcFault + * if there is a generic error during request */ - public List getTerms(String taxonomy) { + public List getTerms(final String taxonomy) + throws InsufficientRightsException, InvalidArgumentsException, + XmlRpcFault { return this.getTerms(taxonomy, null); } @@ -1044,13 +465,33 @@ public List getTerms(String taxonomy) { * @param filter * term filter * @return the list of terms + * @throws InsufficientRightsException + * if the user does not have the assign_terms cap for this taxonomy + * @throws InvalidArgumentsException + * if invalid taxonomy name is specified + * @throws XmlRpcFault + * if there is a generic error during request */ - @SuppressWarnings("boxing") - public List getTerms(String taxonomy, TermFilter filter) { - XmlRpcArray r = (filter != null) ? this.wp.getTerms(0, this.username, - this.password, taxonomy, filter.toXmlRpcStruct()) : this.wp.getTerms(0, - this.username, this.password, taxonomy); - return fillFromXmlRpcArray(r, Term.class, new Term()); + public List getTerms(final String taxonomy, final TermFilter filter) + throws InsufficientRightsException, InvalidArgumentsException, + XmlRpcFault { + try { + final XmlRpcArray r = filter != null + ? this.wp.getTerms(BLOGID, this.username, this.password, taxonomy, + filter.toXmlRpcStruct()) + : this.wp.getTerms(BLOGID, this.username, this.password, taxonomy); + return fillFromXmlRpcArray(r, Term.class, new Term()); + } catch (final XmlRpcFault e) { + final int err = e.getErrorCode(); + switch (err) { + case 401: + throw new InsufficientRightsException(); + case 403: + throw new InvalidArgumentsException(taxonomy); + default: + throw e; + } + } } /** @@ -1059,26 +500,67 @@ public List getTerms(String taxonomy, TermFilter filter) { * @param termId * term id * @return the term + * @throws InsufficientRightsException + * if the user does not have the assign_terms cap for this taxonomy + * @throws InvalidArgumentsException + * if invalid taxonomy name is specified + * @throws ObjectNotFoundException + * if the term id is not found + * @throws XmlRpcFault + * if there is a generic error during request */ - @SuppressWarnings("boxing") - public Term getTerm(String taxonomy, Integer termId) { - XmlRpcStruct r = this.wp.getTerm(0, this.username, this.password, taxonomy, - termId); - Term t = new Term(); - t.fromXmlRpcStruct(r); - return t; + public Term getTerm(final String taxonomy, final Integer termId) + throws InsufficientRightsException, InvalidArgumentsException, + ObjectNotFoundException, XmlRpcFault { + try { + final XmlRpcStruct r = this.wp.getTerm(BLOGID, this.username, this.password, + taxonomy, termId); + final Term t = new Term(); + t.fromXmlRpcStruct(r); + return t; + } catch (final XmlRpcFault e) { + final int err = e.getErrorCode(); + switch (err) { + case 401: + throw new InsufficientRightsException(); + case 403: + throw new InvalidArgumentsException(taxonomy); + case 404: + throw new ObjectNotFoundException(termId.toString()); + default: + throw e; + } + } } /** * @param term * new term * @return the term id + * @throws InsufficientRightsException + * if the user does not have the assign_terms cap for this taxonomy + * @throws InvalidArgumentsException + * if invalid taxonomy name is specified + * @throws XmlRpcFault + * if there is a generic error during request */ - @SuppressWarnings("boxing") - public Integer newTerm(Term term) { - String r = this.wp.newTerm(0, this.username, this.password, - term.toXmlRpcStruct()); - return Integer.valueOf(r); + public Integer newTerm(final Term term) throws InsufficientRightsException, + InvalidArgumentsException, XmlRpcFault { + try { + final String r = this.wp.newTerm(BLOGID, this.username, this.password, + term.toXmlRpcStruct()); + return Integer.valueOf(r); + } catch (final XmlRpcFault e) { + final int err = e.getErrorCode(); + switch (err) { + case 401: + throw new InsufficientRightsException(); + case 403: + throw new InvalidArgumentsException(term.getTaxonomy()); + default: + throw e; + } + } } /** @@ -1086,13 +568,31 @@ public Integer newTerm(Term term) { * taxonomy name * @param termId * term id - * @return result of the operation + * @return the result of the operation + * @throws InsufficientRightsException + * if the user does not have the assign_terms cap for this taxonomy + * @throws XmlRpcFault + * if there is a generic error during request + * @throws XmlRpcFault + * if there is a generic error during request */ - @SuppressWarnings("boxing") - public boolean deleteTerm(String taxonomy, Integer termId) { - Boolean r = this.wp.deleteTerm(0, this.username, this.password, taxonomy, - termId); - return r.booleanValue(); + public boolean deleteTerm(final String taxonomy, final Integer termId) + throws InsufficientRightsException, XmlRpcFault { + try { + final Boolean r = this.wp.deleteTerm(BLOGID, this.username, this.password, + taxonomy, termId); + return r.booleanValue(); + } catch (final XmlRpcFault e) { + final int err = e.getErrorCode(); + switch (err) { + case 401: + throw new InsufficientRightsException(); + case 404: + return false; + default: + throw e; + } + } } /** @@ -1101,28 +601,62 @@ public boolean deleteTerm(String taxonomy, Integer termId) { * @param content * new contents * @return the result of the operation + * @throws InsufficientRightsException + * if the user does not have the assign_terms cap for this taxonomy + * @throws InvalidArgumentsException + * if invalid taxonomy name is specified + * @throws ObjectNotFoundException + * if the term id is not found + * @throws XmlRpcFault + * if there is a generic error during request */ - @SuppressWarnings({ "unchecked", "boxing" }) - public boolean editTerm(Integer termId, Term content) { - XmlRpcStruct datar = new XmlRpcStruct(); - datar.put("taxonomy", content.getTaxonomy()); //$NON-NLS-1$ - if (content.getName() != null) - datar.put("name", content.getName()); //$NON-NLS-1$ - if (content.getSlug() != null) - datar.put("slug", content.getSlug()); //$NON-NLS-1$ - if (content.getDescription() != null) - datar.put("description", content.getDescription()); //$NON-NLS-1$ - if (content.getParent() != null) - datar.put("parent", content.getParent()); //$NON-NLS-1$ - Boolean r = this.wp - .editTerm(0, this.username, this.password, termId, datar); - return r.booleanValue(); + @SuppressWarnings({ "unchecked" }) + public boolean editTerm(final Integer termId, final Term content) + throws InsufficientRightsException, InvalidArgumentsException, + ObjectNotFoundException, XmlRpcFault { + try { + final XmlRpcStruct datar = new XmlRpcStruct(); + datar.put("taxonomy", content.getTaxonomy()); //$NON-NLS-1$ + if (content.getName() != null) + { + datar.put("name", content.getName()); //$NON-NLS-1$ + } + if (content.getSlug() != null) + { + datar.put("slug", content.getSlug()); //$NON-NLS-1$ + } + if (content.getDescription() != null) + { + datar.put("description", content.getDescription()); //$NON-NLS-1$ + } + if (content.getParent() != null) + { + datar.put("parent", content.getParent()); //$NON-NLS-1$ + } + final Boolean r = this.wp.editTerm(BLOGID, this.username, this.password, termId, + datar); + return r.booleanValue(); + } catch (final XmlRpcFault e) { + final int err = e.getErrorCode(); + switch (err) { + case 401: + throw new InsufficientRightsException(); + case 403: + throw new InvalidArgumentsException(content.getTaxonomy()); + case 404: + throw new ObjectNotFoundException(termId.toString()); + default: + throw e; + } + } } /** * @return the list of options + * @throws XmlRpcFault + * if there is a generic error during request */ - public List