File tree Expand file tree Collapse file tree
java/com/evolvedbinary/bblValidator Expand file tree Collapse file tree Original file line number Diff line number Diff line change 100100 </dependencies >
101101
102102 <build >
103+ <resources >
104+ <resource >
105+ <directory >src/main/resources</directory >
106+ <filtering >true</filtering >
107+ </resource >
108+ </resources >
109+
103110 <plugins >
104111 <!-- Maven Compiler Plugin -->
105112 <plugin >
Original file line number Diff line number Diff line change 77import io .micronaut .http .annotation .Get ;
88import io .micronaut .http .annotation .Produces ;
99import io .micronaut .http .annotation .PathVariable ;
10+ import jakarta .inject .Inject ;
1011
1112import java .util .List ;
1213
1314@ Controller ("/schema" )
1415public class SchemaController {
1516
16- private final SchemaService schemaService ;
17-
18- public SchemaController (SchemaService schemaService ) {
19- this .schemaService = schemaService ;
20- }
17+ @ Inject
18+ SchemaService schemaService ;
2119
2220 @ Get
2321 @ Produces (MediaType .APPLICATION_JSON )
Original file line number Diff line number Diff line change 99import io .micronaut .http .annotation .Controller ;
1010import io .micronaut .http .annotation .Post ;
1111import io .micronaut .http .annotation .QueryValue ;
12+ import jakarta .inject .Inject ;
1213import org .slf4j .Logger ;
1314import org .slf4j .LoggerFactory ;
1415
2223public class ValidateController {
2324
2425 private static final Logger LOG = LoggerFactory .getLogger (ValidateController .class );
25- private final FileDownloadService fileDownloadService ;
26-
27- /**
28- * Constructor for ValidateController.
29- *
30- * @param fileDownloadService service for downloading files
31- */
32- public ValidateController (FileDownloadService fileDownloadService ) {
33- this .fileDownloadService = fileDownloadService ;
34- }
26+ @ Inject
27+ FileDownloadService fileDownloadService ;
3528
3629 /**
3730 * Handles form URL encoded validation requests.
Original file line number Diff line number Diff line change 1010@ Controller
1111public class VersionController {
1212
13- private final String version ;
14-
15- public VersionController (@ Value ("${api.version}" ) String version ) {
16- this .version = version ;
17- }
13+ @ Value ("${api.version}" )
14+ String version ;
1815
1916 @ Get ("/version" )
2017 @ Produces (MediaType .APPLICATION_JSON )
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ public String getSource() {
4848 return source ;
4949 }
5050
51- public void setSource (String url ) {
51+ public void setSource (String source ) {
5252 this .source = source ;
5353 }
5454}
Original file line number Diff line number Diff line change 1919import java .util .Map ;
2020import java .util .stream .Stream ;
2121
22+ // TODO talk to Adam about syncronaztion
2223@ Singleton
2324public class SchemaService {
2425
@@ -53,6 +54,12 @@ public void loadSchemas() {
5354 }
5455
5556 private void loadSchemasFromClasspath () {
57+ // close the file input stream
58+ // try with resoucres
59+ // avoid class path
60+ // in application yaml add a property for schema folder
61+ // make it relative to the start up location
62+ // if it starts with a slash then resolve it as absolut path
5663 try {
5764 // Get resource URL and list files
5865 ClassLoader classLoader = getClass ().getClassLoader ();
Original file line number Diff line number Diff line change @@ -4,4 +4,4 @@ micronaut:
44 server :
55 port : 8080
66api :
7- version : 1.0.0
7+ version : ${project.version}
You can’t perform that action at this time.
0 commit comments