1
1
// tag::copyright[]
2
2
/*******************************************************************************
3
- * Copyright (c) 2017, 2019 IBM Corporation and others.
3
+ * Copyright (c) 2017, 2022 IBM Corporation and others.
4
4
* All rights reserved. This program and the accompanying materials
5
5
* are made available under the terms of the Eclipse Public License v1.0
6
6
* which accompanies this distribution, and is available at
15
15
package io .openliberty .guides .inventory ;
16
16
17
17
import java .util .Properties ;
18
- import javax .enterprise .context .RequestScoped ;
19
- import javax .inject .Inject ;
20
- import javax .ws .rs .GET ;
21
- import javax .ws .rs .Path ;
22
- import javax .ws .rs .PathParam ;
23
- import javax .ws .rs .Produces ;
24
- import javax .ws .rs .core .MediaType ;
25
- import javax .ws .rs .core .Response ;
26
- import io .openliberty .guides .inventory .InventoryConfig ;
18
+ import jakarta .enterprise .context .RequestScoped ;
19
+ import jakarta .inject .Inject ;
20
+ import jakarta .ws .rs .GET ;
21
+ import jakarta .ws .rs .Path ;
22
+ import jakarta .ws .rs .PathParam ;
23
+ import jakarta .ws .rs .Produces ;
24
+ import jakarta .ws .rs .core .MediaType ;
25
+ import jakarta .ws .rs .core .Response ;
27
26
28
27
@ RequestScoped
29
28
@ Path ("systems" )
@@ -50,7 +49,8 @@ public Response getPropertiesForHost(@PathParam("hostname") String hostname) {
50
49
if (props == null ) {
51
50
return Response .status (Response .Status .NOT_FOUND )
52
51
.entity (
53
- "{ \" error\" : \" Unknown hostname or the resource may not be running on the host machine\" }" )
52
+ "{ \" error\" : \" Unknown hostname or the resource"
53
+ + " may not be running on the host machine\" }" )
54
54
.build ();
55
55
}
56
56
@@ -60,7 +60,8 @@ public Response getPropertiesForHost(@PathParam("hostname") String hostname) {
60
60
} else {
61
61
// tag::email[]
62
62
return Response .status (Response .Status .SERVICE_UNAVAILABLE )
63
- .entity ("{ \" error\" : \" Service is currently in maintenance.\" }" ).build ();
63
+ .entity ("{ \" error\" : \" Service is currently in maintenance.\" }" )
64
+ .build ();
64
65
// end::email[]
65
66
}
66
67
}
@@ -72,7 +73,8 @@ public Response listContents() {
72
73
return Response .ok (manager .list ()).build ();
73
74
} else {
74
75
return Response .status (Response .Status .SERVICE_UNAVAILABLE )
75
- .entity ("{ \" error\" : \" Service is currently in maintenance.\" }" ).build ();
76
+ .entity ("{ \" error\" : \" Service is currently in maintenance.\" }" )
77
+ .build ();
76
78
}
77
79
}
78
80
0 commit comments