3737import com .adobe .aem .commons .assetshare .content .AssetModel ;
3838import com .adobe .aem .commons .assetshare .util .EmailService ;
3939import com .adobe .aem .commons .assetshare .util .RequireAem ;
40- import com .adobe .cq .commerce .common .ValueMapDecorator ;
4140import com .adobe .granite .security .user .UserProperties ;
4241import com .adobe .granite .security .user .UserPropertiesManager ;
4342import com .day .cq .commons .Externalizer ;
5352import org .apache .sling .api .resource .ResourceResolver ;
5453import org .apache .sling .api .resource .ValueMap ;
5554import org .apache .sling .api .scripting .SlingBindings ;
55+ import org .apache .sling .api .wrappers .ValueMapDecorator ;
5656import org .apache .sling .models .factory .ModelFactory ;
5757import org .apache .sling .scripting .core .ScriptHelper ;
5858import org .apache .sling .xss .XSSAPI ;
@@ -151,6 +151,7 @@ public final void share(final SlingHttpServletRequest request, final SlingHttpSe
151151
152152 private final void share (final Config config , final ValueMap unprotectedShareParameters , final ValueMap shareParameters , final String emailTemplatePath ) throws ShareException {
153153 final String [] emailAddresses = StringUtils .split (unprotectedShareParameters .get (EMAIL_ADDRESSES , "" ), "," );
154+
154155 final String [] assetPaths = Arrays .stream (unprotectedShareParameters .get (ASSET_PATHS , ArrayUtils .EMPTY_STRING_ARRAY ))
155156 .filter (StringUtils ::isNotBlank )
156157 .map (path -> config .getResourceResolver ().getResource (path ))
@@ -160,6 +161,10 @@ private final void share(final Config config, final ValueMap unprotectedSharePar
160161 .map (Asset ::getPath )
161162 .toArray (String []::new );
162163
164+ if (log .isDebugEnabled ()) {
165+ log .debug ("Sharing [ {} ] to [ {} ]" , StringUtils .join (unprotectedShareParameters .get (ASSET_PATHS , ArrayUtils .EMPTY_STRING_ARRAY ), ", " ), StringUtils .join (emailAddresses , ", " ));
166+ }
167+
163168 // Check to ensure the minimum set of e-mail parameters are provided; Throw exception if not.
164169 if (emailAddresses == null || emailAddresses .length == 0 ) {
165170 throw new ShareException ("At least one e-mail address is required to share" );
0 commit comments