Skip to content

Commit ca815c1

Browse files
committed
update javadocs
1 parent 0569bb0 commit ca815c1

File tree

3 files changed

+18
-18
lines changed

3 files changed

+18
-18
lines changed

access-grant/src/main/java/com/inrupt/client/accessgrant/AccessDenial.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
import org.apache.commons.io.IOUtils;
4444

4545
/**
46-
* An Access Grant abstraction, for use with interacting with Solid resources.
46+
* An Access Denial abstraction, for use when interacting with Solid resources.
4747
*/
4848
public class AccessDenial implements AccessCredential {
4949

@@ -67,10 +67,10 @@ public class AccessDenial implements AccessCredential {
6767
/**
6868
* Read a verifiable presentation as an AccessDenial.
6969
*
70-
* @param grant the Access Denial serialized as a verifiable presentation
70+
* @param serialization the Access Denial serialized as a verifiable presentation
7171
*/
72-
protected AccessDenial(final String grant) throws IOException {
73-
try (final InputStream in = new ByteArrayInputStream(grant.getBytes())) {
72+
protected AccessDenial(final String serialization) throws IOException {
73+
try (final InputStream in = new ByteArrayInputStream(serialization.getBytes())) {
7474
// TODO process as JSON-LD
7575
final Map<String, Object> data = jsonService.fromJson(in,
7676
new HashMap<String, Object>(){}.getClass().getGenericSuperclass());
@@ -83,7 +83,7 @@ protected AccessDenial(final String grant) throws IOException {
8383
final Map vc = vcs.get(0);
8484

8585
if (asSet(data.get(TYPE)).orElseGet(Collections::emptySet).contains("VerifiablePresentation")) {
86-
this.credential = grant;
86+
this.credential = serialization;
8787
this.issuer = asUri(vc.get("issuer")).orElseThrow(() ->
8888
new IllegalArgumentException("Missing or invalid issuer field"));
8989
this.identifier = asUri(vc.get("id")).orElseThrow(() ->
@@ -139,8 +139,8 @@ public static AccessDenial of(final String serialization) {
139139
/**
140140
* Create an AccessDenial object from a serialized form.
141141
*
142-
* @param serialization the serialized access grant
143-
* @return a parsed access grant
142+
* @param serialization the serialized access denial
143+
* @return a parsed access denial
144144
*/
145145
public static AccessDenial of(final InputStream serialization) {
146146
try {

access-grant/src/main/java/com/inrupt/client/accessgrant/AccessGrant.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
import org.apache.commons.io.IOUtils;
4444

4545
/**
46-
* An Access Grant abstraction, for use with interacting with Solid resources.
46+
* An Access Grant abstraction, for use when interacting with Solid resources.
4747
*/
4848
public class AccessGrant implements AccessCredential {
4949

access-grant/src/main/java/com/inrupt/client/accessgrant/AccessRequest.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
import org.apache.commons.io.IOUtils;
4444

4545
/**
46-
* An Access Request abstraction, for use with interacting with Solid resources.
46+
* An Access Request abstraction, for use when interacting with Solid resources.
4747
*/
4848
public class AccessRequest implements AccessCredential {
4949

@@ -67,10 +67,10 @@ public class AccessRequest implements AccessCredential {
6767
/**
6868
* Read a verifiable presentation as an AccessRequest.
6969
*
70-
* @param grant the serialized form of an Access Request
70+
* @param serialization the serialized form of an Access Request
7171
*/
72-
protected AccessRequest(final String grant) throws IOException {
73-
try (final InputStream in = new ByteArrayInputStream(grant.getBytes())) {
72+
protected AccessRequest(final String serialization) throws IOException {
73+
try (final InputStream in = new ByteArrayInputStream(serialization.getBytes())) {
7474
// TODO process as JSON-LD
7575
final Map<String, Object> data = jsonService.fromJson(in,
7676
new HashMap<String, Object>(){}.getClass().getGenericSuperclass());
@@ -83,7 +83,7 @@ protected AccessRequest(final String grant) throws IOException {
8383
final Map vc = vcs.get(0);
8484

8585
if (asSet(data.get(TYPE)).orElseGet(Collections::emptySet).contains("VerifiablePresentation")) {
86-
this.credential = grant;
86+
this.credential = serialization;
8787
this.issuer = asUri(vc.get("issuer")).orElseThrow(() ->
8888
new IllegalArgumentException("Missing or invalid issuer field"));
8989
this.identifier = asUri(vc.get("id")).orElseThrow(() ->
@@ -123,28 +123,28 @@ protected AccessRequest(final String grant) throws IOException {
123123
/**
124124
* Create an AccessRequest object from a serialized form.
125125
*
126-
* @param serialization the serialized access grant
127-
* @return a parsed access grant
126+
* @param serialization the serialized access request
127+
* @return a parsed access request
128128
*/
129129
public static AccessRequest of(final String serialization) {
130130
try {
131131
return new AccessRequest(serialization);
132132
} catch (final IOException ex) {
133-
throw new IllegalArgumentException("Unable to read access grant", ex);
133+
throw new IllegalArgumentException("Unable to read access request", ex);
134134
}
135135
}
136136

137137
/**
138138
* Create an AccessRequest object from a serialized form.
139139
*
140140
* @param serialization the access request
141-
* @return a parsed access grant
141+
* @return a parsed access request
142142
*/
143143
public static AccessRequest of(final InputStream serialization) {
144144
try {
145145
return of(IOUtils.toString(serialization, UTF_8));
146146
} catch (final IOException ex) {
147-
throw new IllegalArgumentException("Unable to read access grant", ex);
147+
throw new IllegalArgumentException("Unable to read access request", ex);
148148
}
149149
}
150150

0 commit comments

Comments
 (0)