REOC-58 upgrade the version for commons-lang3

This commit is contained in:
YuCheng Hu 2019-09-22 09:59:15 -04:00
parent 04c7308825
commit 7d3261ea45
258 changed files with 78 additions and 8568 deletions

View File

@ -31,7 +31,8 @@ dependencies {
compile group: 'log4j', name: 'log4j', version: '1.2.9' compile group: 'log4j', name: 'log4j', version: '1.2.9'
compile group: 'commons-logging', name: 'commons-logging', version: '1.1.1' compile group: 'commons-logging', name: 'commons-logging', version: '1.1.1'
compile group: 'commons-lang', name: 'commons-lang', version: '2.4' compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.9'
compile group: 'commons-codec', name: 'commons-codec', version: '1.3' compile group: 'commons-codec', name: 'commons-codec', version: '1.3'
compile group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.1.1' compile group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.1.1'

View File

@ -6,7 +6,7 @@ import java.util.concurrent.ConcurrentHashMap;
import com.ossez.reoc.rets.common.util.CaseInsensitiveTreeMap; import com.ossez.reoc.rets.common.util.CaseInsensitiveTreeMap;
import org.apache.commons.codec.digest.DigestUtils; import org.apache.commons.codec.digest.DigestUtils;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.http.Header; import org.apache.http.Header;
import org.apache.http.HttpResponse; import org.apache.http.HttpResponse;
import org.apache.http.HttpStatus; import org.apache.http.HttpStatus;

View File

@ -6,8 +6,8 @@ import java.util.Map;
import java.util.zip.GZIPInputStream; import java.util.zip.GZIPInputStream;
import com.ossez.reoc.rets.common.util.CaseInsensitiveTreeMap; import com.ossez.reoc.rets.common.util.CaseInsensitiveTreeMap;
import org.apache.commons.lang.ArrayUtils; import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.http.Header; import org.apache.http.Header;
import org.apache.http.HttpResponse; import org.apache.http.HttpResponse;

View File

@ -1,6 +1,6 @@
package com.ossez.reoc.rets.client; package com.ossez.reoc.rets.client;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang3.StringUtils;
public class GetMetadataRequest extends VersionInsensitiveRequest { public class GetMetadataRequest extends VersionInsensitiveRequest {
private static final int COMPACT_FORMAT = 0; private static final int COMPACT_FORMAT = 0;

View File

@ -8,7 +8,7 @@ import com.ossez.reoc.rets.common.metadata.JDomCompactBuilder;
import com.ossez.reoc.rets.common.metadata.JDomStandardBuilder; import com.ossez.reoc.rets.common.metadata.JDomStandardBuilder;
import com.ossez.reoc.rets.common.metadata.MetaObject; import com.ossez.reoc.rets.common.metadata.MetaObject;
import com.ossez.reoc.rets.common.metadata.MetadataException; import com.ossez.reoc.rets.common.metadata.MetadataException;
import org.apache.commons.lang.math.NumberUtils; import org.apache.commons.lang3.math.NumberUtils;
import org.jdom.Element; import org.jdom.Element;
import org.jdom.JDOMException; import org.jdom.JDOMException;

View File

@ -6,8 +6,8 @@ import java.util.Iterator;
import java.util.Set; import java.util.Set;
import java.util.Map; import java.util.Map;
import org.apache.commons.lang.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang3.StringUtils;
public class GetObjectRequest extends VersionInsensitiveRequest { public class GetObjectRequest extends VersionInsensitiveRequest {
public static final String KEY_RESOURCE = "Resource"; public static final String KEY_RESOURCE = "Resource";

View File

@ -6,7 +6,7 @@ import java.util.Map;
import java.util.NoSuchElementException; import java.util.NoSuchElementException;
import com.ossez.reoc.rets.common.util.CaseInsensitiveTreeMap; import com.ossez.reoc.rets.common.util.CaseInsensitiveTreeMap;
import org.apache.commons.lang.math.NumberUtils; import org.apache.commons.lang3.math.NumberUtils;
import org.apache.http.HeaderElement; import org.apache.http.HeaderElement;
import org.apache.http.NameValuePair; import org.apache.http.NameValuePair;
import org.apache.http.message.BasicHeaderValueParser; import org.apache.http.message.BasicHeaderValueParser;

View File

@ -7,7 +7,7 @@ import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.NoSuchElementException; import java.util.NoSuchElementException;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang3.StringUtils;
public class GetObjectResponseIterator<T extends SingleObjectResponse> implements GetObjectIterator<T> { public class GetObjectResponseIterator<T extends SingleObjectResponse> implements GetObjectIterator<T> {
public static final char CR = '\r'; public static final char CR = '\r';

View File

@ -1,6 +1,6 @@
package com.ossez.reoc.rets.client; package com.ossez.reoc.rets.client;
import org.apache.commons.lang.SystemUtils; import org.apache.commons.lang3.SystemUtils;
/** /**
* Exception class for invalid reply codes from a Rets server * Exception class for invalid reply codes from a Rets server
*/ */

View File

@ -10,8 +10,8 @@ import org.jdom.JDOMException;
import org.jdom.Document; import org.jdom.Document;
import org.jdom.input.SAXBuilder; import org.jdom.input.SAXBuilder;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang.math.NumberUtils; import org.apache.commons.lang3.math.NumberUtils;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;

View File

@ -6,8 +6,8 @@ import java.net.URL;
import java.util.HashSet; import java.util.HashSet;
import java.util.Set; import java.util.Set;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang.math.NumberUtils; import org.apache.commons.lang3.math.NumberUtils;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;

View File

@ -3,7 +3,7 @@ package com.ossez.reoc.rets.client;
import com.ossez.reoc.rets.common.metadata.MetaCollector; import com.ossez.reoc.rets.common.metadata.MetaCollector;
import com.ossez.reoc.rets.common.metadata.MetaObject; import com.ossez.reoc.rets.common.metadata.MetaObject;
import com.ossez.reoc.rets.common.metadata.MetadataType; import com.ossez.reoc.rets.common.metadata.MetadataType;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;

View File

@ -1,8 +1,9 @@
package com.ossez.reoc.rets.client; package com.ossez.reoc.rets.client;
import org.apache.commons.lang.exception.NestableException; /**
* @author YuCheng Hu
public class RetsException extends NestableException { */
public class RetsException extends Exception {
public RetsException() { public RetsException() {
super(); super();
} }

View File

@ -9,8 +9,8 @@ import java.util.SortedMap;
import java.util.TreeMap; import java.util.TreeMap;
import com.ossez.reoc.rets.common.util.CaseInsensitiveTreeMap; import com.ossez.reoc.rets.common.util.CaseInsensitiveTreeMap;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringBuilder;
/** Base Http Request object */ /** Base Http Request object */
public abstract class RetsHttpRequest implements Serializable { public abstract class RetsHttpRequest implements Serializable {

View File

@ -1,45 +1,48 @@
package com.ossez.reoc.rets.client; package com.ossez.reoc.rets.client;
import org.apache.commons.codec.DecoderException;
import org.apache.commons.codec.EncoderException;
import org.apache.commons.codec.net.URLCodec;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.OutputStream; import java.io.OutputStream;
import org.apache.commons.codec.DecoderException; /**
import org.apache.commons.codec.EncoderException; * Random utility functions
import org.apache.commons.codec.net.URLCodec; *
import org.apache.commons.lang.exception.NestableRuntimeException; * @author YuCheng Hu
*/
/** Random utility functions. */
public class RetsUtil { public class RetsUtil {
public static void copyStream(InputStream in, OutputStream out) throws IOException { public static void copyStream(InputStream in, OutputStream out) throws IOException {
byte[] buf = new byte[512]; byte[] buf = new byte[512];
int count; int count;
while (true) { while (true) {
count = in.read(buf); count = in.read(buf);
if (count < 1) { if (count < 1) {
in.close(); in.close();
out.close(); out.close();
return; return;
} }
while (count > 0) { while (count > 0) {
out.write(buf); out.write(buf);
} }
} }
} }
public static String urlEncode(String string) { public static String urlEncode(String string) {
try { try {
return new URLCodec().encode(string); return new URLCodec().encode(string);
} catch (EncoderException e) { } catch (EncoderException e) {
throw new NestableRuntimeException(e); throw new RuntimeException(e);
} }
} }
public static String urlDecode(String string) { public static String urlDecode(String string) {
try { try {
return new URLCodec().decode(string); return new URLCodec().decode(string);
} catch (DecoderException e) { } catch (DecoderException e) {
throw new NestableRuntimeException(e); throw new RuntimeException(e);
} }
} }
} }

View File

@ -2,8 +2,8 @@ package com.ossez.reoc.rets.client;
import java.io.Serializable; import java.io.Serializable;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang.math.NumberUtils; import org.apache.commons.lang3.math.NumberUtils;
public class RetsVersion implements Serializable { public class RetsVersion implements Serializable {
public static final String RETS_VERSION_HEADER = "RETS-Version"; public static final String RETS_VERSION_HEADER = "RETS-Version";

View File

@ -4,7 +4,6 @@ import java.io.InputStream;
import java.io.Reader; import java.io.Reader;
import java.util.LinkedList; import java.util.LinkedList;
import org.apache.commons.lang.exception.NestableRuntimeException;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.xml.sax.InputSource; import org.xml.sax.InputSource;
@ -163,7 +162,7 @@ class StreamingSearchResult implements SearchResultSet, SearchResultCollector {
if (state() > BUFFER_FULL) { if (state() > BUFFER_FULL) {
if (this.exception == null) if (this.exception == null)
setException(new RetsException("Attempting to add rows to buffer when in complete state")); setException(new RetsException("Attempting to add rows to buffer when in complete state"));
throw new NestableRuntimeException(this.exception); throw new RuntimeException(this.exception);
} }
// check complete. // check complete.
@ -174,7 +173,7 @@ class StreamingSearchResult implements SearchResultSet, SearchResultCollector {
if (this.exception == null) if (this.exception == null)
setException(new RetsException("Timeout writing to streaming result set buffer, timeout length = " setException(new RetsException("Timeout writing to streaming result set buffer, timeout length = "
+ this.timeout)); + this.timeout));
throw new NestableRuntimeException(this.exception); throw new RuntimeException(this.exception);
} }
} }
@ -283,7 +282,7 @@ class StreamingSearchResult implements SearchResultSet, SearchResultCollector {
try { try {
return checkException(); return checkException();
} catch (RetsException e) { } catch (RetsException e) {
throw new NestableRuntimeException(e); throw new RuntimeException(e);
} }
} }
@ -301,7 +300,7 @@ class StreamingSearchResult implements SearchResultSet, SearchResultCollector {
wait(this.timeout); wait(this.timeout);
} catch (InterruptedException e) { } catch (InterruptedException e) {
pushState(COMPLETE); pushState(COMPLETE);
throw new NestableRuntimeException(e); throw new RuntimeException(e);
} }
} }

View File

@ -10,9 +10,9 @@ import java.util.Map;
import java.util.Set; import java.util.Set;
import com.ossez.reoc.rets.common.util.CaseInsensitiveTreeMap; import com.ossez.reoc.rets.common.util.CaseInsensitiveTreeMap;
import org.apache.commons.lang.builder.EqualsBuilder; import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import com.ossez.reoc.rets.common.metadata.attrib.AttrAlphanum; import com.ossez.reoc.rets.common.metadata.attrib.AttrAlphanum;

View File

@ -7,9 +7,8 @@
*/ */
package com.ossez.reoc.rets.common.metadata; package com.ossez.reoc.rets.common.metadata;
import org.apache.commons.lang.exception.NestableException;
public class MetadataException extends NestableException { public class MetadataException extends Exception {
public MetadataException() { public MetadataException() {
super(); super();
} }

View File

@ -7,7 +7,7 @@
*/ */
package com.ossez.reoc.rets.common.metadata.attrib; package com.ossez.reoc.rets.common.metadata.attrib;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang3.StringUtils;
import com.ossez.reoc.rets.common.metadata.AttrType; import com.ossez.reoc.rets.common.metadata.AttrType;
import com.ossez.reoc.rets.common.metadata.MetaParseException; import com.ossez.reoc.rets.common.metadata.MetaParseException;

View File

@ -2,11 +2,7 @@ package com.ossez.reoc.rets.examples;
import java.net.MalformedURLException; import java.net.MalformedURLException;
import com.ossez.reoc.rets.client.CommonsHttpClient; import com.ossez.reoc.rets.client.*;
import com.ossez.reoc.rets.client.RetsException;
import com.ossez.reoc.rets.client.RetsHttpClient;
import com.ossez.reoc.rets.client.RetsSession;
import com.ossez.reoc.rets.client.RetsVersion;
import com.ossez.reoc.rets.common.metadata.types.MClass; import com.ossez.reoc.rets.common.metadata.types.MClass;
import com.ossez.reoc.rets.common.metadata.types.MResource; import com.ossez.reoc.rets.common.metadata.types.MResource;
import com.ossez.reoc.rets.common.metadata.types.MSystem; import com.ossez.reoc.rets.common.metadata.types.MSystem;
@ -34,7 +30,9 @@ public class RetsGetMetadataExample {
session.setMethod("POST"); session.setMethod("POST");
try { try {
//Login //Login
session.login(username, password); LoginResponse loginResponse = session.login(username, password);
System.out.println(">>>" + loginResponse.getSessionId());
} catch (RetsException e) { } catch (RetsException e) {
e.printStackTrace(); e.printStackTrace();
} }

View File

@ -2,7 +2,7 @@ package com.ossez.reoc.rets.examples;
import java.net.MalformedURLException; import java.net.MalformedURLException;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang3.StringUtils;
import com.ossez.reoc.rets.client.CommonsHttpClient; import com.ossez.reoc.rets.client.CommonsHttpClient;
import com.ossez.reoc.rets.client.RetsException; import com.ossez.reoc.rets.client.RetsException;
import com.ossez.reoc.rets.client.RetsHttpClient; import com.ossez.reoc.rets.client.RetsHttpClient;

View File

@ -17,7 +17,7 @@
<!--********************************************************************** <!--**********************************************************************
IMMUTABLE PROPERTIES DEFINTIONS IMMUTABLE PROPERTIES DEFINTIONS
***********************************************************************--> ***********************************************************************-->
<property name="dist" value="C:/WorkDir/Ossez-Com/REoC/Source-Code/reoc-mls-client/../dist"/> <property name="dist" value="C:/WorkDir/Ossez-Com/rets-io-client/../dist"/>
<property name="dist.sandbox" value="${dist}/${ant.project.name}-sandbox"/> <property name="dist.sandbox" value="${dist}/${ant.project.name}-sandbox"/>
<property name="dist.lib" value="${dist.sandbox}/lib"/> <property name="dist.lib" value="${dist.sandbox}/lib"/>
<!-- junit property stuff --> <!-- junit property stuff -->

Some files were not shown because too many files have changed in this diff Show More