@@ -2174,41 +2174,23 @@ public Response getAssignments(@Context ContainerRequestContext crc, @PathParam(
2174
2174
@ Deprecated (forRemoval = true , since = "2024-10-17" )
2175
2175
@ Path ("{id}/privateUrl" )
2176
2176
public Response getPrivateUrlData (@ Context ContainerRequestContext crc , @ PathParam ("id" ) String idSupplied ) {
2177
- return response ( req -> {
2178
- PrivateUrl privateUrl = execCommand (new GetPrivateUrlCommand (req , findDatasetOrDie (idSupplied )));
2179
- return (privateUrl != null ) ? ok (json (privateUrl ))
2180
- : error (Response .Status .NOT_FOUND , "Private URL not found." );
2181
- }, getRequestUser (crc ));
2177
+ return getPreviewUrlData (crc , idSupplied );
2182
2178
}
2183
2179
2184
2180
@ POST
2185
2181
@ AuthRequired
2186
2182
@ Deprecated (forRemoval = true , since = "2024-10-17" )
2187
2183
@ Path ("{id}/privateUrl" )
2188
- public Response createPrivateUrl (@ Context ContainerRequestContext crc , @ PathParam ("id" ) String idSupplied ,@ DefaultValue ("false" ) @ QueryParam ("anonymizedAccess" ) boolean anonymizedAccess ) {
2189
- if (anonymizedAccess && settingsSvc .getValueForKey (SettingsServiceBean .Key .AnonymizedFieldTypeNames )==null ) {
2190
- throw new NotAcceptableException ("Anonymized Access not enabled" );
2191
- }
2192
- return response (req ->
2193
- ok (json (execCommand (
2194
- new CreatePrivateUrlCommand (req , findDatasetOrDie (idSupplied ), anonymizedAccess )))), getRequestUser (crc ));
2184
+ public Response createPrivateUrl (@ Context ContainerRequestContext crc , @ PathParam ("id" ) String idSupplied , @ DefaultValue ("false" ) @ QueryParam ("anonymizedAccess" ) boolean anonymizedAccess ) {
2185
+ return createPreviewUrl (crc , idSupplied , anonymizedAccess );
2195
2186
}
2196
2187
2197
2188
@ DELETE
2198
2189
@ AuthRequired
2199
2190
@ Deprecated (forRemoval = true , since = "2024-10-17" )
2200
2191
@ Path ("{id}/privateUrl" )
2201
2192
public Response deletePrivateUrl (@ Context ContainerRequestContext crc , @ PathParam ("id" ) String idSupplied ) {
2202
- return response ( req -> {
2203
- Dataset dataset = findDatasetOrDie (idSupplied );
2204
- PrivateUrl privateUrl = execCommand (new GetPrivateUrlCommand (req , dataset ));
2205
- if (privateUrl != null ) {
2206
- execCommand (new DeletePrivateUrlCommand (req , dataset ));
2207
- return ok ("Private URL deleted." );
2208
- } else {
2209
- return notFound ("No Private URL to delete." );
2210
- }
2211
- }, getRequestUser (crc ));
2193
+ return deletePreviewUrl (crc , idSupplied );
2212
2194
}
2213
2195
2214
2196
@ GET
0 commit comments