Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 22 additions & 21 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.versionone</groupId>
<artifactId>VersionOne.SDK.Java.APIClient</artifactId>
<version>21.2.0</version>
<version>21.2.1</version>
<packaging>jar</packaging>

<name>VersionOne.SDK.Java.APIClient</name>
Expand Down Expand Up @@ -73,6 +73,11 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<github.global.server>github</github.global.server>
<VERSION_NUMBER>${project.version}</VERSION_NUMBER>
<httpclient4.version>4.5.14</httpclient4.version>
<httpcore4.version>4.4.16</httpcore4.version>
<commons.io.version>2.21.0</commons.io.version>
<commons.lang3.version>3.20.0</commons.lang3.version>
<org.json.version>20250517</org.json.version>
</properties>

<build>
Expand Down Expand Up @@ -293,54 +298,50 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13</version>
<version>4.13.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.5</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.4</version>
<version>${httpclient4.version}</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient-win</artifactId>
<version>4.4</version>
<version>${httpclient4.version}</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpmime</artifactId>
<version>4.4</version>
<version>${httpclient4.version}</version>
</dependency>

<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-io</artifactId>
<version>1.3.2</version>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
<version>${httpcore4.version}</version>
</dependency>

<dependency>
<groupId>commons-validator</groupId>
<artifactId>commons-validator</artifactId>
<version>1.4.1</version>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>${commons.io.version}</version>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.4</version>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>${commons.lang3.version}</version>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20141113</version>
<version>${org.json.version}</version>
</dependency>
<dependency>
<groupId>com.github.tomakehurst</groupId>
<artifactId>wiremock</artifactId>
<version>1.58</version>
<scope>test</scope>

<!-- Include everything below here if you have dependency conflicts -->
<classifier>standalone</classifier>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
import javax.xml.xpath.XPathConstants;
import javax.xml.xpath.XPathFactory;

import org.apache.commons.lang.NullArgumentException;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.w3c.dom.Element;

import com.versionone.DB;
Expand Down Expand Up @@ -119,7 +118,7 @@ public Object coerce(Object value) throws V1Exception {
return value;
case Guid:
if (value == null || StringUtils.isEmpty(value.toString()))
throw new NullArgumentException("value");
throw new IllegalArgumentException("value");
return UUID.fromString(new DB.Str(value).getValue());
default:
throw new MetaException("Unsupported AttributeType ", getAttributeType().toString());
Expand Down
23 changes: 11 additions & 12 deletions src/main/java/com/versionone/apiclient/Services.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
import javax.xml.xpath.XPathFactory;

import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.NullArgumentException;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONObject;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
Expand Down Expand Up @@ -87,27 +86,27 @@ public Services(IMetaModel metaModel, IAPIConnector connector) {
_connector = connector;
}

public Services(V1Connector v1Connector) throws NullArgumentException {
public Services(V1Connector v1Connector) {
if (v1Connector == null)
throw new NullArgumentException("v1Connector");
throw new IllegalArgumentException("v1Connector");

_v1Connector = v1Connector;
_meta = new MetaModel(_v1Connector);
}

public Services(V1Connector connector, IMetaModel metaModel) throws NullArgumentException {
public Services(V1Connector connector, IMetaModel metaModel) {
if (connector == null)
throw new NullArgumentException("connector");
throw new IllegalArgumentException("connector");
if (metaModel == null)
throw new NullArgumentException("metaModel");
throw new IllegalArgumentException("metaModel");

_v1Connector = connector;
_meta = metaModel;
}

public Services(V1Connector connector, boolean preLoadMeta) throws NullArgumentException {
public Services(V1Connector connector, boolean preLoadMeta) {
if (connector == null)
throw new NullArgumentException("connector");
throw new IllegalArgumentException("connector");

_v1Connector = connector;
_meta = new MetaModel(connector, preLoadMeta);
Expand Down Expand Up @@ -576,7 +575,7 @@ public String getLocalization(IAttributeDefinition attribute) throws V1Exception
if (null != attribute) {
return getStringData("?" + attribute.getDisplayName());
} else {
throw new NullArgumentException("IAttributeDefinition");
throw new IllegalArgumentException("IAttributeDefinition");
}
}

Expand Down Expand Up @@ -651,7 +650,7 @@ public Map<String, String> getLocalization(ArrayList<IAttributeDefinition> attri
@Override
public Oid saveAttachment(String filePath, Asset asset, String attachmentName) throws V1Exception, IOException {
if (StringUtils.isEmpty(filePath))
throw new NullArgumentException("filePath");
throw new IllegalArgumentException("filePath");

File file = new File(filePath);
if (!file.exists())
Expand Down Expand Up @@ -712,7 +711,7 @@ public InputStream getAttachment(Oid attachmentOid) throws V1Exception{
@Override
public Oid saveEmbeddedImage(String filePath, Asset asset) throws V1Exception, IOException {
if (StringUtils.isEmpty(filePath))
throw new NullArgumentException("Null value " + filePath);
throw new IllegalArgumentException("Null value " + filePath);

File file = new File(filePath);
if (!file.exists())
Expand Down
5 changes: 2 additions & 3 deletions src/main/java/com/versionone/apiclient/V1Configuration.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import javax.xml.xpath.XPathExpressionException;
import javax.xml.xpath.XPathFactory;

import org.apache.commons.lang.NullArgumentException;
import org.w3c.dom.Document;

import com.versionone.apiclient.exceptions.APIException;
Expand Down Expand Up @@ -38,13 +37,13 @@ public class V1Configuration implements IV1Configuration {
*/
public V1Configuration(IAPIConnector connector) {
if (connector == null)
throw new NullArgumentException("connector");
throw new IllegalArgumentException("connector");
this._connector = connector;
}

public V1Configuration(V1Connector connector) {
if (connector == null)
throw new NullArgumentException("_v1connector");
throw new IllegalArgumentException("_v1connector");

this._v1connector = connector;
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/versionone/apiclient/V1Connector.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

import org.apache.commons.io.IOUtils;
import org.apache.commons.io.output.ByteArrayOutputStream;
import org.apache.commons.lang.ArrayUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.Header;
import org.apache.http.HttpEntity;
import org.apache.http.HttpHeaders;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;

import org.apache.commons.lang.time.DateUtils;
import org.apache.commons.lang3.time.DateUtils;
import org.junit.BeforeClass;
import org.junit.Test;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import java.util.Arrays;
import java.util.Map;

import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.junit.BeforeClass;
import org.junit.Test;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import java.util.Calendar;
import java.util.Date;

import org.apache.commons.lang.time.DateUtils;
import org.apache.commons.lang3.time.DateUtils;
import org.junit.BeforeClass;
import org.junit.Test;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import com.versionone.apiclient.exceptions.V1Exception;
import com.versionone.apiclient.filters.FilterTerm;

import org.apache.commons.lang.NullArgumentException;
import org.junit.Assert;
import org.junit.Rule;
import org.junit.Test;
Expand Down Expand Up @@ -198,14 +197,14 @@ public void Asset_with_null_Guid_Attribute() throws OidException, ConnectionExce

try {
subject.retrieve(query);
} catch (NullArgumentException ex) {
} catch (IllegalArgumentException ex) {
Assert.assertEquals(
"value must not be null.",
"value",
ex.getMessage());
return;
}

Assert.fail("Expected to raise NullArgumentException, but did not.");
Assert.fail("Expected to raise IllegalArgumentException, but did not.");
}

}