4343import 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 */
4848public 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