File tree Expand file tree Collapse file tree 2 files changed +19
-9
lines changed
src/main/java/net/coding/ide Expand file tree Collapse file tree 2 files changed +19
-9
lines changed Original file line number Diff line number Diff line change @@ -24,21 +24,12 @@ public class Application {
2424 @ Value ("${PTY_LIB_FOLDER}" )
2525 private String ptyLibFolder ;
2626
27- @ Value ("${CODING_IDE_HOME}" )
28- private String codingIdeHome ;
29-
3027 public static void main (String [] args ) throws URISyntaxException {
3128 SpringApplication .run (Application .class , args );
3229 }
3330
3431 @ PostConstruct
3532 public void init () throws IOException {
3633 System .setProperty ("PTY_LIB_FOLDER" , ptyLibFolder );
37-
38- File file = new File (codingIdeHome );
39-
40- if (!file .exists ()) {
41- Files .createDirectories (file .toPath ());
42- }
4334 }
4435}
Original file line number Diff line number Diff line change 1414import org .springframework .data .jpa .repository .config .EnableJpaRepositories ;
1515import org .springframework .transaction .annotation .EnableTransactionManagement ;
1616
17+ import javax .annotation .PostConstruct ;
1718import javax .sql .DataSource ;
19+ import java .io .File ;
20+ import java .io .IOException ;
21+ import java .nio .file .Files ;
1822
1923/**
2024 * Created by vangie on 14/12/4.
@@ -36,6 +40,19 @@ public class JpaConfig {
3640 @ Value ("${spring.datasource.driver-class-name}" )
3741 private String driverClassName ;
3842
43+ @ Value ("${CODING_IDE_HOME}" )
44+ private String codingIdeHome ;
45+
46+ @ PostConstruct
47+ public void init () throws IOException {
48+
49+ File file = new File (codingIdeHome );
50+
51+ if (!file .exists ()) {
52+ Files .createDirectories (file .toPath ());
53+ }
54+ }
55+
3956 @ Bean
4057 public DataSource dataSource () {
4158 DataSourceBuilder dataSourceBuilder = DataSourceBuilder .create ();
@@ -44,4 +61,6 @@ public DataSource dataSource() {
4461 dataSourceBuilder .type (HikariDataSource .class );
4562 return dataSourceBuilder .build ();
4663 }
64+
65+
4766}
You can’t perform that action at this time.
0 commit comments