This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| HttpRequest request = HttpRequest.newBuilder() | |
| .uri(new URI("https://postman-echo.com/get")) | |
| .version(HttpClient.Version.HTTP_2) | |
| .GET() | |
| .build(); | |
| HttpResponse<String> response = HttpClient.newHttpClient() | |
| .send(request, HttpResponse.BodyHandler.asString()); | |
| assertThat(response.version(), equalTo(HttpClient.Version.HTTP_1_1)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private final static String jsonUrl = "https://api.privatbank.ua/p24api/exchange_rates?json&date=01.04.2020"; | |
| private final static String path = "D:\\Programming\\java\\projects\\documents-parsing\\src\\resources\\json\\cats.json"; | |
| private final static String newFile = "D:\\Programming\\java\\projects\\documents-parsing\\src\\resources\\json\\catsFromGson.json"; | |
| GsonBuilder gsonBuilder = new GsonBuilder(); | |
| gsonBuilder.setPrettyPrinting(); | |
| Gson gson = gsonBuilder.create(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class JacksonExe { | |
| private final static String path = "D:\\Programming\\java\\projects\\documents-parsing\\src\\resources\\json\\cats.json"; | |
| private final static String jsonUrl = "https://api.privatbank.ua/p24api/exchange_rates?json&date=01.04.2020"; | |
| public static void main(String[] args) { | |
| ObjectMapper objectMapper = new ObjectMapper(); | |
| Cat[] cats = null; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static Connection getConnection() throws SQLException, ClassNotFoundException { | |
| Class.forName("org.postgresql.Driver"); | |
| return DriverManager.getConnection(PropertiesConfig.getProperty(PropertiesConfig.DB_URL), | |
| PropertiesConfig.getProperty(PropertiesConfig.DB_LOGIN), | |
| PropertiesConfig.getProperty(PropertiesConfig.DB_PASSWORD)); | |
| }; | |
| public static void main(String[] args) throws ClassNotFoundException, SQLException { | |
| Class.forName("org.postgresql.Driver"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @EnableWebSecurity | |
| public class JdbcSecurityConfiguration extends WebSecurityConfigurerAdapter { | |
| ... | |
| protected void configure(AuthenticationManagerBuilder auth) throws Exception { | |
| auth | |
| .jdbcAuthentication() | |
| .dataSource(dataSource) | |
| .passwordEncoder(passwordEncoder()) | |
| .usersByUsernameQuery( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ########## ==== H2 ==== ############ | |
| spring.jpa.hibernate.ddl-auto = update | |
| ### ==== Database Credentials ==== ### | |
| spring.datasource.url = jdbc:h2:mem:bh_workouts_postgres_2 | |
| spring.datasource.username = sa | |
| spring.datasource.password = | |
| ### ==== Driver ==== ### |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @Override | |
| protected void configure(HttpSecurity http) throws Exception { | |
| http.authorizeRequests() | |
| .antMatchers("/") | |
| .permitAll() | |
| .antMatchers("/login") | |
| .permitAll() | |
| .antMatchers("/registration") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM openjdk:11 | |
| ARG JAR_FILE=target/*.jar | |
| COPY ${JAR_FILE} sb-docker-1.jar | |
| ENTRYPOINT ["java","-jar","/sb-docker-1.jar"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| quarkus.datasource.jdbc.url=jdbc:mariadb://localhost:3306/mydb | |
| quarkus.datasource.db-kind=mariadb | |
| quarkus.datasource.username=developer | |
| quarkus.datasource.password=developer | |
| quarkus.hibernate-orm.database.generation=update |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM node:lts-alpine as build | |
| WORKDIR /usr/src/app | |
| COPY package*.json ./ | |
| RUN npm install | |
| COPY . . | |
| RUN npm run build | |
| FROM nginx:alpine | |
| COPY --from=build /usr/src/app/dist /usr/share/nginx/html | |
| COPY server/nginx.conf /etc/nginx/conf.d/default.conf |
OlderNewer