@@ -2171,6 +2171,7 @@ public Response getAssignments(@Context ContainerRequestContext crc, @PathParam(
2171
2171
2172
2172
@ GET
2173
2173
@ AuthRequired
2174
+ @ Deprecated (forRemoval = true , since = "2024-10-17" )
2174
2175
@ Path ("{id}/privateUrl" )
2175
2176
public Response getPrivateUrlData (@ Context ContainerRequestContext crc , @ PathParam ("id" ) String idSupplied ) {
2176
2177
return response ( req -> {
@@ -2182,6 +2183,7 @@ public Response getPrivateUrlData(@Context ContainerRequestContext crc, @PathPar
2182
2183
2183
2184
@ POST
2184
2185
@ AuthRequired
2186
+ @ Deprecated (forRemoval = true , since = "2024-10-17" )
2185
2187
@ Path ("{id}/privateUrl" )
2186
2188
public Response createPrivateUrl (@ Context ContainerRequestContext crc , @ PathParam ("id" ) String idSupplied ,@ DefaultValue ("false" ) @ QueryParam ("anonymizedAccess" ) boolean anonymizedAccess ) {
2187
2189
if (anonymizedAccess && settingsSvc .getValueForKey (SettingsServiceBean .Key .AnonymizedFieldTypeNames )==null ) {
@@ -2194,6 +2196,7 @@ public Response createPrivateUrl(@Context ContainerRequestContext crc, @PathPara
2194
2196
2195
2197
@ DELETE
2196
2198
@ AuthRequired
2199
+ @ Deprecated (forRemoval = true , since = "2024-10-17" )
2197
2200
@ Path ("{id}/privateUrl" )
2198
2201
public Response deletePrivateUrl (@ Context ContainerRequestContext crc , @ PathParam ("id" ) String idSupplied ) {
2199
2202
return response ( req -> {
@@ -2207,6 +2210,46 @@ public Response deletePrivateUrl(@Context ContainerRequestContext crc, @PathPara
2207
2210
}
2208
2211
}, getRequestUser (crc ));
2209
2212
}
2213
+
2214
+ @ GET
2215
+ @ AuthRequired
2216
+ @ Path ("{id}/previewUrl" )
2217
+ public Response getPreviewUrlData (@ Context ContainerRequestContext crc , @ PathParam ("id" ) String idSupplied ) {
2218
+ return response ( req -> {
2219
+ PrivateUrl privateUrl = execCommand (new GetPrivateUrlCommand (req , findDatasetOrDie (idSupplied )));
2220
+ return (privateUrl != null ) ? ok (json (privateUrl ))
2221
+ : error (Response .Status .NOT_FOUND , "Private URL not found." );
2222
+ }, getRequestUser (crc ));
2223
+ }
2224
+
2225
+ @ POST
2226
+ @ AuthRequired
2227
+ @ Path ("{id}/previewUrl" )
2228
+ public Response createPreviewUrl (@ Context ContainerRequestContext crc , @ PathParam ("id" ) String idSupplied ,@ DefaultValue ("false" ) @ QueryParam ("anonymizedAccess" ) boolean anonymizedAccess ) {
2229
+ if (anonymizedAccess && settingsSvc .getValueForKey (SettingsServiceBean .Key .AnonymizedFieldTypeNames )==null ) {
2230
+ throw new NotAcceptableException ("Anonymized Access not enabled" );
2231
+ }
2232
+ return response (req ->
2233
+ ok (json (execCommand (
2234
+ new CreatePrivateUrlCommand (req , findDatasetOrDie (idSupplied ), anonymizedAccess )))), getRequestUser (crc ));
2235
+ }
2236
+
2237
+ @ DELETE
2238
+ @ AuthRequired
2239
+ @ Path ("{id}/previewUrl" )
2240
+ public Response deletePreviewUrl (@ Context ContainerRequestContext crc , @ PathParam ("id" ) String idSupplied ) {
2241
+ return response ( req -> {
2242
+ Dataset dataset = findDatasetOrDie (idSupplied );
2243
+ PrivateUrl privateUrl = execCommand (new GetPrivateUrlCommand (req , dataset ));
2244
+ if (privateUrl != null ) {
2245
+ execCommand (new DeletePrivateUrlCommand (req , dataset ));
2246
+ return ok ("Private URL deleted." );
2247
+ } else {
2248
+ return notFound ("No Private URL to delete." );
2249
+ }
2250
+ }, getRequestUser (crc ));
2251
+ }
2252
+
2210
2253
2211
2254
@ GET
2212
2255
@ AuthRequired
0 commit comments