├── Chapter07 ├── KotlinBasics │ ├── test │ ├── .idea │ │ ├── encodings.xml │ │ ├── codeStyles │ │ │ ├── codeStyleConfig.xml │ │ │ └── Project.xml │ │ ├── misc.xml │ │ ├── modules.xml │ │ └── kotlinc.xml │ ├── src │ │ └── com │ │ │ └── nilangpatel │ │ │ └── kotlin │ │ │ ├── interoperability │ │ │ ├── CheckInterOperability.kt │ │ │ ├── KotlinFile.kt │ │ │ └── JavaFile.java │ │ │ ├── dataclasses │ │ │ ├── StudentVOKotlin.kt │ │ │ └── DataClassesDemo.kt │ │ │ ├── smartcast │ │ │ ├── CastExampleKotlin.kt │ │ │ └── CastExampleJava.java │ │ │ └── function │ │ │ ├── defaultarg │ │ │ └── CubeVolume.kt │ │ │ └── extension │ │ │ └── FunExtension.kt │ ├── out │ │ └── production │ │ │ └── KotlinBasics │ │ │ └── com │ │ │ └── nilangpatel │ │ │ └── kotlin │ │ │ ├── dataclasses │ │ │ ├── StudentVOJava.class │ │ │ ├── StudentVOKotlin.class │ │ │ └── DataClassesDemoKt.class │ │ │ ├── function │ │ │ ├── lamda │ │ │ │ ├── Applicant.class │ │ │ │ ├── LamdaDemo1Kt.class │ │ │ │ ├── LamdaDemo2Kt.class │ │ │ │ ├── LamdaDemo1Kt$main$1.class │ │ │ │ ├── LamdaDemo1Kt$main$addition$1.class │ │ │ │ ├── LamdaDemo1Kt$main$addition2$1.class │ │ │ │ ├── LamdaDemo1Kt$main$greetingMsg$1.class │ │ │ │ ├── LamdaDemo1Kt$main$showWarning$1.class │ │ │ │ ├── LamdaDemo2Kt$main$isEligible$1.class │ │ │ │ └── LamdaDemo2Kt$main$isEligible2$1.class │ │ │ ├── returnfromotherfun │ │ │ │ ├── Dog.class │ │ │ │ ├── Fox.class │ │ │ │ ├── Lion.class │ │ │ │ ├── WildAnimal.class │ │ │ │ ├── ReturnFromOtherFunDemoKt.class │ │ │ │ ├── ReturnFromOtherFunDemoKt$getAnimalVoiceFun$1.class │ │ │ │ ├── ReturnFromOtherFunDemoKt$main$getAnimalVoice$1$1.class │ │ │ │ └── ReturnFromOtherFunDemoKt$main$getAnimalVoice$1.class │ │ │ ├── defaultarg │ │ │ │ └── CubeVolumeKt.class │ │ │ ├── extension │ │ │ │ └── FunExtensionKt.class │ │ │ └── expression │ │ │ │ └── Function_expressionKt.class │ │ │ ├── interoperability │ │ │ ├── JavaFile.class │ │ │ ├── KotlinFileKt.class │ │ │ └── CheckInterOperabilityKt.class │ │ │ ├── nullcheck │ │ │ └── NullCheckDemoKt.class │ │ │ ├── smartcast │ │ │ ├── CastExampleJava.class │ │ │ └── CastExampleKotlinKt.class │ │ │ └── operatoroverload │ │ │ ├── CoordinatePoint.class │ │ │ └── OperatorOverloadDemoKt.class │ └── KotlinBasics.iml ├── ReadMe.txt └── taskmanagementsystem │ ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.properties │ │ └── maven-wrapper.jar │ ├── src │ ├── main │ │ ├── kotlin │ │ │ └── com │ │ │ │ └── nilangpatel │ │ │ │ └── tms │ │ │ │ ├── dto │ │ │ │ ├── CommentDTO.kt │ │ │ │ ├── UserDTO.kt │ │ │ │ ├── UserRegistrationDTO.kt │ │ │ │ └── TaskDTO.kt │ │ │ │ ├── repository │ │ │ │ ├── UserRepository.kt │ │ │ │ ├── CommentRepository.kt │ │ │ │ └── RoleRepository.kt │ │ │ │ ├── TaskmanagementsystemApplication.kt │ │ │ │ ├── constant │ │ │ │ ├── TaskStatus.kt │ │ │ │ └── TaskMgmntConstant.kt │ │ │ │ └── model │ │ │ │ └── CustomGrantedAuthority.kt │ │ └── resources │ │ │ ├── static │ │ │ └── js │ │ │ │ └── tms.js │ │ │ └── templates │ │ │ ├── home.html │ │ │ ├── control-page.html │ │ │ └── users.html │ └── test │ │ └── kotlin │ │ └── com │ │ └── nilangpatel │ │ └── tms │ │ └── taskmanagementsystem │ │ └── TaskmanagementsystemApplicationTests.kt │ └── .gitignore ├── Chapter05 ├── gdp │ ├── .prettierignore │ ├── src │ │ ├── test │ │ │ ├── resources │ │ │ │ ├── i18n │ │ │ │ │ └── messages_en.properties │ │ │ │ └── templates │ │ │ │ │ └── mail │ │ │ │ │ └── testEmail.html │ │ │ ├── javascript │ │ │ │ ├── jest.ts │ │ │ │ ├── spec │ │ │ │ │ └── helpers │ │ │ │ │ │ ├── mock-alert.service.ts │ │ │ │ │ │ ├── mock-event-manager.service.ts │ │ │ │ │ │ ├── mock-active-modal.service.ts │ │ │ │ │ │ ├── mock-principal.service.ts │ │ │ │ │ │ ├── mock-state-storage.service.ts │ │ │ │ │ │ └── mock-account.service.ts │ │ │ │ └── jest-global-mocks.ts │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── nilangpatel │ │ │ │ ├── repository │ │ │ │ └── timezone │ │ │ │ │ └── DateTimeWrapperRepository.java │ │ │ │ └── config │ │ │ │ └── WebConfigurerTestController.java │ │ └── main │ │ │ ├── resources │ │ │ └── config │ │ │ │ ├── liquibase │ │ │ │ ├── authorities.csv │ │ │ │ ├── users_authorities.csv │ │ │ │ └── users.csv │ │ │ │ └── tls │ │ │ │ └── keystore.p12 │ │ │ ├── webapp │ │ │ ├── app │ │ │ │ ├── shared │ │ │ │ │ ├── constants │ │ │ │ │ │ ├── pagination.constants.ts │ │ │ │ │ │ ├── input.constants.ts │ │ │ │ │ │ └── error.constants.ts │ │ │ │ │ ├── model │ │ │ │ │ │ ├── chart.gdp.model.ts │ │ │ │ │ │ ├── city.model.ts │ │ │ │ │ │ └── country-language.model.ts │ │ │ │ │ ├── shared-common.module.ts │ │ │ │ │ ├── language │ │ │ │ │ │ └── find-language-from-key.pipe.ts │ │ │ │ │ ├── util │ │ │ │ │ │ └── request-util.ts │ │ │ │ │ └── index.ts │ │ │ │ ├── admin │ │ │ │ │ ├── logs │ │ │ │ │ │ ├── log.model.ts │ │ │ │ │ │ └── logs.route.ts │ │ │ │ │ ├── audits │ │ │ │ │ │ ├── audit-data.model.ts │ │ │ │ │ │ ├── audit.model.ts │ │ │ │ │ │ └── audits.route.ts │ │ │ │ │ ├── docs │ │ │ │ │ │ ├── docs.component.html │ │ │ │ │ │ ├── docs.component.ts │ │ │ │ │ │ └── docs.route.ts │ │ │ │ │ ├── health │ │ │ │ │ │ └── health.route.ts │ │ │ │ │ ├── metrics │ │ │ │ │ │ ├── metrics.route.ts │ │ │ │ │ │ └── metrics.service.ts │ │ │ │ │ ├── configuration │ │ │ │ │ │ └── configuration.route.ts │ │ │ │ │ ├── admin.route.ts │ │ │ │ │ └── user-management │ │ │ │ │ │ └── user-management-detail.component.ts │ │ │ │ ├── home │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── home.route.ts │ │ │ │ │ └── home.module.ts │ │ │ │ ├── layouts │ │ │ │ │ ├── footer │ │ │ │ │ │ ├── footer.component.html │ │ │ │ │ │ └── footer.component.ts │ │ │ │ │ ├── profiles │ │ │ │ │ │ └── profile-info.model.ts │ │ │ │ │ ├── navbar │ │ │ │ │ │ └── navbar.route.ts │ │ │ │ │ ├── main │ │ │ │ │ │ └── main.component.html │ │ │ │ │ ├── index.ts │ │ │ │ │ └── error │ │ │ │ │ │ ├── error.route.ts │ │ │ │ │ │ └── error.component.html │ │ │ │ ├── account │ │ │ │ │ ├── sessions │ │ │ │ │ │ ├── session.model.ts │ │ │ │ │ │ └── sessions.route.ts │ │ │ │ │ ├── activate │ │ │ │ │ │ ├── activate.route.ts │ │ │ │ │ │ └── activate.service.ts │ │ │ │ │ ├── register │ │ │ │ │ │ ├── register.route.ts │ │ │ │ │ │ └── register.service.ts │ │ │ │ │ ├── password-reset │ │ │ │ │ │ ├── init │ │ │ │ │ │ │ ├── password-reset-init.route.ts │ │ │ │ │ │ │ └── password-reset-init.service.ts │ │ │ │ │ │ └── finish │ │ │ │ │ │ │ ├── password-reset-finish.route.ts │ │ │ │ │ │ │ └── password-reset-finish.service.ts │ │ │ │ │ ├── password │ │ │ │ │ │ ├── password.route.ts │ │ │ │ │ │ ├── password.service.ts │ │ │ │ │ │ └── password-strength-bar.scss │ │ │ │ │ ├── settings │ │ │ │ │ │ └── settings.route.ts │ │ │ │ │ └── account.route.ts │ │ │ │ ├── entities │ │ │ │ │ ├── city │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ └── city-detail.component.ts │ │ │ │ │ ├── country │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ └── country-detail.component.ts │ │ │ │ │ └── country-language │ │ │ │ │ │ └── index.ts │ │ │ │ ├── blocks │ │ │ │ │ └── config │ │ │ │ │ │ ├── prod.config.ts │ │ │ │ │ │ └── uib-pagination.config.ts │ │ │ │ ├── core │ │ │ │ │ ├── auth │ │ │ │ │ │ └── csrf.service.ts │ │ │ │ │ ├── user │ │ │ │ │ │ └── account.model.ts │ │ │ │ │ ├── language │ │ │ │ │ │ └── language.constants.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ └── core.module.ts │ │ │ │ ├── app.main.ts │ │ │ │ └── app.constants.ts │ │ │ ├── favicon.ico │ │ │ ├── content │ │ │ │ ├── images │ │ │ │ │ ├── hipster.png │ │ │ │ │ ├── hipster2x.png │ │ │ │ │ ├── hipster192.png │ │ │ │ │ ├── hipster256.png │ │ │ │ │ ├── hipster384.png │ │ │ │ │ ├── hipster512.png │ │ │ │ │ └── logo-jhipster.png │ │ │ │ └── scss │ │ │ │ │ └── vendor.scss │ │ │ ├── swagger-ui │ │ │ │ └── dist │ │ │ │ │ └── images │ │ │ │ │ └── throbber.gif │ │ │ ├── i18n │ │ │ │ └── en │ │ │ │ │ ├── trueFalse.json │ │ │ │ │ ├── configuration.json │ │ │ │ │ ├── logs.json │ │ │ │ │ ├── activate.json │ │ │ │ │ ├── password.json │ │ │ │ │ ├── continent.json │ │ │ │ │ ├── sessions.json │ │ │ │ │ ├── error.json │ │ │ │ │ └── login.json │ │ │ └── robots.txt │ │ │ ├── java │ │ │ └── com │ │ │ │ └── nilangpatel │ │ │ │ ├── domain │ │ │ │ ├── package-info.java │ │ │ │ ├── enumeration │ │ │ │ │ └── TrueFalse.java │ │ │ │ └── converter │ │ │ │ │ └── ContinentEnumConvertor.java │ │ │ │ ├── service │ │ │ │ ├── package-info.java │ │ │ │ ├── dto │ │ │ │ │ └── package-info.java │ │ │ │ └── mapper │ │ │ │ │ ├── package-info.java │ │ │ │ │ └── EntityMapper.java │ │ │ │ ├── config │ │ │ │ ├── audit │ │ │ │ │ └── package-info.java │ │ │ │ ├── package-info.java │ │ │ │ ├── ApplicationProperties.java │ │ │ │ ├── Constants.java │ │ │ │ └── LoggingAspectConfiguration.java │ │ │ │ ├── security │ │ │ │ ├── package-info.java │ │ │ │ ├── AuthoritiesConstants.java │ │ │ │ ├── UserNotActivatedException.java │ │ │ │ └── SpringSecurityAuditorAware.java │ │ │ │ ├── web │ │ │ │ └── rest │ │ │ │ │ ├── package-info.java │ │ │ │ │ ├── vm │ │ │ │ │ ├── package-info.java │ │ │ │ │ └── KeyAndPasswordVM.java │ │ │ │ │ └── errors │ │ │ │ │ ├── package-info.java │ │ │ │ │ ├── EmailAlreadyUsedException.java │ │ │ │ │ ├── LoginAlreadyUsedException.java │ │ │ │ │ ├── InvalidPasswordException.java │ │ │ │ │ ├── EmailNotFoundException.java │ │ │ │ │ └── InternalServerErrorException.java │ │ │ │ └── repository │ │ │ │ ├── package-info.java │ │ │ │ ├── AuthorityRepository.java │ │ │ │ ├── CityRepository.java │ │ │ │ ├── CountryRepository.java │ │ │ │ ├── CountryLanguageRepository.java │ │ │ │ └── PersistentTokenRepository.java │ │ │ ├── docker │ │ │ ├── sonar.yml │ │ │ ├── entrypoint.sh │ │ │ ├── .dockerignore │ │ │ ├── mysql.yml │ │ │ ├── Dockerfile │ │ │ └── app.yml │ │ │ └── jib │ │ │ └── entrypoint.sh │ ├── .huskyrc │ ├── postcss.config.js │ ├── webpack │ │ └── logo-jhipster.png │ ├── .mvn │ │ └── wrapper │ │ │ ├── maven-wrapper.jar │ │ │ └── maven-wrapper.properties │ ├── proxy.conf.json │ ├── .prettierrc │ └── .editorconfig └── ReadMe.txt ├── Chapter01 ├── worldgdp │ ├── .settings │ │ ├── org.eclipse.wst.jsdt.ui.superType.name │ │ ├── org.eclipse.wst.validation.prefs │ │ ├── org.eclipse.wst.jsdt.ui.superType.container │ │ ├── org.eclipse.m2e.core.prefs │ │ ├── org.eclipse.wst.common.project.facet.core.xml │ │ ├── org.eclipse.jdt.core.prefs │ │ ├── .jsdtscope │ │ └── org.eclipse.wst.common.component │ ├── target │ │ ├── m2e-wtp │ │ │ └── web-resources │ │ │ │ └── META-INF │ │ │ │ ├── MANIFEST.MF │ │ │ │ └── maven │ │ │ │ └── com.nilangpatel.worldgdp │ │ │ │ └── worldgdp │ │ │ │ └── pom.properties │ │ ├── classes │ │ │ ├── application.properties │ │ │ ├── com │ │ │ │ └── nilangpatel │ │ │ │ │ └── worldgdp │ │ │ │ │ ├── dao │ │ │ │ │ ├── CityDAO.class │ │ │ │ │ ├── LookupDAO.class │ │ │ │ │ ├── CountryDAO.class │ │ │ │ │ ├── CountryLanguageDAO.class │ │ │ │ │ └── mapper │ │ │ │ │ │ ├── CityRowMapper.class │ │ │ │ │ │ ├── CountryRowMapper.class │ │ │ │ │ │ └── CountryLanguageRowMapper.class │ │ │ │ │ ├── model │ │ │ │ │ ├── City.class │ │ │ │ │ ├── Country.class │ │ │ │ │ ├── CountryGDP.class │ │ │ │ │ └── CountryLanguage.class │ │ │ │ │ ├── AppConfiguration.class │ │ │ │ │ ├── config │ │ │ │ │ ├── DBConfiguration.class │ │ │ │ │ ├── ViewConfiguration.class │ │ │ │ │ └── PropertiesWithJavaConfig.class │ │ │ │ │ ├── WorldApplicationInitializer.class │ │ │ │ │ ├── external │ │ │ │ │ └── WorldBankApiClient.class │ │ │ │ │ └── controller │ │ │ │ │ ├── view │ │ │ │ │ └── ViewController.class │ │ │ │ │ └── api │ │ │ │ │ ├── CityAPIController.class │ │ │ │ │ ├── CountryAPIController.class │ │ │ │ │ └── CountryLanguageAPIController.class │ │ │ └── logback.xml │ │ ├── test-classes │ │ │ └── com │ │ │ │ └── nilangpatel │ │ │ │ └── test │ │ │ │ ├── dao │ │ │ │ ├── CityDAOTest.class │ │ │ │ ├── LookupDAOTest.class │ │ │ │ ├── CountryDAOTest.class │ │ │ │ └── CountryLanguageDAOTest.class │ │ │ │ ├── config │ │ │ │ ├── DBConfigurationTest.class │ │ │ │ ├── TestDBConfiguration.class │ │ │ │ └── controller │ │ │ │ │ └── api │ │ │ │ │ ├── CityAPIControllerTest.class │ │ │ │ │ ├── CountryAPIControllerTest.class │ │ │ │ │ └── CountryLanguageAPIControllerTest.class │ │ │ │ └── external │ │ │ │ └── WorldBankApiClientTest.class │ │ ├── maven-status │ │ │ └── maven-compiler-plugin │ │ │ │ └── testCompile │ │ │ │ └── default-testCompile │ │ │ │ └── createdFiles.lst │ │ └── surefire-reports │ │ │ ├── com.nilangpatel.test.dao.CityDAOTest.txt │ │ │ ├── com.nilangpatel.test.dao.CountryDAOTest.txt │ │ │ ├── com.nilangpatel.test.dao.LookupDAOTest.txt │ │ │ ├── com.nilangpatel.test.config.DBConfigurationTest.txt │ │ │ ├── com.nilangpatel.test.dao.CountryLanguageDAOTest.txt │ │ │ ├── com.nilangpatel.test.external.WorldBankApiClientTest.txt │ │ │ ├── com.nilangpatel.test.config.controller.api.CityAPIControllerTest.txt │ │ │ ├── com.nilangpatel.test.config.controller.api.CountryAPIControllerTest.txt │ │ │ └── com.nilangpatel.test.config.controller.api.CountryLanguageAPIControllerTest.txt │ └── src │ │ └── main │ │ ├── resources │ │ ├── application.properties │ │ └── logback.xml │ │ ├── webapp │ │ ├── static │ │ │ └── css │ │ │ │ └── style.css │ │ └── WEB-INF │ │ │ └── web.xml │ │ └── java │ │ └── com │ │ └── nilangpatel │ │ └── worldgdp │ │ ├── model │ │ └── CountryGDP.java │ │ ├── WorldApplicationInitializer.java │ │ ├── config │ │ └── PropertiesWithJavaConfig.java │ │ └── dao │ │ └── mapper │ │ └── CityRowMapper.java └── ReadMe.txt ├── Chapter06 ├── spring-cloud-config-server │ ├── src │ │ ├── main │ │ │ ├── resources │ │ │ │ ├── bootstrap.properties │ │ │ │ └── application.properties │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── spring │ │ │ │ └── cloud │ │ │ │ └── config │ │ │ │ └── SpringCloudConfigServerApplication.java │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── spring │ │ │ └── cloud │ │ │ └── config │ │ │ └── SpringCloudConfigServerApplicationTests.java │ ├── .mvn │ │ └── wrapper │ │ │ ├── maven-wrapper.properties │ │ │ └── maven-wrapper.jar │ └── .gitignore ├── book-service │ ├── .mvn │ │ └── wrapper │ │ │ ├── maven-wrapper.jar │ │ │ └── maven-wrapper.properties │ ├── src │ │ ├── main │ │ │ ├── resources │ │ │ │ └── application.properties │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── bookstore │ │ │ │ └── book │ │ │ │ ├── repository │ │ │ │ ├── BookRepository.java │ │ │ │ ├── CategoryRepository.java │ │ │ │ └── PublisherRepository.java │ │ │ │ └── BookServiceApplication.java │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── bookstore │ │ │ └── book │ │ │ └── BookServiceApplicationTests.java │ └── .gitignore ├── user-service │ ├── .mvn │ │ └── wrapper │ │ │ ├── maven-wrapper.jar │ │ │ └── maven-wrapper.properties │ ├── src │ │ ├── main │ │ │ ├── resources │ │ │ │ └── application.properties │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── bookstore │ │ │ │ └── user │ │ │ │ ├── repository │ │ │ │ ├── CustomUserRepository.java │ │ │ │ └── UserRepository.java │ │ │ │ └── config │ │ │ │ └── UserConfiguration.java │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── bookstore │ │ │ └── user │ │ │ └── UserServiceApplicationTests.java │ └── .gitignore ├── catalog-service │ ├── .mvn │ │ └── wrapper │ │ │ ├── maven-wrapper.jar │ │ │ └── maven-wrapper.properties │ ├── src │ │ ├── main │ │ │ ├── resources │ │ │ │ ├── application.properties │ │ │ │ └── bootstrap.properties │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── bookstore │ │ │ │ └── catalog │ │ │ │ ├── repository │ │ │ │ ├── BookRepository.java │ │ │ │ ├── CategoryRepository.java │ │ │ │ └── PublisherRepository.java │ │ │ │ └── CatalogServiceApplication.java │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── bookstore │ │ │ └── book │ │ │ └── BookServiceApplicationTests.java │ └── .gitignore ├── order-service │ ├── .mvn │ │ └── wrapper │ │ │ ├── maven-wrapper.jar │ │ │ └── maven-wrapper.properties │ ├── src │ │ ├── main │ │ │ ├── resources │ │ │ │ └── application.properties │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── bookstore │ │ │ │ └── order │ │ │ │ ├── repository │ │ │ │ └── OrderRepository.java │ │ │ │ └── OrderServiceApplication.java │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── bookstore │ │ │ └── order │ │ │ └── OrderServiceApplicationTests.java │ └── .gitignore ├── inventory-service │ ├── .mvn │ │ └── wrapper │ │ │ ├── maven-wrapper.jar │ │ │ └── maven-wrapper.properties │ ├── src │ │ ├── main │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── bookstore │ │ │ │ └── inventory │ │ │ │ └── repository │ │ │ │ └── InventoryRepository.java │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── bookstore │ │ │ └── inventory │ │ │ └── InventoryServiceApplicationTests.java │ └── .gitignore ├── zuul-api-gateway │ ├── .mvn │ │ └── wrapper │ │ │ ├── maven-wrapper.jar │ │ │ └── maven-wrapper.properties │ ├── .gitignore │ └── src │ │ └── test │ │ └── java │ │ └── com │ │ └── zuul │ │ └── apigateway │ │ └── ZuulApiGatewayApplicationTests.java ├── eureka-discovery-service │ ├── .mvn │ │ └── wrapper │ │ │ ├── maven-wrapper.properties │ │ │ └── maven-wrapper.jar │ ├── src │ │ ├── main │ │ │ ├── resources │ │ │ │ └── application.properties │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── eureka │ │ │ │ └── discovery │ │ │ │ └── EurekaDiscoveryServiceApplication.java │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── eureka │ │ │ └── discovery │ │ │ └── EurekaDiscoveryServiceApplicationTests.java │ └── .gitignore ├── bookstore-authorization-server │ ├── .mvn │ │ └── wrapper │ │ │ ├── maven-wrapper.properties │ │ │ └── maven-wrapper.jar │ ├── src │ │ ├── main │ │ │ ├── resources │ │ │ │ └── application.properties │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── bookstore │ │ │ │ └── auth │ │ │ │ ├── controller │ │ │ │ └── WebMvcController.java │ │ │ │ ├── user │ │ │ │ └── repository │ │ │ │ │ └── UserRepository.java │ │ │ │ └── BookstoreAuthorizationServerApplication.java │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── bookstore │ │ │ └── auth │ │ │ └── BookstoreAuthorizationServerApplicationTests.java │ └── .gitignore └── ReadMe.txt ├── Chapter03 ├── ReadMe.txt └── blogpress │ ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties │ ├── src │ └── main │ │ ├── resources │ │ ├── application.properties │ │ └── static │ │ │ ├── js │ │ │ └── blogpress.js │ │ │ └── css │ │ │ └── blogpress.css │ │ └── java │ │ └── com │ │ └── nilangpatel │ │ └── blogpress │ │ ├── constants │ │ ├── BlogStatus.java │ │ └── CommentStatus.java │ │ ├── BlogpressApplication.java │ │ ├── ServletInitializer.java │ │ ├── repository │ │ ├── BlogRepository.java │ │ └── BlogRepositoryCustom.java │ │ └── util │ │ └── BlogpressCommentComparator.java │ └── .gitignore ├── Chapter04 ├── SpringCustomAuthorization │ ├── src │ │ └── main │ │ │ ├── resources │ │ │ ├── application.properties │ │ │ ├── static │ │ │ │ └── css │ │ │ │ │ └── blogpress.css │ │ │ └── templates │ │ │ │ └── private-page.html │ │ │ └── java │ │ │ └── com │ │ │ └── nilangpatel │ │ │ └── springcustomauth │ │ │ └── ServletInitializer.java │ ├── .mvn │ │ └── wrapper │ │ │ ├── maven-wrapper.properties │ │ │ └── maven-wrapper.jar │ └── .gitignore ├── SpringAuthResource │ ├── src │ │ └── main │ │ │ ├── resources │ │ │ ├── templates │ │ │ │ ├── authorize.html │ │ │ │ └── private-page.html │ │ │ ├── application.properties │ │ │ └── static │ │ │ │ └── css │ │ │ │ └── blogpress.css │ │ │ └── java │ │ │ └── com │ │ │ └── nilangpatel │ │ │ └── springauthresource │ │ │ ├── SpringAuthResourceApplication.java │ │ │ ├── ServletInitializer.java │ │ │ └── model │ │ │ └── SampleUser.java │ ├── .mvn │ │ └── wrapper │ │ │ ├── maven-wrapper.properties │ │ │ └── maven-wrapper.jar │ └── .gitignore ├── SpringOnlyLDAP │ ├── .mvn │ │ └── wrapper │ │ │ ├── maven-wrapper.properties │ │ │ └── maven-wrapper.jar │ ├── src │ │ └── main │ │ │ ├── resources │ │ │ ├── application.properties │ │ │ ├── static │ │ │ │ └── css │ │ │ │ │ └── blogpress.css │ │ │ └── templates │ │ │ │ ├── home.html │ │ │ │ └── private-page.html │ │ │ └── java │ │ │ └── com │ │ │ └── nilangpatel │ │ │ └── springldap │ │ │ ├── constants │ │ │ ├── PwdEncodingAlgo.java │ │ │ └── LdapAuthConstant.java │ │ │ ├── SpringLdapApplication.java │ │ │ └── ServletInitializer.java │ └── .gitignore ├── SpringOnlyOAuth │ ├── .mvn │ │ └── wrapper │ │ │ ├── maven-wrapper.properties │ │ │ └── maven-wrapper.jar │ ├── src │ │ └── main │ │ │ ├── resources │ │ │ ├── static │ │ │ │ └── css │ │ │ │ │ └── blogpress.css │ │ │ └── templates │ │ │ │ ├── home.html │ │ │ │ └── private-page.html │ │ │ └── java │ │ │ └── com │ │ │ └── nilangpatel │ │ │ └── springoauth │ │ │ ├── constants │ │ │ └── OAuthConstant.java │ │ │ ├── SpringOAuthApplication.java │ │ │ └── ServletInitializer.java │ └── .gitignore ├── SpringLdapAndOAuth │ ├── .mvn │ │ └── wrapper │ │ │ ├── maven-wrapper.properties │ │ │ └── maven-wrapper.jar │ ├── src │ │ └── main │ │ │ ├── resources │ │ │ ├── static │ │ │ │ └── css │ │ │ │ │ └── blogpress.css │ │ │ └── templates │ │ │ │ ├── user-page.html │ │ │ │ ├── home.html │ │ │ │ ├── admin-page.html │ │ │ │ └── private-page.html │ │ │ └── java │ │ │ └── com │ │ │ └── nilangpatel │ │ │ └── springauth │ │ │ ├── constants │ │ │ ├── PwdEncodingAlgo.java │ │ │ └── LdapAuthConstant.java │ │ │ ├── SpringAuthApplication.java │ │ │ ├── repository │ │ │ └── LdapAuthRepository.java │ │ │ ├── model │ │ │ └── LdapGranntedAuthority.java │ │ │ └── ServletInitializer.java │ └── .gitignore └── ReadMe.txt └── Chapter02 ├── simple-reactor-demo ├── .settings │ └── org.eclipse.m2e.core.prefs ├── target │ └── classes │ │ ├── META-INF │ │ ├── MANIFEST.MF │ │ └── maven │ │ │ └── reactor-demo │ │ │ └── simple-reactor-demo │ │ │ ├── pom.properties │ │ │ └── pom.xml │ │ └── com │ │ └── nilangpatel │ │ └── reactor │ │ ├── ReactorBasic.class │ │ ├── ReactorCustomSubscriber.class │ │ ├── ReactorLifecycleMethods.class │ │ ├── ReactorFromOtherPublisher.class │ │ ├── ReactorWithSubscriberWays.class │ │ └── ReactorCustomSubscriber$CustomSubscriber.class ├── pom.xml └── .project ├── simple-rx-java-demo ├── .settings │ └── org.eclipse.m2e.core.prefs ├── target │ └── classes │ │ ├── META-INF │ │ ├── MANIFEST.MF │ │ └── maven │ │ │ └── rx-java │ │ │ └── simple-rx-java-demo │ │ │ ├── pom.properties │ │ │ └── pom.xml │ │ └── com │ │ └── nilangpatel │ │ └── rxjava │ │ ├── RxJavaBasics.class │ │ ├── EmployeeRating.class │ │ ├── RxJavaCreateDemo.class │ │ ├── RxJavaIterableDemo.class │ │ ├── RxJavaColdObservable.class │ │ ├── RxJavaHotObservable1.class │ │ ├── RxJavaHotObservable2.class │ │ ├── RxJavaCustomObserverDemo.class │ │ └── RxJavaCustomObserverDemo$1.class ├── pom.xml ├── .project └── src │ └── main │ └── java │ └── com │ └── nilangpatel │ └── rxjava │ └── RxJavaBasics.java ├── SpringWebFluxDemo ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── src │ ├── main │ │ ├── resources │ │ │ └── application.properties │ │ └── java │ │ │ └── com │ │ │ └── nilangpatel │ │ │ └── webflux │ │ │ └── repository │ │ │ └── StudentMongoRepository.java │ └── test │ │ └── java │ │ └── com │ │ └── nilangpatel │ │ └── webflux │ │ └── SpringWebFluxDemoApplicationTests.java └── .gitignore └── ReadMe.txt /Chapter07/KotlinBasics/test: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Chapter05/gdp/.prettierignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | target 3 | -------------------------------------------------------------------------------- /Chapter01/worldgdp/.settings/org.eclipse.wst.jsdt.ui.superType.name: -------------------------------------------------------------------------------- 1 | Window -------------------------------------------------------------------------------- /Chapter06/spring-cloud-config-server/src/main/resources/bootstrap.properties: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Chapter01/ReadMe.txt: -------------------------------------------------------------------------------- 1 | The folder worldgdp contain the project for showing GDP infromation -------------------------------------------------------------------------------- /Chapter05/ReadMe.txt: -------------------------------------------------------------------------------- 1 | The folder gdp contain JHipster code for running GDP application -------------------------------------------------------------------------------- /Chapter03/ReadMe.txt: -------------------------------------------------------------------------------- 1 | blogpress folder contains the Spring project for BlogPress application -------------------------------------------------------------------------------- /Chapter04/SpringCustomAuthorization/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port=8081 -------------------------------------------------------------------------------- /Chapter05/gdp/src/test/resources/i18n/messages_en.properties: -------------------------------------------------------------------------------- 1 | email.test.title=test title 2 | -------------------------------------------------------------------------------- /Chapter05/gdp/.huskyrc: -------------------------------------------------------------------------------- 1 | { 2 | "hooks": { 3 | "pre-commit": "lint-staged" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/resources/config/liquibase/authorities.csv: -------------------------------------------------------------------------------- 1 | name 2 | ROLE_ADMIN 3 | ROLE_USER 4 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/app/shared/constants/pagination.constants.ts: -------------------------------------------------------------------------------- 1 | export const ITEMS_PER_PAGE = 20; 2 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/test/javascript/jest.ts: -------------------------------------------------------------------------------- 1 | import 'jest-preset-angular'; 2 | import './jest-global-mocks'; 3 | -------------------------------------------------------------------------------- /Chapter01/worldgdp/.settings/org.eclipse.wst.validation.prefs: -------------------------------------------------------------------------------- 1 | disabled=06target 2 | eclipse.preferences.version=1 3 | -------------------------------------------------------------------------------- /Chapter01/worldgdp/.settings/org.eclipse.wst.jsdt.ui.superType.container: -------------------------------------------------------------------------------- 1 | org.eclipse.wst.jsdt.launching.baseBrowserLibrary -------------------------------------------------------------------------------- /Chapter05/gdp/postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: [ 3 | require('autoprefixer') 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /Chapter04/SpringAuthResource/src/main/resources/templates/authorize.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/java/com/nilangpatel/domain/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * JPA domain objects. 3 | */ 4 | package com.nilangpatel.domain; 5 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/app/shared/model/chart.gdp.model.ts: -------------------------------------------------------------------------------- 1 | export interface IGdpData { 2 | date?: number; 3 | value?: number; 4 | } 5 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/java/com/nilangpatel/service/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Service layer beans. 3 | */ 4 | package com.nilangpatel.service; 5 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/app/admin/logs/log.model.ts: -------------------------------------------------------------------------------- 1 | export class Log { 2 | constructor(public name: string, public level: string) {} 3 | } 4 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter05/gdp/src/main/webapp/favicon.ico -------------------------------------------------------------------------------- /Chapter05/gdp/webpack/logo-jhipster.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter05/gdp/webpack/logo-jhipster.png -------------------------------------------------------------------------------- /Chapter01/worldgdp/.settings/org.eclipse.m2e.core.prefs: -------------------------------------------------------------------------------- 1 | activeProfiles= 2 | eclipse.preferences.version=1 3 | resolveWorkspaceProjects=true 4 | version=1 5 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/app/home/index.ts: -------------------------------------------------------------------------------- 1 | export * from './home.component'; 2 | export * from './home.route'; 3 | export * from './home.module'; 4 | -------------------------------------------------------------------------------- /Chapter05/gdp/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter05/gdp/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/java/com/nilangpatel/config/audit/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Audit specific code. 3 | */ 4 | package com.nilangpatel.config.audit; 5 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/java/com/nilangpatel/security/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Spring Security configuration. 3 | */ 4 | package com.nilangpatel.security; 5 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/java/com/nilangpatel/service/dto/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Data Transfer Objects. 3 | */ 4 | package com.nilangpatel.service.dto; 5 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/java/com/nilangpatel/web/rest/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Spring MVC REST controllers. 3 | */ 4 | package com.nilangpatel.web.rest; 5 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/app/layouts/footer/footer.component.html: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /Chapter02/simple-reactor-demo/.settings/org.eclipse.m2e.core.prefs: -------------------------------------------------------------------------------- 1 | activeProfiles= 2 | eclipse.preferences.version=1 3 | resolveWorkspaceProjects=true 4 | version=1 5 | -------------------------------------------------------------------------------- /Chapter02/simple-rx-java-demo/.settings/org.eclipse.m2e.core.prefs: -------------------------------------------------------------------------------- 1 | activeProfiles= 2 | eclipse.preferences.version=1 3 | resolveWorkspaceProjects=true 4 | version=1 5 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/java/com/nilangpatel/config/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Spring Framework configuration files. 3 | */ 4 | package com.nilangpatel.config; 5 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/java/com/nilangpatel/repository/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Spring Data JPA repositories. 3 | */ 4 | package com.nilangpatel.repository; 5 | -------------------------------------------------------------------------------- /Chapter03/blogpress/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter03/blogpress/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /Chapter03/blogpress/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip 2 | -------------------------------------------------------------------------------- /Chapter05/gdp/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.0/apache-maven-3.6.0-bin.zip 2 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/app/shared/constants/input.constants.ts: -------------------------------------------------------------------------------- 1 | export const DATE_FORMAT = 'YYYY-MM-DD'; 2 | export const DATE_TIME_FORMAT = 'YYYY-MM-DDTHH:mm'; 3 | -------------------------------------------------------------------------------- /Chapter04/SpringOnlyLDAP/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip 2 | -------------------------------------------------------------------------------- /Chapter04/SpringOnlyOAuth/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip 2 | -------------------------------------------------------------------------------- /Chapter05/gdp/proxy.conf.json: -------------------------------------------------------------------------------- 1 | { 2 | "*": { 3 | "target": "http://localhost:8080", 4 | "secure": false, 5 | "loglevel": "debug" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/test/resources/templates/mail/testEmail.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Chapter06/book-service/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter06/book-service/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /Chapter06/user-service/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter06/user-service/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /Chapter04/SpringLdapAndOAuth/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip 2 | -------------------------------------------------------------------------------- /Chapter04/SpringOnlyLDAP/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter04/SpringOnlyLDAP/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /Chapter04/SpringOnlyOAuth/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter04/SpringOnlyOAuth/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/resources/config/liquibase/users_authorities.csv: -------------------------------------------------------------------------------- 1 | user_id;authority_name 2 | 1;ROLE_ADMIN 3 | 1;ROLE_USER 4 | 3;ROLE_ADMIN 5 | 3;ROLE_USER 6 | 4;ROLE_USER 7 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/resources/config/tls/keystore.p12: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter05/gdp/src/main/resources/config/tls/keystore.p12 -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/app/admin/audits/audit-data.model.ts: -------------------------------------------------------------------------------- 1 | export class AuditData { 2 | constructor(public remoteAddress: string, public sessionId: string) {} 3 | } 4 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/content/images/hipster.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter05/gdp/src/main/webapp/content/images/hipster.png -------------------------------------------------------------------------------- /Chapter06/book-service/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip 2 | -------------------------------------------------------------------------------- /Chapter06/catalog-service/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter06/catalog-service/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /Chapter06/catalog-service/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip 2 | -------------------------------------------------------------------------------- /Chapter06/order-service/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter06/order-service/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /Chapter06/order-service/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip 2 | -------------------------------------------------------------------------------- /Chapter06/user-service/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip 2 | -------------------------------------------------------------------------------- /Chapter07/ReadMe.txt: -------------------------------------------------------------------------------- 1 | KotlinBasics - contains code for core Kotlin functionalities. 2 | taskmanagementsystem - contains code for Task management system build in Kotlin and Spring Boot -------------------------------------------------------------------------------- /Chapter02/SpringWebFluxDemo/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter02/SpringWebFluxDemo/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /Chapter02/SpringWebFluxDemo/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.0/apache-maven-3.6.0-bin.zip 2 | -------------------------------------------------------------------------------- /Chapter02/simple-reactor-demo/target/classes/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Built-By: nilang 3 | Build-Jdk: 1.8.0_181 4 | Created-By: Maven Integration for Eclipse 5 | 6 | -------------------------------------------------------------------------------- /Chapter02/simple-rx-java-demo/target/classes/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Built-By: nilang 3 | Build-Jdk: 1.8.0_181 4 | Created-By: Maven Integration for Eclipse 5 | 6 | -------------------------------------------------------------------------------- /Chapter04/SpringAuthResource/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip 2 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/java/com/nilangpatel/web/rest/vm/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * View Models used by Spring MVC REST controllers. 3 | */ 4 | package com.nilangpatel.web.rest.vm; 5 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/content/images/hipster2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter05/gdp/src/main/webapp/content/images/hipster2x.png -------------------------------------------------------------------------------- /Chapter06/inventory-service/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter06/inventory-service/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /Chapter06/inventory-service/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip 2 | -------------------------------------------------------------------------------- /Chapter06/zuul-api-gateway/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter06/zuul-api-gateway/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /Chapter06/zuul-api-gateway/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip 2 | -------------------------------------------------------------------------------- /Chapter07/taskmanagementsystem/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip 2 | -------------------------------------------------------------------------------- /Chapter01/worldgdp/target/m2e-wtp/web-resources/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Built-By: nilang 3 | Build-Jdk: 1.8.0_181 4 | Created-By: Maven Integration for Eclipse 5 | 6 | -------------------------------------------------------------------------------- /Chapter02/ReadMe.txt: -------------------------------------------------------------------------------- 1 | simple-reactor-demo - contains code for reactor API. 2 | simple-rx-java-demo - contains code for RxJava API. 3 | SpringWebFluxDemo - contains code for WebFlux in Spring. -------------------------------------------------------------------------------- /Chapter04/SpringAuthResource/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter04/SpringAuthResource/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /Chapter04/SpringCustomAuthorization/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip 2 | -------------------------------------------------------------------------------- /Chapter04/SpringLdapAndOAuth/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter04/SpringLdapAndOAuth/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/content/images/hipster192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter05/gdp/src/main/webapp/content/images/hipster192.png -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/content/images/hipster256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter05/gdp/src/main/webapp/content/images/hipster256.png -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/content/images/hipster384.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter05/gdp/src/main/webapp/content/images/hipster384.png -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/content/images/hipster512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter05/gdp/src/main/webapp/content/images/hipster512.png -------------------------------------------------------------------------------- /Chapter06/eureka-discovery-service/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip 2 | -------------------------------------------------------------------------------- /Chapter07/KotlinBasics/.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Chapter07/taskmanagementsystem/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter07/taskmanagementsystem/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/docker/sonar.yml: -------------------------------------------------------------------------------- 1 | version: '2' 2 | services: 3 | gdp-sonar: 4 | image: sonarqube:7.1 5 | ports: 6 | - 9001:9000 7 | - 9092:9092 8 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/content/images/logo-jhipster.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter05/gdp/src/main/webapp/content/images/logo-jhipster.png -------------------------------------------------------------------------------- /Chapter06/book-service/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.url=jdbc:mysql://localhost:3306/ob_catalog 2 | spring.datasource.password=test 3 | spring.datasource.username=root -------------------------------------------------------------------------------- /Chapter06/bookstore-authorization-server/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip 2 | -------------------------------------------------------------------------------- /Chapter06/spring-cloud-config-server/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip 2 | -------------------------------------------------------------------------------- /Chapter07/taskmanagementsystem/src/main/kotlin/com/nilangpatel/tms/dto/CommentDTO.kt: -------------------------------------------------------------------------------- 1 | package com.nilangpatel.tms.dto 2 | 3 | data class CommentDTO(var id:Int,var comment:String,var userName:String) -------------------------------------------------------------------------------- /Chapter01/worldgdp/target/classes/application.properties: -------------------------------------------------------------------------------- 1 | dataSourceClassName=com.mysql.jdbc.Driver 2 | jdbcUrl=jdbc:mysql://localhost:3306/worldgdp 3 | dataSource.user=root 4 | dataSource.password=test -------------------------------------------------------------------------------- /Chapter04/SpringCustomAuthorization/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter04/SpringCustomAuthorization/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/swagger-ui/dist/images/throbber.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter05/gdp/src/main/webapp/swagger-ui/dist/images/throbber.gif -------------------------------------------------------------------------------- /Chapter06/catalog-service/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.url=jdbc:mysql://localhost:3306/ob_catalog 2 | spring.datasource.password=test 3 | spring.datasource.username=root -------------------------------------------------------------------------------- /Chapter06/eureka-discovery-service/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter06/eureka-discovery-service/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /Chapter01/worldgdp/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | dataSourceClassName=com.mysql.jdbc.Driver 2 | jdbcUrl=jdbc:mysql://localhost:3306/worldgdp 3 | dataSource.user=root 4 | dataSource.password=test -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/app/admin/docs/docs.component.html: -------------------------------------------------------------------------------- 1 | 3 | -------------------------------------------------------------------------------- /Chapter06/spring-cloud-config-server/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter06/spring-cloud-config-server/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /Chapter06/bookstore-authorization-server/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter06/bookstore-authorization-server/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/java/com/nilangpatel/service/mapper/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * MapStruct mappers for mapping domain objects and Data Transfer Objects. 3 | */ 4 | package com.nilangpatel.service.mapper; 5 | -------------------------------------------------------------------------------- /Chapter07/KotlinBasics/.idea/codeStyles/codeStyleConfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /Chapter01/worldgdp/target/classes/com/nilangpatel/worldgdp/dao/CityDAO.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter01/worldgdp/target/classes/com/nilangpatel/worldgdp/dao/CityDAO.class -------------------------------------------------------------------------------- /Chapter01/worldgdp/target/classes/com/nilangpatel/worldgdp/model/City.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter01/worldgdp/target/classes/com/nilangpatel/worldgdp/model/City.class -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/app/account/sessions/session.model.ts: -------------------------------------------------------------------------------- 1 | export class Session { 2 | constructor(public series: string, public tokenDate: Date, public ipAddress: string, public userAgent: string) {} 3 | } 4 | -------------------------------------------------------------------------------- /Chapter01/worldgdp/target/classes/com/nilangpatel/worldgdp/dao/LookupDAO.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter01/worldgdp/target/classes/com/nilangpatel/worldgdp/dao/LookupDAO.class -------------------------------------------------------------------------------- /Chapter01/worldgdp/target/classes/com/nilangpatel/worldgdp/model/Country.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter01/worldgdp/target/classes/com/nilangpatel/worldgdp/model/Country.class -------------------------------------------------------------------------------- /Chapter04/SpringOnlyLDAP/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.ldap.urls=ldap://localhost:10389 2 | spring.ldap.base=o=packtPublisher 3 | spring.ldap.password=secret 4 | spring.ldap.username=uid=admin,ou=system 5 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/java/com/nilangpatel/domain/enumeration/TrueFalse.java: -------------------------------------------------------------------------------- 1 | package com.nilangpatel.domain.enumeration; 2 | 3 | /** 4 | * The TrueFalse enumeration. 5 | */ 6 | public enum TrueFalse { 7 | T, F 8 | } 9 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/i18n/en/trueFalse.json: -------------------------------------------------------------------------------- 1 | { 2 | "gdpApp": { 3 | "TrueFalse": { 4 | "null": "", 5 | "T": "T", 6 | "F": "F" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Chapter07/KotlinBasics/src/com/nilangpatel/kotlin/interoperability/CheckInterOperability.kt: -------------------------------------------------------------------------------- 1 | package com.nilangpatel.kotlin.interoperability 2 | 3 | fun greeting(name: String){ 4 | print(" Hello $name !!!") 5 | } 6 | 7 | -------------------------------------------------------------------------------- /Chapter07/taskmanagementsystem/src/main/kotlin/com/nilangpatel/tms/dto/UserDTO.kt: -------------------------------------------------------------------------------- 1 | package com.nilangpatel.tms.dto 2 | 3 | data class UserDTO(var username:String,var password:String, var firstname:String, var lastname:String) -------------------------------------------------------------------------------- /Chapter01/worldgdp/target/classes/com/nilangpatel/worldgdp/AppConfiguration.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter01/worldgdp/target/classes/com/nilangpatel/worldgdp/AppConfiguration.class -------------------------------------------------------------------------------- /Chapter01/worldgdp/target/classes/com/nilangpatel/worldgdp/dao/CountryDAO.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter01/worldgdp/target/classes/com/nilangpatel/worldgdp/dao/CountryDAO.class -------------------------------------------------------------------------------- /Chapter01/worldgdp/target/classes/com/nilangpatel/worldgdp/model/CountryGDP.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter01/worldgdp/target/classes/com/nilangpatel/worldgdp/model/CountryGDP.class -------------------------------------------------------------------------------- /Chapter01/worldgdp/target/test-classes/com/nilangpatel/test/dao/CityDAOTest.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter01/worldgdp/target/test-classes/com/nilangpatel/test/dao/CityDAOTest.class -------------------------------------------------------------------------------- /Chapter01/worldgdp/target/test-classes/com/nilangpatel/test/dao/LookupDAOTest.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter01/worldgdp/target/test-classes/com/nilangpatel/test/dao/LookupDAOTest.class -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/app/layouts/profiles/profile-info.model.ts: -------------------------------------------------------------------------------- 1 | export class ProfileInfo { 2 | activeProfiles: string[]; 3 | ribbonEnv: string; 4 | inProduction: boolean; 5 | swaggerEnabled: boolean; 6 | } 7 | -------------------------------------------------------------------------------- /Chapter01/worldgdp/src/main/webapp/static/css/style.css: -------------------------------------------------------------------------------- 1 | .grey { 2 | color: lightgrey; 3 | } 4 | 5 | #footer { 6 | margin: 2em 0; 7 | } 8 | 9 | .modal-form-footer { 10 | padding: 10px; 11 | border-top: 1px solid #e5e5e5; 12 | } -------------------------------------------------------------------------------- /Chapter01/worldgdp/target/classes/com/nilangpatel/worldgdp/model/CountryLanguage.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter01/worldgdp/target/classes/com/nilangpatel/worldgdp/model/CountryLanguage.class -------------------------------------------------------------------------------- /Chapter01/worldgdp/target/test-classes/com/nilangpatel/test/dao/CountryDAOTest.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter01/worldgdp/target/test-classes/com/nilangpatel/test/dao/CountryDAOTest.class -------------------------------------------------------------------------------- /Chapter02/simple-rx-java-demo/target/classes/com/nilangpatel/rxjava/RxJavaBasics.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter02/simple-rx-java-demo/target/classes/com/nilangpatel/rxjava/RxJavaBasics.class -------------------------------------------------------------------------------- /Chapter06/catalog-service/src/main/resources/bootstrap.properties: -------------------------------------------------------------------------------- 1 | spring.application.name=catalog-service 2 | server.port=8792 3 | 4 | spring.cloud.config.uri=http://localhost:8901 5 | 6 | management.endpoints.web.exposure.include=* 7 | 8 | -------------------------------------------------------------------------------- /Chapter01/worldgdp/target/classes/com/nilangpatel/worldgdp/config/DBConfiguration.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter01/worldgdp/target/classes/com/nilangpatel/worldgdp/config/DBConfiguration.class -------------------------------------------------------------------------------- /Chapter01/worldgdp/target/classes/com/nilangpatel/worldgdp/dao/CountryLanguageDAO.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter01/worldgdp/target/classes/com/nilangpatel/worldgdp/dao/CountryLanguageDAO.class -------------------------------------------------------------------------------- /Chapter02/simple-reactor-demo/target/classes/com/nilangpatel/reactor/ReactorBasic.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter02/simple-reactor-demo/target/classes/com/nilangpatel/reactor/ReactorBasic.class -------------------------------------------------------------------------------- /Chapter02/simple-rx-java-demo/target/classes/com/nilangpatel/rxjava/EmployeeRating.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter02/simple-rx-java-demo/target/classes/com/nilangpatel/rxjava/EmployeeRating.class -------------------------------------------------------------------------------- /Chapter03/blogpress/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.security.user.name=nilang 2 | spring.security.user.password=password 3 | 4 | elasticsearch.clustername=elasticsearch 5 | elasticsearch.host=localhost 6 | elasticsearch.port=9300 -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/docker/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo "The application will start in ${JHIPSTER_SLEEP}s..." && sleep ${JHIPSTER_SLEEP} 4 | exec java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar "${HOME}/app.war" "$@" 5 | -------------------------------------------------------------------------------- /Chapter06/spring-cloud-config-server/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.application.name=spring-cloud-config-server 2 | server.port=8901 3 | 4 | spring.cloud.config.server.git.uri=file://D:/projects/book_writing/git_central_config -------------------------------------------------------------------------------- /Chapter01/worldgdp/target/classes/com/nilangpatel/worldgdp/config/ViewConfiguration.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter01/worldgdp/target/classes/com/nilangpatel/worldgdp/config/ViewConfiguration.class -------------------------------------------------------------------------------- /Chapter01/worldgdp/target/classes/com/nilangpatel/worldgdp/dao/mapper/CityRowMapper.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter01/worldgdp/target/classes/com/nilangpatel/worldgdp/dao/mapper/CityRowMapper.class -------------------------------------------------------------------------------- /Chapter02/simple-rx-java-demo/target/classes/com/nilangpatel/rxjava/RxJavaCreateDemo.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter02/simple-rx-java-demo/target/classes/com/nilangpatel/rxjava/RxJavaCreateDemo.class -------------------------------------------------------------------------------- /Chapter01/worldgdp/target/classes/com/nilangpatel/worldgdp/WorldApplicationInitializer.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter01/worldgdp/target/classes/com/nilangpatel/worldgdp/WorldApplicationInitializer.class -------------------------------------------------------------------------------- /Chapter01/worldgdp/target/classes/com/nilangpatel/worldgdp/dao/mapper/CountryRowMapper.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter01/worldgdp/target/classes/com/nilangpatel/worldgdp/dao/mapper/CountryRowMapper.class -------------------------------------------------------------------------------- /Chapter01/worldgdp/target/classes/com/nilangpatel/worldgdp/external/WorldBankApiClient.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter01/worldgdp/target/classes/com/nilangpatel/worldgdp/external/WorldBankApiClient.class -------------------------------------------------------------------------------- /Chapter01/worldgdp/target/test-classes/com/nilangpatel/test/config/DBConfigurationTest.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter01/worldgdp/target/test-classes/com/nilangpatel/test/config/DBConfigurationTest.class -------------------------------------------------------------------------------- /Chapter01/worldgdp/target/test-classes/com/nilangpatel/test/config/TestDBConfiguration.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter01/worldgdp/target/test-classes/com/nilangpatel/test/config/TestDBConfiguration.class -------------------------------------------------------------------------------- /Chapter01/worldgdp/target/test-classes/com/nilangpatel/test/dao/CountryLanguageDAOTest.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter01/worldgdp/target/test-classes/com/nilangpatel/test/dao/CountryLanguageDAOTest.class -------------------------------------------------------------------------------- /Chapter02/simple-rx-java-demo/target/classes/com/nilangpatel/rxjava/RxJavaIterableDemo.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter02/simple-rx-java-demo/target/classes/com/nilangpatel/rxjava/RxJavaIterableDemo.class -------------------------------------------------------------------------------- /Chapter01/worldgdp/target/classes/com/nilangpatel/worldgdp/config/PropertiesWithJavaConfig.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter01/worldgdp/target/classes/com/nilangpatel/worldgdp/config/PropertiesWithJavaConfig.class -------------------------------------------------------------------------------- /Chapter01/worldgdp/target/classes/com/nilangpatel/worldgdp/controller/view/ViewController.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter01/worldgdp/target/classes/com/nilangpatel/worldgdp/controller/view/ViewController.class -------------------------------------------------------------------------------- /Chapter02/simple-rx-java-demo/target/classes/com/nilangpatel/rxjava/RxJavaColdObservable.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter02/simple-rx-java-demo/target/classes/com/nilangpatel/rxjava/RxJavaColdObservable.class -------------------------------------------------------------------------------- /Chapter02/simple-rx-java-demo/target/classes/com/nilangpatel/rxjava/RxJavaHotObservable1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter02/simple-rx-java-demo/target/classes/com/nilangpatel/rxjava/RxJavaHotObservable1.class -------------------------------------------------------------------------------- /Chapter02/simple-rx-java-demo/target/classes/com/nilangpatel/rxjava/RxJavaHotObservable2.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter02/simple-rx-java-demo/target/classes/com/nilangpatel/rxjava/RxJavaHotObservable2.class -------------------------------------------------------------------------------- /Chapter05/gdp/.prettierrc: -------------------------------------------------------------------------------- 1 | # Prettier configuration 2 | 3 | printWidth: 140 4 | singleQuote: true 5 | tabWidth: 4 6 | useTabs: false 7 | 8 | # js and ts rules: 9 | arrowParens: avoid 10 | 11 | # jsx and tsx rules: 12 | jsxBracketSameLine: false 13 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/app/layouts/footer/footer.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'jhi-footer', 5 | templateUrl: './footer.component.html' 6 | }) 7 | export class FooterComponent {} 8 | -------------------------------------------------------------------------------- /Chapter01/worldgdp/target/classes/com/nilangpatel/worldgdp/controller/api/CityAPIController.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter01/worldgdp/target/classes/com/nilangpatel/worldgdp/controller/api/CityAPIController.class -------------------------------------------------------------------------------- /Chapter01/worldgdp/target/test-classes/com/nilangpatel/test/external/WorldBankApiClientTest.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter01/worldgdp/target/test-classes/com/nilangpatel/test/external/WorldBankApiClientTest.class -------------------------------------------------------------------------------- /Chapter02/simple-reactor-demo/target/classes/com/nilangpatel/reactor/ReactorCustomSubscriber.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter02/simple-reactor-demo/target/classes/com/nilangpatel/reactor/ReactorCustomSubscriber.class -------------------------------------------------------------------------------- /Chapter02/simple-reactor-demo/target/classes/com/nilangpatel/reactor/ReactorLifecycleMethods.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter02/simple-reactor-demo/target/classes/com/nilangpatel/reactor/ReactorLifecycleMethods.class -------------------------------------------------------------------------------- /Chapter02/simple-rx-java-demo/target/classes/com/nilangpatel/rxjava/RxJavaCustomObserverDemo.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter02/simple-rx-java-demo/target/classes/com/nilangpatel/rxjava/RxJavaCustomObserverDemo.class -------------------------------------------------------------------------------- /Chapter06/order-service/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.url=jdbc:mysql://localhost:3306/ob_orders 2 | spring.datasource.password=test 3 | spring.datasource.username=root 4 | 5 | spring.application.name=order-service 6 | server.port=8794 -------------------------------------------------------------------------------- /Chapter01/worldgdp/target/classes/com/nilangpatel/worldgdp/controller/api/CountryAPIController.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter01/worldgdp/target/classes/com/nilangpatel/worldgdp/controller/api/CountryAPIController.class -------------------------------------------------------------------------------- /Chapter01/worldgdp/target/classes/com/nilangpatel/worldgdp/dao/mapper/CountryLanguageRowMapper.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter01/worldgdp/target/classes/com/nilangpatel/worldgdp/dao/mapper/CountryLanguageRowMapper.class -------------------------------------------------------------------------------- /Chapter02/simple-reactor-demo/target/classes/com/nilangpatel/reactor/ReactorFromOtherPublisher.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter02/simple-reactor-demo/target/classes/com/nilangpatel/reactor/ReactorFromOtherPublisher.class -------------------------------------------------------------------------------- /Chapter02/simple-reactor-demo/target/classes/com/nilangpatel/reactor/ReactorWithSubscriberWays.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter02/simple-reactor-demo/target/classes/com/nilangpatel/reactor/ReactorWithSubscriberWays.class -------------------------------------------------------------------------------- /Chapter02/simple-rx-java-demo/target/classes/com/nilangpatel/rxjava/RxJavaCustomObserverDemo$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter02/simple-rx-java-demo/target/classes/com/nilangpatel/rxjava/RxJavaCustomObserverDemo$1.class -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/app/admin/audits/audit.model.ts: -------------------------------------------------------------------------------- 1 | import { AuditData } from './audit-data.model'; 2 | 3 | export class Audit { 4 | constructor(public data: AuditData, public principal: string, public timestamp: string, public type: string) {} 5 | } 6 | -------------------------------------------------------------------------------- /Chapter06/inventory-service/src/main/java/com/bookstore/inventory/repository/InventoryRepository.java: -------------------------------------------------------------------------------- 1 | package com.bookstore.inventory.repository; 2 | 3 | //@Repository 4 | public interface InventoryRepository {// extends JpaRepository { 5 | 6 | } 7 | -------------------------------------------------------------------------------- /Chapter03/blogpress/src/main/resources/static/js/blogpress.js: -------------------------------------------------------------------------------- 1 | 2 | function fireFormValidation(form){ 3 | if (form[0].checkValidity() === false) { 4 | event.preventDefault(); 5 | event.stopPropagation(); 6 | } 7 | form.addClass('was-validated'); 8 | } -------------------------------------------------------------------------------- /Chapter07/KotlinBasics/out/production/KotlinBasics/com/nilangpatel/kotlin/dataclasses/StudentVOJava.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter07/KotlinBasics/out/production/KotlinBasics/com/nilangpatel/kotlin/dataclasses/StudentVOJava.class -------------------------------------------------------------------------------- /Chapter07/KotlinBasics/out/production/KotlinBasics/com/nilangpatel/kotlin/function/lamda/Applicant.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter07/KotlinBasics/out/production/KotlinBasics/com/nilangpatel/kotlin/function/lamda/Applicant.class -------------------------------------------------------------------------------- /Chapter07/KotlinBasics/out/production/KotlinBasics/com/nilangpatel/kotlin/interoperability/JavaFile.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter07/KotlinBasics/out/production/KotlinBasics/com/nilangpatel/kotlin/interoperability/JavaFile.class -------------------------------------------------------------------------------- /Chapter07/KotlinBasics/out/production/KotlinBasics/com/nilangpatel/kotlin/nullcheck/NullCheckDemoKt.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter07/KotlinBasics/out/production/KotlinBasics/com/nilangpatel/kotlin/nullcheck/NullCheckDemoKt.class -------------------------------------------------------------------------------- /Chapter07/KotlinBasics/out/production/KotlinBasics/com/nilangpatel/kotlin/smartcast/CastExampleJava.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter07/KotlinBasics/out/production/KotlinBasics/com/nilangpatel/kotlin/smartcast/CastExampleJava.class -------------------------------------------------------------------------------- /Chapter07/taskmanagementsystem/src/main/resources/static/js/tms.js: -------------------------------------------------------------------------------- 1 | 2 | function fireFormValidation(form){ 3 | if (form[0].checkValidity() === false) { 4 | event.preventDefault(); 5 | event.stopPropagation(); 6 | } 7 | form.addClass('was-validated'); 8 | } -------------------------------------------------------------------------------- /Chapter01/worldgdp/target/classes/com/nilangpatel/worldgdp/controller/api/CountryLanguageAPIController.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter01/worldgdp/target/classes/com/nilangpatel/worldgdp/controller/api/CountryLanguageAPIController.class -------------------------------------------------------------------------------- /Chapter07/KotlinBasics/out/production/KotlinBasics/com/nilangpatel/kotlin/dataclasses/StudentVOKotlin.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter07/KotlinBasics/out/production/KotlinBasics/com/nilangpatel/kotlin/dataclasses/StudentVOKotlin.class -------------------------------------------------------------------------------- /Chapter07/KotlinBasics/out/production/KotlinBasics/com/nilangpatel/kotlin/function/lamda/LamdaDemo1Kt.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter07/KotlinBasics/out/production/KotlinBasics/com/nilangpatel/kotlin/function/lamda/LamdaDemo1Kt.class -------------------------------------------------------------------------------- /Chapter07/KotlinBasics/out/production/KotlinBasics/com/nilangpatel/kotlin/function/lamda/LamdaDemo2Kt.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter07/KotlinBasics/out/production/KotlinBasics/com/nilangpatel/kotlin/function/lamda/LamdaDemo2Kt.class -------------------------------------------------------------------------------- /Chapter01/worldgdp/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | Archetype Created Web Application 7 | 8 | -------------------------------------------------------------------------------- /Chapter01/worldgdp/target/test-classes/com/nilangpatel/test/config/controller/api/CityAPIControllerTest.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter01/worldgdp/target/test-classes/com/nilangpatel/test/config/controller/api/CityAPIControllerTest.class -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/java/com/nilangpatel/web/rest/errors/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Specific errors used with Zalando's "problem-spring-web" library. 3 | * 4 | * More information on https://github.com/zalando/problem-spring-web 5 | */ 6 | package com.nilangpatel.web.rest.errors; 7 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/jib/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo "The application will start in ${JHIPSTER_SLEEP}s..." && sleep ${JHIPSTER_SLEEP} 4 | exec java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -cp /app/resources/:/app/classes/:/app/libs/* "com.nilangpatel.GdpApp" "$@" 5 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/app/admin/docs/docs.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'jhi-docs', 5 | templateUrl: './docs.component.html' 6 | }) 7 | export class JhiDocsComponent { 8 | constructor() {} 9 | } 10 | -------------------------------------------------------------------------------- /Chapter06/eureka-discovery-service/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | # Configure this Discovery Server 2 | eureka.client.registerWithEureka = false 3 | eureka.client.fetch-registry=false 4 | 5 | #In case if Eureka port need to be changed from default 8080 6 | server.port = 8761 7 | -------------------------------------------------------------------------------- /Chapter07/KotlinBasics/out/production/KotlinBasics/com/nilangpatel/kotlin/dataclasses/DataClassesDemoKt.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter07/KotlinBasics/out/production/KotlinBasics/com/nilangpatel/kotlin/dataclasses/DataClassesDemoKt.class -------------------------------------------------------------------------------- /Chapter07/KotlinBasics/out/production/KotlinBasics/com/nilangpatel/kotlin/function/returnfromotherfun/Dog.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter07/KotlinBasics/out/production/KotlinBasics/com/nilangpatel/kotlin/function/returnfromotherfun/Dog.class -------------------------------------------------------------------------------- /Chapter07/KotlinBasics/out/production/KotlinBasics/com/nilangpatel/kotlin/function/returnfromotherfun/Fox.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter07/KotlinBasics/out/production/KotlinBasics/com/nilangpatel/kotlin/function/returnfromotherfun/Fox.class -------------------------------------------------------------------------------- /Chapter07/KotlinBasics/out/production/KotlinBasics/com/nilangpatel/kotlin/interoperability/KotlinFileKt.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter07/KotlinBasics/out/production/KotlinBasics/com/nilangpatel/kotlin/interoperability/KotlinFileKt.class -------------------------------------------------------------------------------- /Chapter07/KotlinBasics/out/production/KotlinBasics/com/nilangpatel/kotlin/smartcast/CastExampleKotlinKt.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter07/KotlinBasics/out/production/KotlinBasics/com/nilangpatel/kotlin/smartcast/CastExampleKotlinKt.class -------------------------------------------------------------------------------- /Chapter01/worldgdp/target/test-classes/com/nilangpatel/test/config/controller/api/CountryAPIControllerTest.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter01/worldgdp/target/test-classes/com/nilangpatel/test/config/controller/api/CountryAPIControllerTest.class -------------------------------------------------------------------------------- /Chapter04/SpringAuthResource/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | custom.auth.authorization-uri=http://localhost:8081/oauth/authorize 2 | custom.auth.client-id=c1 3 | custom.auth.client-secret=123 4 | custom.auth.grant-type=implicit 5 | custom.auth.response-type=token 6 | 7 | server.port=8082 -------------------------------------------------------------------------------- /Chapter07/KotlinBasics/out/production/KotlinBasics/com/nilangpatel/kotlin/function/defaultarg/CubeVolumeKt.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter07/KotlinBasics/out/production/KotlinBasics/com/nilangpatel/kotlin/function/defaultarg/CubeVolumeKt.class -------------------------------------------------------------------------------- /Chapter07/KotlinBasics/out/production/KotlinBasics/com/nilangpatel/kotlin/function/extension/FunExtensionKt.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter07/KotlinBasics/out/production/KotlinBasics/com/nilangpatel/kotlin/function/extension/FunExtensionKt.class -------------------------------------------------------------------------------- /Chapter07/KotlinBasics/out/production/KotlinBasics/com/nilangpatel/kotlin/function/returnfromotherfun/Lion.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter07/KotlinBasics/out/production/KotlinBasics/com/nilangpatel/kotlin/function/returnfromotherfun/Lion.class -------------------------------------------------------------------------------- /Chapter07/KotlinBasics/out/production/KotlinBasics/com/nilangpatel/kotlin/operatoroverload/CoordinatePoint.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter07/KotlinBasics/out/production/KotlinBasics/com/nilangpatel/kotlin/operatoroverload/CoordinatePoint.class -------------------------------------------------------------------------------- /Chapter02/SpringWebFluxDemo/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | #spring.data.mongodb.uri=mongodb://localhost:27017/StudentData 2 | spring.data.mongodb.host=localhost 3 | spring.data.mongodb.port=27017 4 | spring.data.mongodb.database=StudentData 5 | spring.main.web-application-type=reactive 6 | -------------------------------------------------------------------------------- /Chapter02/simple-reactor-demo/target/classes/com/nilangpatel/reactor/ReactorCustomSubscriber$CustomSubscriber.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter02/simple-reactor-demo/target/classes/com/nilangpatel/reactor/ReactorCustomSubscriber$CustomSubscriber.class -------------------------------------------------------------------------------- /Chapter07/KotlinBasics/out/production/KotlinBasics/com/nilangpatel/kotlin/function/lamda/LamdaDemo1Kt$main$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter07/KotlinBasics/out/production/KotlinBasics/com/nilangpatel/kotlin/function/lamda/LamdaDemo1Kt$main$1.class -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/app/entities/city/index.ts: -------------------------------------------------------------------------------- 1 | export * from './city.service'; 2 | export * from './city-update.component'; 3 | export * from './city-delete-dialog.component'; 4 | export * from './city-detail.component'; 5 | export * from './city.component'; 6 | export * from './city.route'; 7 | -------------------------------------------------------------------------------- /Chapter07/KotlinBasics/out/production/KotlinBasics/com/nilangpatel/kotlin/function/returnfromotherfun/WildAnimal.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter07/KotlinBasics/out/production/KotlinBasics/com/nilangpatel/kotlin/function/returnfromotherfun/WildAnimal.class -------------------------------------------------------------------------------- /Chapter07/KotlinBasics/src/com/nilangpatel/kotlin/dataclasses/StudentVOKotlin.kt: -------------------------------------------------------------------------------- 1 | package com.nilangpatel.kotlin.dataclasses 2 | 3 | data class StudentVOKotlin(var name: String, 4 | var age: Int, 5 | var standard: Int, 6 | var gender: String) -------------------------------------------------------------------------------- /Chapter01/worldgdp/target/test-classes/com/nilangpatel/test/config/controller/api/CountryLanguageAPIControllerTest.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter01/worldgdp/target/test-classes/com/nilangpatel/test/config/controller/api/CountryLanguageAPIControllerTest.class -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/app/layouts/navbar/navbar.route.ts: -------------------------------------------------------------------------------- 1 | import { Route } from '@angular/router'; 2 | 3 | import { NavbarComponent } from './navbar.component'; 4 | 5 | export const navbarRoute: Route = { 6 | path: '', 7 | component: NavbarComponent, 8 | outlet: 'navbar' 9 | }; 10 | -------------------------------------------------------------------------------- /Chapter07/KotlinBasics/out/production/KotlinBasics/com/nilangpatel/kotlin/function/expression/Function_expressionKt.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter07/KotlinBasics/out/production/KotlinBasics/com/nilangpatel/kotlin/function/expression/Function_expressionKt.class -------------------------------------------------------------------------------- /Chapter07/KotlinBasics/out/production/KotlinBasics/com/nilangpatel/kotlin/interoperability/CheckInterOperabilityKt.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter07/KotlinBasics/out/production/KotlinBasics/com/nilangpatel/kotlin/interoperability/CheckInterOperabilityKt.class -------------------------------------------------------------------------------- /Chapter07/KotlinBasics/out/production/KotlinBasics/com/nilangpatel/kotlin/operatoroverload/OperatorOverloadDemoKt.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter07/KotlinBasics/out/production/KotlinBasics/com/nilangpatel/kotlin/operatoroverload/OperatorOverloadDemoKt.class -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/i18n/en/configuration.json: -------------------------------------------------------------------------------- 1 | { 2 | "configuration": { 3 | "title": "Configuration", 4 | "filter": "Filter (by prefix)", 5 | "table": { 6 | "prefix": "Prefix", 7 | "properties": "Properties" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Chapter07/KotlinBasics/out/production/KotlinBasics/com/nilangpatel/kotlin/function/lamda/LamdaDemo1Kt$main$addition$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter07/KotlinBasics/out/production/KotlinBasics/com/nilangpatel/kotlin/function/lamda/LamdaDemo1Kt$main$addition$1.class -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/i18n/en/logs.json: -------------------------------------------------------------------------------- 1 | { 2 | "logs": { 3 | "title": "Logs", 4 | "nbloggers": "There are {{ total }} loggers.", 5 | "filter": "Filter", 6 | "table": { 7 | "name": "Name", 8 | "level": "Level" 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Chapter07/KotlinBasics/out/production/KotlinBasics/com/nilangpatel/kotlin/function/lamda/LamdaDemo1Kt$main$addition2$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter07/KotlinBasics/out/production/KotlinBasics/com/nilangpatel/kotlin/function/lamda/LamdaDemo1Kt$main$addition2$1.class -------------------------------------------------------------------------------- /Chapter07/KotlinBasics/out/production/KotlinBasics/com/nilangpatel/kotlin/function/lamda/LamdaDemo1Kt$main$greetingMsg$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter07/KotlinBasics/out/production/KotlinBasics/com/nilangpatel/kotlin/function/lamda/LamdaDemo1Kt$main$greetingMsg$1.class -------------------------------------------------------------------------------- /Chapter07/KotlinBasics/out/production/KotlinBasics/com/nilangpatel/kotlin/function/lamda/LamdaDemo1Kt$main$showWarning$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter07/KotlinBasics/out/production/KotlinBasics/com/nilangpatel/kotlin/function/lamda/LamdaDemo1Kt$main$showWarning$1.class -------------------------------------------------------------------------------- /Chapter07/KotlinBasics/out/production/KotlinBasics/com/nilangpatel/kotlin/function/lamda/LamdaDemo2Kt$main$isEligible$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter07/KotlinBasics/out/production/KotlinBasics/com/nilangpatel/kotlin/function/lamda/LamdaDemo2Kt$main$isEligible$1.class -------------------------------------------------------------------------------- /Chapter07/KotlinBasics/out/production/KotlinBasics/com/nilangpatel/kotlin/function/lamda/LamdaDemo2Kt$main$isEligible2$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter07/KotlinBasics/out/production/KotlinBasics/com/nilangpatel/kotlin/function/lamda/LamdaDemo2Kt$main$isEligible2$1.class -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/app/entities/country/index.ts: -------------------------------------------------------------------------------- 1 | export * from './country.service'; 2 | export * from './country-update.component'; 3 | export * from './country-delete-dialog.component'; 4 | export * from './country-detail.component'; 5 | export * from './country.component'; 6 | export * from './country.route'; 7 | -------------------------------------------------------------------------------- /Chapter07/KotlinBasics/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Chapter07/KotlinBasics/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Chapter01/worldgdp/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst: -------------------------------------------------------------------------------- 1 | com\nilangpatel\test\config\controller\api\CountryAPIControllerTest.class 2 | com\nilangpatel\test\external\WorldBankApiClientTest.class 3 | com\nilangpatel\test\config\controller\api\CountryLanguageAPIControllerTest.class 4 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/robots.txt: -------------------------------------------------------------------------------- 1 | # robotstxt.org/ 2 | 3 | User-agent: * 4 | Disallow: /api/account 5 | Disallow: /api/account/change-password 6 | Disallow: /api/account/sessions 7 | Disallow: /api/audits/ 8 | Disallow: /api/logs/ 9 | Disallow: /api/users/ 10 | Disallow: /management/ 11 | Disallow: /v2/api-docs/ 12 | -------------------------------------------------------------------------------- /Chapter06/user-service/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.url=jdbc:mysql://localhost:3306/ob_users 2 | spring.datasource.password=test 3 | spring.datasource.username=root 4 | 5 | spring.application.name=user-service 6 | server.port=8791 7 | 8 | eureka.client.service-url.default-zone=http://localhost:8761/eureka -------------------------------------------------------------------------------- /Chapter07/KotlinBasics/out/production/KotlinBasics/com/nilangpatel/kotlin/function/returnfromotherfun/ReturnFromOtherFunDemoKt.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter07/KotlinBasics/out/production/KotlinBasics/com/nilangpatel/kotlin/function/returnfromotherfun/ReturnFromOtherFunDemoKt.class -------------------------------------------------------------------------------- /Chapter03/blogpress/src/main/resources/static/css/blogpress.css: -------------------------------------------------------------------------------- 1 | .blogpress-section{ 2 | margin: 1.5rem; 3 | padding: 1.5rem; 4 | margin-right: 0; 5 | margin-left: 0; 6 | border-width: .2rem; 7 | position: relative; 8 | border: solid #f8f9fa; 9 | } 10 | 11 | .comment-reply{ 12 | margin: 1.5rem; 13 | } -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/app/admin/logs/logs.route.ts: -------------------------------------------------------------------------------- 1 | import { Route } from '@angular/router'; 2 | 3 | import { LogsComponent } from './logs.component'; 4 | 5 | export const logsRoute: Route = { 6 | path: 'logs', 7 | component: LogsComponent, 8 | data: { 9 | pageTitle: 'logs.title' 10 | } 11 | }; 12 | -------------------------------------------------------------------------------- /Chapter06/ReadMe.txt: -------------------------------------------------------------------------------- 1 | book-service, catalog-service, inventory-service, user-service contains respective module code 2 | Zuul-api-gateway contain API Gateway code 3 | eureka-discovery-service contains Eureka server code 4 | Spring-cloud-config-sever contain code for Spring Cloud Configuration. 5 | Other modules are required for authentication. -------------------------------------------------------------------------------- /Chapter01/worldgdp/.settings/org.eclipse.wst.common.project.facet.core.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Chapter04/SpringAuthResource/src/main/resources/static/css/blogpress.css: -------------------------------------------------------------------------------- 1 | .blogpress-section{ 2 | margin: 1.5rem; 3 | padding: 1.5rem; 4 | margin-right: 0; 5 | margin-left: 0; 6 | border-width: .2rem; 7 | position: relative; 8 | border: solid #f8f9fa; 9 | } 10 | 11 | .comment-reply{ 12 | margin: 1.5rem; 13 | } -------------------------------------------------------------------------------- /Chapter04/SpringLdapAndOAuth/src/main/resources/static/css/blogpress.css: -------------------------------------------------------------------------------- 1 | .blogpress-section{ 2 | margin: 1.5rem; 3 | padding: 1.5rem; 4 | margin-right: 0; 5 | margin-left: 0; 6 | border-width: .2rem; 7 | position: relative; 8 | border: solid #f8f9fa; 9 | } 10 | 11 | .comment-reply{ 12 | margin: 1.5rem; 13 | } -------------------------------------------------------------------------------- /Chapter04/SpringOnlyLDAP/src/main/resources/static/css/blogpress.css: -------------------------------------------------------------------------------- 1 | .blogpress-section{ 2 | margin: 1.5rem; 3 | padding: 1.5rem; 4 | margin-right: 0; 5 | margin-left: 0; 6 | border-width: .2rem; 7 | position: relative; 8 | border: solid #f8f9fa; 9 | } 10 | 11 | .comment-reply{ 12 | margin: 1.5rem; 13 | } -------------------------------------------------------------------------------- /Chapter04/SpringOnlyOAuth/src/main/resources/static/css/blogpress.css: -------------------------------------------------------------------------------- 1 | .blogpress-section{ 2 | margin: 1.5rem; 3 | padding: 1.5rem; 4 | margin-right: 0; 5 | margin-left: 0; 6 | border-width: .2rem; 7 | position: relative; 8 | border: solid #f8f9fa; 9 | } 10 | 11 | .comment-reply{ 12 | margin: 1.5rem; 13 | } -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/docker/.dockerignore: -------------------------------------------------------------------------------- 1 | # https://docs.docker.com/engine/reference/builder/#dockerignore-file 2 | classes/ 3 | generated-sources/ 4 | generated-test-sources/ 5 | h2db/ 6 | maven-archiver/ 7 | maven-status/ 8 | reports/ 9 | surefire-reports/ 10 | test-classes/ 11 | test-results/ 12 | www/ 13 | !*.jar 14 | !*.war 15 | -------------------------------------------------------------------------------- /Chapter06/user-service/src/main/java/com/bookstore/user/repository/CustomUserRepository.java: -------------------------------------------------------------------------------- 1 | package com.bookstore.user.repository; 2 | 3 | import com.bookstore.user.model.User; 4 | 5 | public interface CustomUserRepository { 6 | 7 | User findByUserName(String userName); 8 | 9 | User findByEmail(String email); 10 | 11 | } 12 | -------------------------------------------------------------------------------- /Chapter07/taskmanagementsystem/src/main/kotlin/com/nilangpatel/tms/dto/UserRegistrationDTO.kt: -------------------------------------------------------------------------------- 1 | package com.nilangpatel.tms.dto 2 | 3 | data class UserRegistrationDTO(var username:String, var password:String, 4 | var firstname:String, var lastname:String, 5 | var roleList:List) -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/app/home/home.route.ts: -------------------------------------------------------------------------------- 1 | import { Route } from '@angular/router'; 2 | 3 | import { HomeComponent } from './'; 4 | 5 | export const HOME_ROUTE: Route = { 6 | path: '', 7 | component: HomeComponent, 8 | data: { 9 | authorities: [], 10 | pageTitle: 'home.title' 11 | } 12 | }; 13 | -------------------------------------------------------------------------------- /Chapter06/book-service/src/main/java/com/bookstore/book/repository/BookRepository.java: -------------------------------------------------------------------------------- 1 | package com.bookstore.book.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | 5 | import com.bookstore.book.model.Book; 6 | 7 | public interface BookRepository extends JpaRepository { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /Chapter04/SpringCustomAuthorization/src/main/resources/static/css/blogpress.css: -------------------------------------------------------------------------------- 1 | .blogpress-section{ 2 | margin: 1.5rem; 3 | padding: 1.5rem; 4 | margin-right: 0; 5 | margin-left: 0; 6 | border-width: .2rem; 7 | position: relative; 8 | border: solid #f8f9fa; 9 | } 10 | 11 | .comment-reply{ 12 | margin: 1.5rem; 13 | } -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/app/admin/docs/docs.route.ts: -------------------------------------------------------------------------------- 1 | import { Route } from '@angular/router'; 2 | 3 | import { JhiDocsComponent } from './docs.component'; 4 | 5 | export const docsRoute: Route = { 6 | path: 'docs', 7 | component: JhiDocsComponent, 8 | data: { 9 | pageTitle: 'global.menu.admin.apidocs' 10 | } 11 | }; 12 | -------------------------------------------------------------------------------- /Chapter06/order-service/src/main/java/com/bookstore/order/repository/OrderRepository.java: -------------------------------------------------------------------------------- 1 | package com.bookstore.order.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | 5 | import com.bookstore.order.model.Order; 6 | 7 | public interface OrderRepository {// extends JpaRepository { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /Chapter06/book-service/src/main/java/com/bookstore/book/repository/CategoryRepository.java: -------------------------------------------------------------------------------- 1 | package com.bookstore.book.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | 5 | import com.bookstore.book.model.Category; 6 | 7 | public interface CategoryRepository extends JpaRepository { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /Chapter06/book-service/src/main/java/com/bookstore/book/repository/PublisherRepository.java: -------------------------------------------------------------------------------- 1 | package com.bookstore.book.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | 5 | import com.bookstore.book.model.Publisher; 6 | 7 | public interface PublisherRepository extends JpaRepository { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /Chapter06/bookstore-authorization-server/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.application.name=bookstore-auth-server 2 | server.port=9999 3 | 4 | spring.datasource.url=jdbc:mysql://localhost:3306/ob_users 5 | spring.datasource.password=test 6 | spring.datasource.username=root 7 | 8 | eureka.client.service-url.default-zone=http://localhost:8761/eureka -------------------------------------------------------------------------------- /Chapter07/KotlinBasics/src/com/nilangpatel/kotlin/smartcast/CastExampleKotlin.kt: -------------------------------------------------------------------------------- 1 | package com.nilangpatel.kotlin.smartcast 2 | 3 | fun main(args: Array) { 4 | val name: Any = "Nilang" 5 | if(name is String) { 6 | greetingMsg(name) 7 | } 8 | } 9 | 10 | private fun greetingMsg(name: String) { 11 | print(" Welcome $name ..!!") 12 | } -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/app/admin/health/health.route.ts: -------------------------------------------------------------------------------- 1 | import { Route } from '@angular/router'; 2 | 3 | import { JhiHealthCheckComponent } from './health.component'; 4 | 5 | export const healthRoute: Route = { 6 | path: 'jhi-health', 7 | component: JhiHealthCheckComponent, 8 | data: { 9 | pageTitle: 'health.title' 10 | } 11 | }; 12 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/app/blocks/config/prod.config.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { DEBUG_INFO_ENABLED } from 'app/app.constants'; 3 | 4 | export function ProdConfig() { 5 | // disable debug data on prod profile to improve performance 6 | if (!DEBUG_INFO_ENABLED) { 7 | enableProdMode(); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Chapter07/KotlinBasics/out/production/KotlinBasics/com/nilangpatel/kotlin/function/returnfromotherfun/ReturnFromOtherFunDemoKt$getAnimalVoiceFun$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter07/KotlinBasics/out/production/KotlinBasics/com/nilangpatel/kotlin/function/returnfromotherfun/ReturnFromOtherFunDemoKt$getAnimalVoiceFun$1.class -------------------------------------------------------------------------------- /Chapter01/worldgdp/target/surefire-reports/com.nilangpatel.test.dao.CityDAOTest.txt: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------- 2 | Test set: com.nilangpatel.test.dao.CityDAOTest 3 | ------------------------------------------------------------------------------- 4 | Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.641 sec 5 | -------------------------------------------------------------------------------- /Chapter07/KotlinBasics/out/production/KotlinBasics/com/nilangpatel/kotlin/function/returnfromotherfun/ReturnFromOtherFunDemoKt$main$getAnimalVoice$1$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter07/KotlinBasics/out/production/KotlinBasics/com/nilangpatel/kotlin/function/returnfromotherfun/ReturnFromOtherFunDemoKt$main$getAnimalVoice$1$1.class -------------------------------------------------------------------------------- /Chapter07/KotlinBasics/out/production/KotlinBasics/com/nilangpatel/kotlin/function/returnfromotherfun/ReturnFromOtherFunDemoKt$main$getAnimalVoice$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Spring-5.0-Projects/HEAD/Chapter07/KotlinBasics/out/production/KotlinBasics/com/nilangpatel/kotlin/function/returnfromotherfun/ReturnFromOtherFunDemoKt$main$getAnimalVoice$1.class -------------------------------------------------------------------------------- /Chapter01/worldgdp/target/m2e-wtp/web-resources/META-INF/maven/com.nilangpatel.worldgdp/worldgdp/pom.properties: -------------------------------------------------------------------------------- 1 | #Generated by Maven Integration for Eclipse 2 | #Wed Mar 20 21:58:37 IST 2019 3 | version=1.0 4 | groupId=com.nilangpatel.worldgdp 5 | m2e.projectName=worldgdp 6 | m2e.projectLocation=D\:\\projects\\book_writing\\Spring 5\\ch--1\\testcode\\worldgdp 7 | artifactId=worldgdp 8 | -------------------------------------------------------------------------------- /Chapter01/worldgdp/target/surefire-reports/com.nilangpatel.test.dao.CountryDAOTest.txt: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------- 2 | Test set: com.nilangpatel.test.dao.CountryDAOTest 3 | ------------------------------------------------------------------------------- 4 | Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.621 sec 5 | -------------------------------------------------------------------------------- /Chapter01/worldgdp/target/surefire-reports/com.nilangpatel.test.dao.LookupDAOTest.txt: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------- 2 | Test set: com.nilangpatel.test.dao.LookupDAOTest 3 | ------------------------------------------------------------------------------- 4 | Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.369 sec 5 | -------------------------------------------------------------------------------- /Chapter04/ReadMe.txt: -------------------------------------------------------------------------------- 1 | SpringOnlyAuth - contain code for doing authentication with OAuth only 2 | SpringOnlyLDAP - contain code for doing authentication with LDAP only 3 | SpringLdapAndOAth - contain code for dual authentication with LDAP and OAuth both. 4 | SpringCustomAuthorization - contains code for Custom Authorization server 5 | SpringAuthResource - contains code for Resource Server. -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/app/entities/country-language/index.ts: -------------------------------------------------------------------------------- 1 | export * from './country-language.service'; 2 | export * from './country-language-update.component'; 3 | export * from './country-language-delete-dialog.component'; 4 | export * from './country-language-detail.component'; 5 | export * from './country-language.component'; 6 | export * from './country-language.route'; 7 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/app/shared/constants/error.constants.ts: -------------------------------------------------------------------------------- 1 | export const PROBLEM_BASE_URL = 'https://www.jhipster.tech/problem'; 2 | export const EMAIL_ALREADY_USED_TYPE = PROBLEM_BASE_URL + '/email-already-used'; 3 | export const LOGIN_ALREADY_USED_TYPE = PROBLEM_BASE_URL + '/login-already-used'; 4 | export const EMAIL_NOT_FOUND_TYPE = PROBLEM_BASE_URL + '/email-not-found'; 5 | -------------------------------------------------------------------------------- /Chapter07/taskmanagementsystem/src/main/kotlin/com/nilangpatel/tms/dto/TaskDTO.kt: -------------------------------------------------------------------------------- 1 | package com.nilangpatel.tms.dto 2 | 3 | import com.nilangpatel.tms.model.Comments 4 | 5 | class TaskDTO( var id :Int?, var title : String?, 6 | var detail : String?, var assignedTo : Int?, var assignedPerson:String?, 7 | var status : String?, var comments : Set?) 8 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/app/admin/metrics/metrics.route.ts: -------------------------------------------------------------------------------- 1 | import { Route } from '@angular/router'; 2 | 3 | import { JhiMetricsMonitoringComponent } from './metrics.component'; 4 | 5 | export const metricsRoute: Route = { 6 | path: 'jhi-metrics', 7 | component: JhiMetricsMonitoringComponent, 8 | data: { 9 | pageTitle: 'metrics.title' 10 | } 11 | }; 12 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/i18n/en/activate.json: -------------------------------------------------------------------------------- 1 | { 2 | "activate": { 3 | "title": "Activation", 4 | "messages": { 5 | "success": "Your user account has been activated. Please ", 6 | "error": "Your user could not be activated. Please use the registration form to sign up." 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Chapter01/worldgdp/target/surefire-reports/com.nilangpatel.test.config.DBConfigurationTest.txt: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------- 2 | Test set: com.nilangpatel.test.config.DBConfigurationTest 3 | ------------------------------------------------------------------------------- 4 | Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.188 sec 5 | -------------------------------------------------------------------------------- /Chapter01/worldgdp/target/surefire-reports/com.nilangpatel.test.dao.CountryLanguageDAOTest.txt: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------- 2 | Test set: com.nilangpatel.test.dao.CountryLanguageDAOTest 3 | ------------------------------------------------------------------------------- 4 | Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.587 sec 5 | -------------------------------------------------------------------------------- /Chapter02/simple-rx-java-demo/target/classes/META-INF/maven/rx-java/simple-rx-java-demo/pom.properties: -------------------------------------------------------------------------------- 1 | #Generated by Maven Integration for Eclipse 2 | #Fri Feb 22 00:00:53 IST 2019 3 | version=0.0.1-SNAPSHOT 4 | groupId=rx-java 5 | m2e.projectName=simple-rx-java-demo 6 | m2e.projectLocation=D\:\\projects\\book_writing\\Spring 5\\ch-0\\code\\simple-rx-java-demo 7 | artifactId=simple-rx-java-demo 8 | -------------------------------------------------------------------------------- /Chapter07/KotlinBasics/src/com/nilangpatel/kotlin/interoperability/KotlinFile.kt: -------------------------------------------------------------------------------- 1 | package com.nilangpatel.kotlin.interoperability 2 | 3 | fun main(args: Array) { 4 | var total = JavaFile.add(5,6) 5 | print("Value from Java is $total") 6 | } 7 | 8 | fun multiply(a:Int, b:Int):Int{ 9 | print("Calling multiply function From Kotlin....") 10 | return a * b 11 | } 12 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/app/account/activate/activate.route.ts: -------------------------------------------------------------------------------- 1 | import { Route } from '@angular/router'; 2 | 3 | import { ActivateComponent } from './activate.component'; 4 | 5 | export const activateRoute: Route = { 6 | path: 'activate', 7 | component: ActivateComponent, 8 | data: { 9 | authorities: [], 10 | pageTitle: 'activate.title' 11 | } 12 | }; 13 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/app/account/register/register.route.ts: -------------------------------------------------------------------------------- 1 | import { Route } from '@angular/router'; 2 | 3 | import { RegisterComponent } from './register.component'; 4 | 5 | export const registerRoute: Route = { 6 | path: 'register', 7 | component: RegisterComponent, 8 | data: { 9 | authorities: [], 10 | pageTitle: 'register.title' 11 | } 12 | }; 13 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/test/javascript/spec/helpers/mock-alert.service.ts: -------------------------------------------------------------------------------- 1 | import { SpyObject } from './spyobject'; 2 | import { JhiAlertService, JhiAlert } from 'ng-jhipster'; 3 | 4 | export class MockAlertService extends SpyObject { 5 | constructor() { 6 | super(JhiAlertService); 7 | } 8 | addAlert(alertOptions: JhiAlert) { 9 | return alertOptions; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Chapter01/worldgdp/target/surefire-reports/com.nilangpatel.test.external.WorldBankApiClientTest.txt: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------- 2 | Test set: com.nilangpatel.test.external.WorldBankApiClientTest 3 | ------------------------------------------------------------------------------- 4 | Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.608 sec 5 | -------------------------------------------------------------------------------- /Chapter02/simple-reactor-demo/target/classes/META-INF/maven/reactor-demo/simple-reactor-demo/pom.properties: -------------------------------------------------------------------------------- 1 | #Generated by Maven Integration for Eclipse 2 | #Tue Feb 26 22:09:12 IST 2019 3 | version=0.0.1-SNAPSHOT 4 | groupId=reactor-demo 5 | m2e.projectName=simple-reactor-demo 6 | m2e.projectLocation=D\:\\projects\\book_writing\\Spring 5\\ch-0\\code\\simple-reactor-demo 7 | artifactId=simple-reactor-demo 8 | -------------------------------------------------------------------------------- /Chapter04/SpringOnlyOAuth/src/main/java/com/nilangpatel/springoauth/constants/OAuthConstant.java: -------------------------------------------------------------------------------- 1 | package com.nilangpatel.springoauth.constants; 2 | 3 | public interface OAuthConstant { 4 | 5 | /* Page title constants */ 6 | String PAGE_TITLE = "pageTitle"; 7 | 8 | String TITLE_HOME_PAGE = "Home"; 9 | String TITLE_PRIVATE_PAGE = "Private"; 10 | String TITLE_LOGIN_PAGE = "Login"; 11 | } 12 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/app/core/auth/csrf.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { CookieService } from 'ngx-cookie'; 3 | 4 | @Injectable({ providedIn: 'root' }) 5 | export class CSRFService { 6 | constructor(private cookieService: CookieService) {} 7 | 8 | getCSRF(name = 'XSRF-TOKEN') { 9 | return this.cookieService.get(name); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Chapter07/KotlinBasics/src/com/nilangpatel/kotlin/dataclasses/DataClassesDemo.kt: -------------------------------------------------------------------------------- 1 | package com.nilangpatel.kotlin.dataclasses 2 | 3 | fun main(args: Array) { 4 | var student = StudentVOKotlin("Nilang",10,5,"M") 5 | println("Student is $student")// This will call toString() 6 | //This will call getter of respective properties 7 | println("age of ${student.name} is ${student.age}") 8 | } -------------------------------------------------------------------------------- /Chapter07/KotlinBasics/src/com/nilangpatel/kotlin/interoperability/JavaFile.java: -------------------------------------------------------------------------------- 1 | package com.nilangpatel.kotlin.interoperability; 2 | 3 | public class JavaFile { 4 | 5 | public static void main(String args[]){ 6 | 7 | System.out.print(KotlinFileKt.multiply(3,4)); 8 | } 9 | 10 | public static int add(int num1, int num2){ 11 | return num1+num2; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Chapter07/taskmanagementsystem/src/main/resources/templates/home.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |
6 |
7 |
This is home page accessible without login also... !!
8 |
9 | 10 | -------------------------------------------------------------------------------- /Chapter03/blogpress/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | 4 | ### STS ### 5 | .apt_generated 6 | .classpath 7 | .factorypath 8 | .project 9 | .settings 10 | .springBeans 11 | .sts4-cache 12 | 13 | ### IntelliJ IDEA ### 14 | .idea 15 | *.iws 16 | *.iml 17 | *.ipr 18 | 19 | ### NetBeans ### 20 | /nbproject/private/ 21 | /build/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/java/com/nilangpatel/repository/AuthorityRepository.java: -------------------------------------------------------------------------------- 1 | package com.nilangpatel.repository; 2 | 3 | import com.nilangpatel.domain.Authority; 4 | 5 | import org.springframework.data.jpa.repository.JpaRepository; 6 | 7 | /** 8 | * Spring Data JPA repository for the Authority entity. 9 | */ 10 | public interface AuthorityRepository extends JpaRepository { 11 | } 12 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/app/layouts/main/main.component.html: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 |
5 |
6 |
7 | 8 | 9 |
10 | 11 |
12 | -------------------------------------------------------------------------------- /Chapter06/book-service/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | 4 | ### STS ### 5 | .apt_generated 6 | .classpath 7 | .factorypath 8 | .project 9 | .settings 10 | .springBeans 11 | .sts4-cache 12 | 13 | ### IntelliJ IDEA ### 14 | .idea 15 | *.iws 16 | *.iml 17 | *.ipr 18 | 19 | ### NetBeans ### 20 | /nbproject/private/ 21 | /build/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ -------------------------------------------------------------------------------- /Chapter06/order-service/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | 4 | ### STS ### 5 | .apt_generated 6 | .classpath 7 | .factorypath 8 | .project 9 | .settings 10 | .springBeans 11 | .sts4-cache 12 | 13 | ### IntelliJ IDEA ### 14 | .idea 15 | *.iws 16 | *.iml 17 | *.ipr 18 | 19 | ### NetBeans ### 20 | /nbproject/private/ 21 | /build/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ -------------------------------------------------------------------------------- /Chapter06/user-service/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | 4 | ### STS ### 5 | .apt_generated 6 | .classpath 7 | .factorypath 8 | .project 9 | .settings 10 | .springBeans 11 | .sts4-cache 12 | 13 | ### IntelliJ IDEA ### 14 | .idea 15 | *.iws 16 | *.iml 17 | *.ipr 18 | 19 | ### NetBeans ### 20 | /nbproject/private/ 21 | /build/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ -------------------------------------------------------------------------------- /Chapter04/SpringAuthResource/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | 4 | ### STS ### 5 | .apt_generated 6 | .classpath 7 | .factorypath 8 | .project 9 | .settings 10 | .springBeans 11 | .sts4-cache 12 | 13 | ### IntelliJ IDEA ### 14 | .idea 15 | *.iws 16 | *.iml 17 | *.ipr 18 | 19 | ### NetBeans ### 20 | /nbproject/private/ 21 | /build/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ -------------------------------------------------------------------------------- /Chapter04/SpringLdapAndOAuth/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | 4 | ### STS ### 5 | .apt_generated 6 | .classpath 7 | .factorypath 8 | .project 9 | .settings 10 | .springBeans 11 | .sts4-cache 12 | 13 | ### IntelliJ IDEA ### 14 | .idea 15 | *.iws 16 | *.iml 17 | *.ipr 18 | 19 | ### NetBeans ### 20 | /nbproject/private/ 21 | /build/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ -------------------------------------------------------------------------------- /Chapter04/SpringOnlyLDAP/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | 4 | ### STS ### 5 | .apt_generated 6 | .classpath 7 | .factorypath 8 | .project 9 | .settings 10 | .springBeans 11 | .sts4-cache 12 | 13 | ### IntelliJ IDEA ### 14 | .idea 15 | *.iws 16 | *.iml 17 | *.ipr 18 | 19 | ### NetBeans ### 20 | /nbproject/private/ 21 | /build/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ -------------------------------------------------------------------------------- /Chapter04/SpringOnlyOAuth/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | 4 | ### STS ### 5 | .apt_generated 6 | .classpath 7 | .factorypath 8 | .project 9 | .settings 10 | .springBeans 11 | .sts4-cache 12 | 13 | ### IntelliJ IDEA ### 14 | .idea 15 | *.iws 16 | *.iml 17 | *.ipr 18 | 19 | ### NetBeans ### 20 | /nbproject/private/ 21 | /build/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/app/admin/configuration/configuration.route.ts: -------------------------------------------------------------------------------- 1 | import { Route } from '@angular/router'; 2 | 3 | import { JhiConfigurationComponent } from './configuration.component'; 4 | 5 | export const configurationRoute: Route = { 6 | path: 'jhi-configuration', 7 | component: JhiConfigurationComponent, 8 | data: { 9 | pageTitle: 'configuration.title' 10 | } 11 | }; 12 | -------------------------------------------------------------------------------- /Chapter06/catalog-service/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | 4 | ### STS ### 5 | .apt_generated 6 | .classpath 7 | .factorypath 8 | .project 9 | .settings 10 | .springBeans 11 | .sts4-cache 12 | 13 | ### IntelliJ IDEA ### 14 | .idea 15 | *.iws 16 | *.iml 17 | *.ipr 18 | 19 | ### NetBeans ### 20 | /nbproject/private/ 21 | /build/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ -------------------------------------------------------------------------------- /Chapter06/inventory-service/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | 4 | ### STS ### 5 | .apt_generated 6 | .classpath 7 | .factorypath 8 | .project 9 | .settings 10 | .springBeans 11 | .sts4-cache 12 | 13 | ### IntelliJ IDEA ### 14 | .idea 15 | *.iws 16 | *.iml 17 | *.ipr 18 | 19 | ### NetBeans ### 20 | /nbproject/private/ 21 | /build/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ -------------------------------------------------------------------------------- /Chapter06/zuul-api-gateway/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | 4 | ### STS ### 5 | .apt_generated 6 | .classpath 7 | .factorypath 8 | .project 9 | .settings 10 | .springBeans 11 | .sts4-cache 12 | 13 | ### IntelliJ IDEA ### 14 | .idea 15 | *.iws 16 | *.iml 17 | *.ipr 18 | 19 | ### NetBeans ### 20 | /nbproject/private/ 21 | /build/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ -------------------------------------------------------------------------------- /Chapter07/KotlinBasics/.idea/kotlinc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 10 | -------------------------------------------------------------------------------- /Chapter03/blogpress/src/main/java/com/nilangpatel/blogpress/constants/BlogStatus.java: -------------------------------------------------------------------------------- 1 | package com.nilangpatel.blogpress.constants; 2 | 3 | public enum BlogStatus { 4 | 5 | PUBLISHED("Published"), DRAFT("Draft"); 6 | 7 | private String status; 8 | 9 | private BlogStatus(String status) { 10 | this.status = status; 11 | } 12 | 13 | public String getStatus() { 14 | return status; 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /Chapter06/catalog-service/src/main/java/com/bookstore/catalog/repository/BookRepository.java: -------------------------------------------------------------------------------- 1 | package com.bookstore.catalog.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | import org.springframework.stereotype.Repository; 5 | 6 | import com.bookstore.catalog.model.Book; 7 | 8 | @Repository 9 | public interface BookRepository extends JpaRepository { 10 | 11 | } 12 | -------------------------------------------------------------------------------- /Chapter07/taskmanagementsystem/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | 4 | ### STS ### 5 | .apt_generated 6 | .classpath 7 | .factorypath 8 | .project 9 | .settings 10 | .springBeans 11 | .sts4-cache 12 | 13 | ### IntelliJ IDEA ### 14 | .idea 15 | *.iws 16 | *.iml 17 | *.ipr 18 | 19 | ### NetBeans ### 20 | /nbproject/private/ 21 | /build/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ -------------------------------------------------------------------------------- /Chapter01/worldgdp/target/surefire-reports/com.nilangpatel.test.config.controller.api.CityAPIControllerTest.txt: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------- 2 | Test set: com.nilangpatel.test.config.controller.api.CityAPIControllerTest 3 | ------------------------------------------------------------------------------- 4 | Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.889 sec 5 | -------------------------------------------------------------------------------- /Chapter04/SpringCustomAuthorization/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | 4 | ### STS ### 5 | .apt_generated 6 | .classpath 7 | .factorypath 8 | .project 9 | .settings 10 | .springBeans 11 | .sts4-cache 12 | 13 | ### IntelliJ IDEA ### 14 | .idea 15 | *.iws 16 | *.iml 17 | *.ipr 18 | 19 | ### NetBeans ### 20 | /nbproject/private/ 21 | /build/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/app/core/user/account.model.ts: -------------------------------------------------------------------------------- 1 | export class Account { 2 | constructor( 3 | public activated: boolean, 4 | public authorities: string[], 5 | public email: string, 6 | public firstName: string, 7 | public langKey: string, 8 | public lastName: string, 9 | public login: string, 10 | public imageUrl: string 11 | ) {} 12 | } 13 | -------------------------------------------------------------------------------- /Chapter06/eureka-discovery-service/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | 4 | ### STS ### 5 | .apt_generated 6 | .classpath 7 | .factorypath 8 | .project 9 | .settings 10 | .springBeans 11 | .sts4-cache 12 | 13 | ### IntelliJ IDEA ### 14 | .idea 15 | *.iws 16 | *.iml 17 | *.ipr 18 | 19 | ### NetBeans ### 20 | /nbproject/private/ 21 | /build/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ -------------------------------------------------------------------------------- /Chapter06/spring-cloud-config-server/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | 4 | ### STS ### 5 | .apt_generated 6 | .classpath 7 | .factorypath 8 | .project 9 | .settings 10 | .springBeans 11 | .sts4-cache 12 | 13 | ### IntelliJ IDEA ### 14 | .idea 15 | *.iws 16 | *.iml 17 | *.ipr 18 | 19 | ### NetBeans ### 20 | /nbproject/private/ 21 | /build/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ -------------------------------------------------------------------------------- /Chapter01/worldgdp/target/surefire-reports/com.nilangpatel.test.config.controller.api.CountryAPIControllerTest.txt: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------- 2 | Test set: com.nilangpatel.test.config.controller.api.CountryAPIControllerTest 3 | ------------------------------------------------------------------------------- 4 | Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.044 sec 5 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/app/core/language/language.constants.ts: -------------------------------------------------------------------------------- 1 | /* 2 | Languages codes are ISO_639-1 codes, see http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes 3 | They are written in English to avoid character encoding issues (not a perfect solution) 4 | */ 5 | export const LANGUAGES: string[] = [ 6 | 'en' 7 | // jhipster-needle-i18n-language-constant - JHipster will add/remove languages in this array 8 | ]; 9 | -------------------------------------------------------------------------------- /Chapter06/bookstore-authorization-server/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | 4 | ### STS ### 5 | .apt_generated 6 | .classpath 7 | .factorypath 8 | .project 9 | .settings 10 | .springBeans 11 | .sts4-cache 12 | 13 | ### IntelliJ IDEA ### 14 | .idea 15 | *.iws 16 | *.iml 17 | *.ipr 18 | 19 | ### NetBeans ### 20 | /nbproject/private/ 21 | /build/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ -------------------------------------------------------------------------------- /Chapter02/SpringWebFluxDemo/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | /target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | 5 | ### STS ### 6 | .apt_generated 7 | .classpath 8 | .factorypath 9 | .project 10 | .settings 11 | .springBeans 12 | .sts4-cache 13 | 14 | ### IntelliJ IDEA ### 15 | .idea 16 | *.iws 17 | *.iml 18 | *.ipr 19 | 20 | ### NetBeans ### 21 | /nbproject/private/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ 26 | /build/ 27 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/i18n/en/password.json: -------------------------------------------------------------------------------- 1 | { 2 | "password": { 3 | "title": "Password for [{{username}}]", 4 | "form": { 5 | "button": "Save" 6 | }, 7 | "messages": { 8 | "error": "An error has occurred! The password could not be changed.", 9 | "success": "Password changed!" 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Chapter06/catalog-service/src/main/java/com/bookstore/catalog/repository/CategoryRepository.java: -------------------------------------------------------------------------------- 1 | package com.bookstore.catalog.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | import org.springframework.stereotype.Repository; 5 | 6 | import com.bookstore.catalog.model.Category; 7 | 8 | @Repository 9 | public interface CategoryRepository extends JpaRepository { 10 | 11 | } 12 | -------------------------------------------------------------------------------- /Chapter03/blogpress/src/main/java/com/nilangpatel/blogpress/constants/CommentStatus.java: -------------------------------------------------------------------------------- 1 | package com.nilangpatel.blogpress.constants; 2 | 3 | public enum CommentStatus { 4 | 5 | APPROVED("A"), MODERATE("M"),DELETED("D"),REJECTED("R"); 6 | 7 | private String status; 8 | 9 | private CommentStatus(String status) { 10 | this.status = status; 11 | } 12 | 13 | public String getStatus() { 14 | return status; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/test/javascript/spec/helpers/mock-event-manager.service.ts: -------------------------------------------------------------------------------- 1 | import { SpyObject } from './spyobject'; 2 | import { JhiEventManager } from 'ng-jhipster'; 3 | import Spy = jasmine.Spy; 4 | 5 | export class MockEventManager extends SpyObject { 6 | broadcastSpy: Spy; 7 | 8 | constructor() { 9 | super(JhiEventManager); 10 | this.broadcastSpy = this.spy('broadcast').andReturn(this); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Chapter06/catalog-service/src/main/java/com/bookstore/catalog/repository/PublisherRepository.java: -------------------------------------------------------------------------------- 1 | package com.bookstore.catalog.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | import org.springframework.stereotype.Repository; 5 | 6 | import com.bookstore.catalog.model.Publisher; 7 | 8 | @Repository 9 | public interface PublisherRepository extends JpaRepository { 10 | 11 | } 12 | -------------------------------------------------------------------------------- /Chapter07/taskmanagementsystem/src/main/kotlin/com/nilangpatel/tms/repository/UserRepository.kt: -------------------------------------------------------------------------------- 1 | package com.nilangpatel.tms.repository 2 | 3 | import com.nilangpatel.tms.model.User 4 | import org.springframework.data.jpa.repository.JpaRepository 5 | import org.springframework.stereotype.Repository 6 | 7 | @Repository 8 | interface UserRepository : JpaRepository { 9 | 10 | fun findByUsername(username: String): User? 11 | } -------------------------------------------------------------------------------- /Chapter01/worldgdp/target/surefire-reports/com.nilangpatel.test.config.controller.api.CountryLanguageAPIControllerTest.txt: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------- 2 | Test set: com.nilangpatel.test.config.controller.api.CountryLanguageAPIControllerTest 3 | ------------------------------------------------------------------------------- 4 | Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.047 sec 5 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/test/javascript/spec/helpers/mock-active-modal.service.ts: -------------------------------------------------------------------------------- 1 | import { SpyObject } from './spyobject'; 2 | import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; 3 | import Spy = jasmine.Spy; 4 | 5 | export class MockActiveModal extends SpyObject { 6 | dismissSpy: Spy; 7 | 8 | constructor() { 9 | super(NgbActiveModal); 10 | this.dismissSpy = this.spy('dismiss').andReturn(this); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Chapter04/SpringLdapAndOAuth/src/main/java/com/nilangpatel/springauth/constants/PwdEncodingAlgo.java: -------------------------------------------------------------------------------- 1 | package com.nilangpatel.springauth.constants; 2 | 3 | public enum PwdEncodingAlgo { 4 | 5 | BCrypt("bcrypt"), Pbkf2("pbkdf2"), SCrypt("scrypt"); 6 | 7 | private String status; 8 | 9 | private PwdEncodingAlgo(String status) { 10 | this.status = status; 11 | } 12 | 13 | public String getStatus() { 14 | return status; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Chapter04/SpringOnlyLDAP/src/main/java/com/nilangpatel/springldap/constants/PwdEncodingAlgo.java: -------------------------------------------------------------------------------- 1 | package com.nilangpatel.springldap.constants; 2 | 3 | public enum PwdEncodingAlgo { 4 | 5 | BCrypt("bcrypt"), Pbkf2("pbkdf2"), SCrypt("scrypt"); 6 | 7 | private String status; 8 | 9 | private PwdEncodingAlgo(String status) { 10 | this.status = status; 11 | } 12 | 13 | public String getStatus() { 14 | return status; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Chapter07/taskmanagementsystem/src/main/kotlin/com/nilangpatel/tms/TaskmanagementsystemApplication.kt: -------------------------------------------------------------------------------- 1 | package com.nilangpatel.tms 2 | 3 | import org.springframework.boot.autoconfigure.SpringBootApplication 4 | import org.springframework.boot.runApplication 5 | 6 | @SpringBootApplication 7 | class TaskManagementSystemApplication 8 | 9 | fun main(args: Array) { 10 | runApplication(*args) 11 | } 12 | 13 | -------------------------------------------------------------------------------- /Chapter03/blogpress/src/main/java/com/nilangpatel/blogpress/BlogpressApplication.java: -------------------------------------------------------------------------------- 1 | package com.nilangpatel.blogpress; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class BlogpressApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(BlogpressApplication.class, args); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/java/com/nilangpatel/web/rest/errors/EmailAlreadyUsedException.java: -------------------------------------------------------------------------------- 1 | package com.nilangpatel.web.rest.errors; 2 | 3 | public class EmailAlreadyUsedException extends BadRequestAlertException { 4 | 5 | private static final long serialVersionUID = 1L; 6 | 7 | public EmailAlreadyUsedException() { 8 | super(ErrorConstants.EMAIL_ALREADY_USED_TYPE, "Email is already in use!", "userManagement", "emailexists"); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/java/com/nilangpatel/web/rest/errors/LoginAlreadyUsedException.java: -------------------------------------------------------------------------------- 1 | package com.nilangpatel.web.rest.errors; 2 | 3 | public class LoginAlreadyUsedException extends BadRequestAlertException { 4 | 5 | private static final long serialVersionUID = 1L; 6 | 7 | public LoginAlreadyUsedException() { 8 | super(ErrorConstants.LOGIN_ALREADY_USED_TYPE, "Login name already used!", "userManagement", "userexists"); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Chapter07/KotlinBasics/.idea/codeStyles/Project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 9 | 10 | -------------------------------------------------------------------------------- /Chapter07/taskmanagementsystem/src/main/kotlin/com/nilangpatel/tms/constant/TaskStatus.kt: -------------------------------------------------------------------------------- 1 | package com.nilangpatel.tms.constant 2 | 3 | enum class TaskStatus() { 4 | 5 | PENDING("pending"), COMPLETED("completed"); // need semicolon at the last ... 6 | 7 | private var status:String="" 8 | 9 | constructor(status: String){ 10 | this.status = status 11 | } 12 | 13 | fun getStatus():String{ 14 | return this.status 15 | } 16 | } -------------------------------------------------------------------------------- /Chapter04/SpringLdapAndOAuth/src/main/java/com/nilangpatel/springauth/SpringAuthApplication.java: -------------------------------------------------------------------------------- 1 | package com.nilangpatel.springauth; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringAuthApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringAuthApplication.class, args); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/app/account/password-reset/init/password-reset-init.route.ts: -------------------------------------------------------------------------------- 1 | import { Route } from '@angular/router'; 2 | 3 | import { PasswordResetInitComponent } from './password-reset-init.component'; 4 | 5 | export const passwordResetInitRoute: Route = { 6 | path: 'reset/request', 7 | component: PasswordResetInitComponent, 8 | data: { 9 | authorities: [], 10 | pageTitle: 'global.menu.account.password' 11 | } 12 | }; 13 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/java/com/nilangpatel/repository/CityRepository.java: -------------------------------------------------------------------------------- 1 | package com.nilangpatel.repository; 2 | 3 | import com.nilangpatel.domain.City; 4 | import org.springframework.data.jpa.repository.*; 5 | import org.springframework.stereotype.Repository; 6 | 7 | 8 | /** 9 | * Spring Data repository for the City entity. 10 | */ 11 | @SuppressWarnings("unused") 12 | @Repository 13 | public interface CityRepository extends JpaRepository { 14 | 15 | } 16 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/test/java/com/nilangpatel/repository/timezone/DateTimeWrapperRepository.java: -------------------------------------------------------------------------------- 1 | package com.nilangpatel.repository.timezone; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | import org.springframework.stereotype.Repository; 5 | 6 | /** 7 | * Spring Data JPA repository for the DateTimeWrapper entity. 8 | */ 9 | @Repository 10 | public interface DateTimeWrapperRepository extends JpaRepository { 11 | 12 | } 13 | -------------------------------------------------------------------------------- /Chapter04/SpringLdapAndOAuth/src/main/java/com/nilangpatel/springauth/repository/LdapAuthRepository.java: -------------------------------------------------------------------------------- 1 | package com.nilangpatel.springauth.repository; 2 | 3 | 4 | import org.springframework.data.ldap.repository.LdapRepository; 5 | import org.springframework.stereotype.Repository; 6 | 7 | import com.nilangpatel.springauth.model.LdapAuthUser; 8 | 9 | @Repository 10 | public interface LdapAuthRepository extends LdapRepository,LdapAuthRepositoryCustom{ 11 | 12 | } 13 | -------------------------------------------------------------------------------- /Chapter04/SpringOnlyOAuth/src/main/java/com/nilangpatel/springoauth/SpringOAuthApplication.java: -------------------------------------------------------------------------------- 1 | package com.nilangpatel.springoauth; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringOAuthApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringOAuthApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/app/account/password-reset/finish/password-reset-finish.route.ts: -------------------------------------------------------------------------------- 1 | import { Route } from '@angular/router'; 2 | 3 | import { PasswordResetFinishComponent } from './password-reset-finish.component'; 4 | 5 | export const passwordResetFinishRoute: Route = { 6 | path: 'reset/finish', 7 | component: PasswordResetFinishComponent, 8 | data: { 9 | authorities: [], 10 | pageTitle: 'global.menu.account.password' 11 | } 12 | }; 13 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/i18n/en/continent.json: -------------------------------------------------------------------------------- 1 | { 2 | "gdpApp": { 3 | "Continent": { 4 | "null": "", 5 | "ASIA": "Asia", 6 | "EUROPE": "Europe", 7 | "NORTH_AMERICA": "North America", 8 | "AFRICA": "Africa", 9 | "OCEANIA": "Oceania", 10 | "ANTARCTICA": "Antarctica", 11 | "SOUTH_AMERICA": "South America", 12 | "ALL" : "ALL" 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/content/scss/vendor.scss: -------------------------------------------------------------------------------- 1 | /* after changing this file run 'npm run webpack:build' */ 2 | 3 | /*************************** 4 | put Sass variables here: 5 | eg $input-color: red; 6 | ****************************/ 7 | // Override Boostrap variables 8 | @import 'bootstrap-variables'; 9 | // Import Bootstrap source files from node_modules 10 | @import '~bootstrap/scss/bootstrap'; 11 | 12 | /* jhipster-needle-scss-add-vendor JHipster will add new css style */ 13 | -------------------------------------------------------------------------------- /Chapter07/taskmanagementsystem/src/main/kotlin/com/nilangpatel/tms/model/CustomGrantedAuthority.kt: -------------------------------------------------------------------------------- 1 | package com.nilangpatel.tms.model 2 | 3 | import org.springframework.security.core.GrantedAuthority 4 | 5 | class CustomGrantedAuthority : GrantedAuthority{ 6 | 7 | private var role:Role?=null 8 | 9 | constructor( role:Role ){ 10 | this.role = role 11 | } 12 | 13 | override fun getAuthority(): String { 14 | return role?.getRole() ?: "" 15 | } 16 | } -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/java/com/nilangpatel/security/AuthoritiesConstants.java: -------------------------------------------------------------------------------- 1 | package com.nilangpatel.security; 2 | 3 | /** 4 | * Constants for Spring Security authorities. 5 | */ 6 | public final class AuthoritiesConstants { 7 | 8 | public static final String ADMIN = "ROLE_ADMIN"; 9 | 10 | public static final String USER = "ROLE_USER"; 11 | 12 | public static final String ANONYMOUS = "ROLE_ANONYMOUS"; 13 | 14 | private AuthoritiesConstants() { 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Chapter06/bookstore-authorization-server/src/main/java/com/bookstore/auth/controller/WebMvcController.java: -------------------------------------------------------------------------------- 1 | package com.bookstore.auth.controller; 2 | 3 | import org.springframework.stereotype.Controller; 4 | import org.springframework.ui.Model; 5 | import org.springframework.web.bind.annotation.GetMapping; 6 | 7 | @Controller 8 | public class WebMvcController { 9 | 10 | @GetMapping("/login") 11 | public String showLoginPage(Model model) { 12 | return "login"; 13 | } 14 | } -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/app/home/home.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; 2 | import { RouterModule } from '@angular/router'; 3 | 4 | import { GdpSharedModule } from 'app/shared'; 5 | import { HOME_ROUTE, HomeComponent } from './'; 6 | 7 | @NgModule({ 8 | imports: [GdpSharedModule, RouterModule.forChild([HOME_ROUTE])], 9 | declarations: [HomeComponent], 10 | schemas: [CUSTOM_ELEMENTS_SCHEMA] 11 | }) 12 | export class GdpHomeModule {} 13 | -------------------------------------------------------------------------------- /Chapter06/user-service/src/main/java/com/bookstore/user/repository/UserRepository.java: -------------------------------------------------------------------------------- 1 | package com.bookstore.user.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | import org.springframework.stereotype.Repository; 5 | 6 | import com.bookstore.user.model.User; 7 | 8 | @Repository 9 | public interface UserRepository extends JpaRepository { 10 | 11 | User findByUsername(String username); 12 | 13 | User findByEmail(String email); 14 | } 15 | -------------------------------------------------------------------------------- /Chapter06/book-service/src/test/java/com/bookstore/book/BookServiceApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.bookstore.book; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.boot.test.context.SpringBootTest; 6 | import org.springframework.test.context.junit4.SpringRunner; 7 | 8 | @RunWith(SpringRunner.class) 9 | @SpringBootTest 10 | public class BookServiceApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | 18 | -------------------------------------------------------------------------------- /Chapter06/catalog-service/src/test/java/com/bookstore/book/BookServiceApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.bookstore.book; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.boot.test.context.SpringBootTest; 6 | import org.springframework.test.context.junit4.SpringRunner; 7 | 8 | @RunWith(SpringRunner.class) 9 | @SpringBootTest 10 | public class BookServiceApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | 18 | -------------------------------------------------------------------------------- /Chapter06/user-service/src/test/java/com/bookstore/user/UserServiceApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.bookstore.user; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.boot.test.context.SpringBootTest; 6 | import org.springframework.test.context.junit4.SpringRunner; 7 | 8 | @RunWith(SpringRunner.class) 9 | @SpringBootTest 10 | public class UserServiceApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | 18 | -------------------------------------------------------------------------------- /Chapter04/SpringAuthResource/src/main/java/com/nilangpatel/springauthresource/SpringAuthResourceApplication.java: -------------------------------------------------------------------------------- 1 | package com.nilangpatel.springauthresource; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringAuthResourceApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringAuthResourceApplication.class, args); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Chapter04/SpringLdapAndOAuth/src/main/java/com/nilangpatel/springauth/model/LdapGranntedAuthority.java: -------------------------------------------------------------------------------- 1 | package com.nilangpatel.springauth.model; 2 | 3 | import org.springframework.security.core.GrantedAuthority; 4 | 5 | public class LdapGranntedAuthority implements GrantedAuthority { 6 | 7 | String authority; 8 | public void setAuthority(String authority) { 9 | this.authority = authority; 10 | } 11 | 12 | @Override 13 | public String getAuthority() { 14 | return authority; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Chapter06/order-service/src/test/java/com/bookstore/order/OrderServiceApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.bookstore.order; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.boot.test.context.SpringBootTest; 6 | import org.springframework.test.context.junit4.SpringRunner; 7 | 8 | @RunWith(SpringRunner.class) 9 | @SpringBootTest 10 | public class OrderServiceApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | 18 | -------------------------------------------------------------------------------- /Chapter07/KotlinBasics/src/com/nilangpatel/kotlin/smartcast/CastExampleJava.java: -------------------------------------------------------------------------------- 1 | package com.nilangpatel.kotlin.smartcast; 2 | 3 | public class CastExampleJava { 4 | 5 | public static void main(String[] args){ 6 | 7 | Object name = "Nilang"; 8 | 9 | if(name instanceof String){ 10 | greetingMsg((String) name); 11 | } 12 | } 13 | 14 | private static void greetingMsg(String name){ 15 | System.out.print(" Welcome "+name+" ..!!"); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Chapter04/SpringOnlyLDAP/src/main/resources/templates/home.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |
6 | 7 |
8 |
9 |
Home Page
10 |

Welcome, This is home page of the application

11 |
12 |
13 | 14 | -------------------------------------------------------------------------------- /Chapter06/zuul-api-gateway/src/test/java/com/zuul/apigateway/ZuulApiGatewayApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.zuul.apigateway; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.boot.test.context.SpringBootTest; 6 | import org.springframework.test.context.junit4.SpringRunner; 7 | 8 | @RunWith(SpringRunner.class) 9 | @SpringBootTest 10 | public class ZuulApiGatewayApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | 18 | -------------------------------------------------------------------------------- /Chapter07/KotlinBasics/src/com/nilangpatel/kotlin/function/defaultarg/CubeVolume.kt: -------------------------------------------------------------------------------- 1 | package com.nilangpatel.kotlin.function.defaultarg 2 | 3 | fun main(args: Array) { 4 | var volume : Int = getVolume(2,4) 5 | print("get Volume $volume") 6 | } 7 | 8 | fun getVolume(length:Int, width:Int,height:Int =10):Int{ 9 | return length * width * height; 10 | } 11 | 12 | /* Without default argument 13 | fun getVolume(length:Int, width:Int,height:Int):Int{ 14 | return length * width * height; 15 | } */ -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/app/layouts/index.ts: -------------------------------------------------------------------------------- 1 | export * from './error/error.component'; 2 | export * from './error/error.route'; 3 | export * from './main/main.component'; 4 | export * from './footer/footer.component'; 5 | export * from './navbar/navbar.component'; 6 | export * from './navbar/navbar.route'; 7 | export * from './navbar/active-menu.directive'; 8 | export * from './profiles/page-ribbon.component'; 9 | export * from './profiles/profile.service'; 10 | export * from './profiles/profile-info.model'; 11 | -------------------------------------------------------------------------------- /Chapter02/SpringWebFluxDemo/src/test/java/com/nilangpatel/webflux/SpringWebFluxDemoApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.nilangpatel.webflux; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.boot.test.context.SpringBootTest; 6 | import org.springframework.test.context.junit4.SpringRunner; 7 | 8 | @RunWith(SpringRunner.class) 9 | @SpringBootTest 10 | public class SpringWebFluxDemoApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /Chapter04/SpringLdapAndOAuth/src/main/resources/templates/user-page.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 |
9 |
10 |
11 |
User Page
12 |

Welcome, This is User Pages

13 |
14 |
15 | 16 | 17 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/app/account/password/password.route.ts: -------------------------------------------------------------------------------- 1 | import { Route } from '@angular/router'; 2 | 3 | import { UserRouteAccessService } from 'app/core'; 4 | import { PasswordComponent } from './password.component'; 5 | 6 | export const passwordRoute: Route = { 7 | path: 'password', 8 | component: PasswordComponent, 9 | data: { 10 | authorities: ['ROLE_USER'], 11 | pageTitle: 'global.menu.account.password' 12 | }, 13 | canActivate: [UserRouteAccessService] 14 | }; 15 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/app/account/sessions/sessions.route.ts: -------------------------------------------------------------------------------- 1 | import { Route } from '@angular/router'; 2 | 3 | import { UserRouteAccessService } from 'app/core'; 4 | import { SessionsComponent } from './sessions.component'; 5 | 6 | export const sessionsRoute: Route = { 7 | path: 'sessions', 8 | component: SessionsComponent, 9 | data: { 10 | authorities: ['ROLE_USER'], 11 | pageTitle: 'global.menu.account.sessions' 12 | }, 13 | canActivate: [UserRouteAccessService] 14 | }; 15 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/app/account/settings/settings.route.ts: -------------------------------------------------------------------------------- 1 | import { Route } from '@angular/router'; 2 | 3 | import { UserRouteAccessService } from 'app/core'; 4 | import { SettingsComponent } from './settings.component'; 5 | 6 | export const settingsRoute: Route = { 7 | path: 'settings', 8 | component: SettingsComponent, 9 | data: { 10 | authorities: ['ROLE_USER'], 11 | pageTitle: 'global.menu.account.settings' 12 | }, 13 | canActivate: [UserRouteAccessService] 14 | }; 15 | -------------------------------------------------------------------------------- /Chapter04/SpringAuthResource/src/main/resources/templates/private-page.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |
6 | 7 |
8 |
9 |
Private Page
10 |

Welcome, This is Private page

11 | 12 | 13 |
14 |
15 | 16 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/java/com/nilangpatel/repository/CountryRepository.java: -------------------------------------------------------------------------------- 1 | package com.nilangpatel.repository; 2 | 3 | import com.nilangpatel.domain.Country; 4 | import org.springframework.data.jpa.repository.*; 5 | import org.springframework.stereotype.Repository; 6 | 7 | 8 | /** 9 | * Spring Data repository for the Country entity. 10 | */ 11 | @SuppressWarnings("unused") 12 | @Repository 13 | public interface CountryRepository extends JpaRepository, JpaSpecificationExecutor { 14 | 15 | } 16 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/test/java/com/nilangpatel/config/WebConfigurerTestController.java: -------------------------------------------------------------------------------- 1 | package com.nilangpatel.config; 2 | 3 | import org.springframework.web.bind.annotation.GetMapping; 4 | import org.springframework.web.bind.annotation.RestController; 5 | 6 | @RestController 7 | public class WebConfigurerTestController { 8 | 9 | @GetMapping("/api/test-cors") 10 | public void testCorsOnApiPath() { 11 | } 12 | 13 | @GetMapping("/test/test-cors") 14 | public void testCorsOnOtherPath() { 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Chapter06/bookstore-authorization-server/src/main/java/com/bookstore/auth/user/repository/UserRepository.java: -------------------------------------------------------------------------------- 1 | package com.bookstore.auth.user.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | import org.springframework.stereotype.Repository; 5 | 6 | import com.bookstore.auth.user.model.User; 7 | 8 | @Repository 9 | public interface UserRepository extends JpaRepository { 10 | 11 | User findByUsername(String username); 12 | 13 | User findByEmail(String email); 14 | } 15 | -------------------------------------------------------------------------------- /Chapter06/inventory-service/src/test/java/com/bookstore/inventory/InventoryServiceApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.bookstore.inventory; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.boot.test.context.SpringBootTest; 6 | import org.springframework.test.context.junit4.SpringRunner; 7 | 8 | @RunWith(SpringRunner.class) 9 | @SpringBootTest 10 | public class InventoryServiceApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | 18 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/docker/mysql.yml: -------------------------------------------------------------------------------- 1 | version: '2' 2 | services: 3 | gdp-mysql: 4 | image: mysql:5.7.20 5 | # volumes: 6 | # - ~/volumes/jhipster/gdp/mysql/:/var/lib/mysql/ 7 | environment: 8 | - MYSQL_USER=root 9 | - MYSQL_ALLOW_EMPTY_PASSWORD=yes 10 | - MYSQL_DATABASE=gdp 11 | ports: 12 | - 3306:3306 13 | command: mysqld --lower_case_table_names=1 --skip-ssl --character_set_server=utf8mb4 --explicit_defaults_for_timestamp 14 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/java/com/nilangpatel/repository/CountryLanguageRepository.java: -------------------------------------------------------------------------------- 1 | package com.nilangpatel.repository; 2 | 3 | import com.nilangpatel.domain.CountryLanguage; 4 | import org.springframework.data.jpa.repository.*; 5 | import org.springframework.stereotype.Repository; 6 | 7 | 8 | /** 9 | * Spring Data repository for the CountryLanguage entity. 10 | */ 11 | @SuppressWarnings("unused") 12 | @Repository 13 | public interface CountryLanguageRepository extends JpaRepository { 14 | 15 | } 16 | -------------------------------------------------------------------------------- /Chapter06/bookstore-authorization-server/src/main/java/com/bookstore/auth/BookstoreAuthorizationServerApplication.java: -------------------------------------------------------------------------------- 1 | package com.bookstore.auth; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class BookstoreAuthorizationServerApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(BookstoreAuthorizationServerApplication.class, args); 11 | } 12 | 13 | } 14 | 15 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/java/com/nilangpatel/service/mapper/EntityMapper.java: -------------------------------------------------------------------------------- 1 | package com.nilangpatel.service.mapper; 2 | 3 | import java.util.List; 4 | 5 | /** 6 | * Contract for a generic dto to entity mapper. 7 | * 8 | * @param - DTO type parameter. 9 | * @param - Entity type parameter. 10 | */ 11 | 12 | public interface EntityMapper { 13 | 14 | E toEntity(D dto); 15 | 16 | D toDto(E entity); 17 | 18 | List toEntity(List dtoList); 19 | 20 | List toDto(List entityList); 21 | } 22 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/app/app.main.ts: -------------------------------------------------------------------------------- 1 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 2 | import { ProdConfig } from './blocks/config/prod.config'; 3 | import { GdpAppModule } from './app.module'; 4 | 5 | ProdConfig(); 6 | 7 | if (module['hot']) { 8 | module['hot'].accept(); 9 | } 10 | 11 | platformBrowserDynamic() 12 | .bootstrapModule(GdpAppModule, { preserveWhitespaces: true }) 13 | .then(success => console.log(`Application started`)) 14 | .catch(err => console.error(err)); 15 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/app/shared/shared-common.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | 3 | import { GdpSharedLibsModule, FindLanguageFromKeyPipe, JhiAlertComponent, JhiAlertErrorComponent } from './'; 4 | 5 | @NgModule({ 6 | imports: [GdpSharedLibsModule], 7 | declarations: [FindLanguageFromKeyPipe, JhiAlertComponent, JhiAlertErrorComponent], 8 | exports: [GdpSharedLibsModule, FindLanguageFromKeyPipe, JhiAlertComponent, JhiAlertErrorComponent] 9 | }) 10 | export class GdpSharedCommonModule {} 11 | -------------------------------------------------------------------------------- /Chapter06/eureka-discovery-service/src/test/java/com/eureka/discovery/EurekaDiscoveryServiceApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.eureka.discovery; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.boot.test.context.SpringBootTest; 6 | import org.springframework.test.context.junit4.SpringRunner; 7 | 8 | @RunWith(SpringRunner.class) 9 | @SpringBootTest 10 | public class EurekaDiscoveryServiceApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | 18 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/java/com/nilangpatel/web/rest/errors/InvalidPasswordException.java: -------------------------------------------------------------------------------- 1 | package com.nilangpatel.web.rest.errors; 2 | 3 | import org.zalando.problem.AbstractThrowableProblem; 4 | import org.zalando.problem.Status; 5 | 6 | public class InvalidPasswordException extends AbstractThrowableProblem { 7 | 8 | private static final long serialVersionUID = 1L; 9 | 10 | public InvalidPasswordException() { 11 | super(ErrorConstants.INVALID_PASSWORD_TYPE, "Incorrect password", Status.BAD_REQUEST); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/app/account/register/register.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { HttpClient } from '@angular/common/http'; 3 | import { Observable } from 'rxjs'; 4 | 5 | import { SERVER_API_URL } from 'app/app.constants'; 6 | 7 | @Injectable({ providedIn: 'root' }) 8 | export class Register { 9 | constructor(private http: HttpClient) {} 10 | 11 | save(account: any): Observable { 12 | return this.http.post(SERVER_API_URL + 'api/register', account); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/app/shared/language/find-language-from-key.pipe.ts: -------------------------------------------------------------------------------- 1 | import { Pipe, PipeTransform } from '@angular/core'; 2 | 3 | @Pipe({ name: 'findLanguageFromKey' }) 4 | export class FindLanguageFromKeyPipe implements PipeTransform { 5 | private languages: any = { 6 | en: { name: 'English' } 7 | // jhipster-needle-i18n-language-key-pipe - JHipster will add/remove languages in this object 8 | }; 9 | transform(lang: string): string { 10 | return this.languages[lang].name; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Chapter04/SpringOnlyLDAP/src/main/java/com/nilangpatel/springldap/SpringLdapApplication.java: -------------------------------------------------------------------------------- 1 | package com.nilangpatel.springldap; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.data.ldap.repository.config.EnableLdapRepositories; 6 | 7 | @SpringBootApplication 8 | public class SpringLdapApplication { 9 | 10 | public static void main(String[] args) { 11 | SpringApplication.run(SpringLdapApplication.class, args); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/java/com/nilangpatel/config/ApplicationProperties.java: -------------------------------------------------------------------------------- 1 | package com.nilangpatel.config; 2 | 3 | import org.springframework.boot.context.properties.ConfigurationProperties; 4 | 5 | /** 6 | * Properties specific to Gdp. 7 | *

8 | * Properties are configured in the application.yml file. 9 | * See {@link io.github.jhipster.config.JHipsterProperties} for a good example. 10 | */ 11 | @ConfigurationProperties(prefix = "application", ignoreUnknownFields = false) 12 | public class ApplicationProperties { 13 | 14 | } 15 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/java/com/nilangpatel/web/rest/errors/EmailNotFoundException.java: -------------------------------------------------------------------------------- 1 | package com.nilangpatel.web.rest.errors; 2 | 3 | import org.zalando.problem.AbstractThrowableProblem; 4 | import org.zalando.problem.Status; 5 | 6 | public class EmailNotFoundException extends AbstractThrowableProblem { 7 | 8 | private static final long serialVersionUID = 1L; 9 | 10 | public EmailNotFoundException() { 11 | super(ErrorConstants.EMAIL_NOT_FOUND_TYPE, "Email address not registered", Status.BAD_REQUEST); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Chapter06/spring-cloud-config-server/src/test/java/com/spring/cloud/config/SpringCloudConfigServerApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.spring.cloud.config; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.boot.test.context.SpringBootTest; 6 | import org.springframework.test.context.junit4.SpringRunner; 7 | 8 | @RunWith(SpringRunner.class) 9 | @SpringBootTest 10 | public class SpringCloudConfigServerApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | 18 | -------------------------------------------------------------------------------- /Chapter03/blogpress/src/main/java/com/nilangpatel/blogpress/ServletInitializer.java: -------------------------------------------------------------------------------- 1 | package com.nilangpatel.blogpress; 2 | 3 | import org.springframework.boot.builder.SpringApplicationBuilder; 4 | import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; 5 | 6 | public class ServletInitializer extends SpringBootServletInitializer { 7 | 8 | @Override 9 | protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { 10 | return application.sources(BlogpressApplication.class); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Chapter06/bookstore-authorization-server/src/test/java/com/bookstore/auth/BookstoreAuthorizationServerApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.bookstore.auth; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.boot.test.context.SpringBootTest; 6 | import org.springframework.test.context.junit4.SpringRunner; 7 | 8 | @RunWith(SpringRunner.class) 9 | @SpringBootTest 10 | public class BookstoreAuthorizationServerApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | 18 | -------------------------------------------------------------------------------- /Chapter07/taskmanagementsystem/src/test/kotlin/com/nilangpatel/tms/taskmanagementsystem/TaskmanagementsystemApplicationTests.kt: -------------------------------------------------------------------------------- 1 | package com.nilangpatel.tms.taskmanagementsystem 2 | 3 | import org.junit.Test 4 | import org.junit.runner.RunWith 5 | import org.springframework.boot.test.context.SpringBootTest 6 | import org.springframework.test.context.junit4.SpringRunner 7 | 8 | @RunWith(SpringRunner::class) 9 | @SpringBootTest 10 | class TaskmanagementsystemApplicationTests { 11 | 12 | @Test 13 | fun contextLoads() { 14 | } 15 | 16 | } 17 | 18 | -------------------------------------------------------------------------------- /Chapter01/worldgdp/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 3 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 4 | org.eclipse.jdt.core.compiler.compliance=1.8 5 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 6 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 7 | org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning 8 | org.eclipse.jdt.core.compiler.release=disabled 9 | org.eclipse.jdt.core.compiler.source=1.8 10 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM openjdk:8-jre-alpine 2 | 3 | ENV SPRING_OUTPUT_ANSI_ENABLED=ALWAYS \ 4 | JHIPSTER_SLEEP=0 \ 5 | JAVA_OPTS="" 6 | 7 | # Add a jhipster user to run our application so that it doesn't need to run as root 8 | RUN adduser -D -s /bin/sh jhipster 9 | WORKDIR /home/jhipster 10 | 11 | ADD entrypoint.sh entrypoint.sh 12 | RUN chmod 755 entrypoint.sh && chown jhipster:jhipster entrypoint.sh 13 | USER jhipster 14 | 15 | ENTRYPOINT ["./entrypoint.sh"] 16 | 17 | EXPOSE 8080 18 | 19 | ADD *.war app.war 20 | 21 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/java/com/nilangpatel/config/Constants.java: -------------------------------------------------------------------------------- 1 | package com.nilangpatel.config; 2 | 3 | /** 4 | * Application constants. 5 | */ 6 | public final class Constants { 7 | 8 | // Regex for acceptable logins 9 | public static final String LOGIN_REGEX = "^[_.@A-Za-z0-9-]*$"; 10 | 11 | public static final String SYSTEM_ACCOUNT = "system"; 12 | public static final String ANONYMOUS_USER = "anonymoususer"; 13 | public static final String DEFAULT_LANGUAGE = "en"; 14 | 15 | private Constants() { 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Chapter04/SpringOnlyLDAP/src/main/java/com/nilangpatel/springldap/ServletInitializer.java: -------------------------------------------------------------------------------- 1 | package com.nilangpatel.springldap; 2 | 3 | import org.springframework.boot.builder.SpringApplicationBuilder; 4 | import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; 5 | 6 | public class ServletInitializer extends SpringBootServletInitializer { 7 | 8 | @Override 9 | protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { 10 | return application.sources(SpringLdapApplication.class); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Chapter04/SpringLdapAndOAuth/src/main/java/com/nilangpatel/springauth/ServletInitializer.java: -------------------------------------------------------------------------------- 1 | package com.nilangpatel.springauth; 2 | 3 | import org.springframework.boot.builder.SpringApplicationBuilder; 4 | import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; 5 | 6 | public class ServletInitializer extends SpringBootServletInitializer { 7 | 8 | @Override 9 | protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { 10 | return application.sources(SpringAuthApplication.class); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Chapter04/SpringOnlyOAuth/src/main/java/com/nilangpatel/springoauth/ServletInitializer.java: -------------------------------------------------------------------------------- 1 | package com.nilangpatel.springoauth; 2 | 3 | import org.springframework.boot.builder.SpringApplicationBuilder; 4 | import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; 5 | 6 | public class ServletInitializer extends SpringBootServletInitializer { 7 | 8 | @Override 9 | protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { 10 | return application.sources(SpringOAuthApplication.class); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/app/shared/model/city.model.ts: -------------------------------------------------------------------------------- 1 | export interface ICity { 2 | id?: number; 3 | name?: string; 4 | distrct?: string; 5 | population?: number; 6 | countryName?: string; 7 | countryId?: number; 8 | } 9 | 10 | export class City implements ICity { 11 | constructor( 12 | public id?: number, 13 | public name?: string, 14 | public distrct?: string, 15 | public population?: number, 16 | public countryName?: string, 17 | public countryId?: number 18 | ) {} 19 | } 20 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/i18n/en/sessions.json: -------------------------------------------------------------------------------- 1 | { 2 | "sessions": { 3 | "title": "Active sessions for [{{username}}]", 4 | "table": { 5 | "ipaddress": "IP address", 6 | "useragent": "User Agent", 7 | "date": "Date", 8 | "button": "Invalidate" 9 | }, 10 | "messages": { 11 | "success": "Session invalidated!", 12 | "error": "An error has occurred! The session could not be invalidated." 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Chapter03/blogpress/src/main/java/com/nilangpatel/blogpress/repository/BlogRepository.java: -------------------------------------------------------------------------------- 1 | package com.nilangpatel.blogpress.repository; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; 6 | import org.springframework.stereotype.Repository; 7 | 8 | import com.nilangpatel.blogpress.model.Blog; 9 | 10 | @Repository 11 | public interface BlogRepository extends ElasticsearchRepository,BlogRepositoryCustom{ 12 | 13 | public List findByTitleAndBody(String title, String body); 14 | } 15 | -------------------------------------------------------------------------------- /Chapter07/KotlinBasics/KotlinBasics.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/i18n/en/error.json: -------------------------------------------------------------------------------- 1 | { 2 | "error": { 3 | "title": "Error page!", 4 | "http": { 5 | "400": "Bad request.", 6 | "403": "You are not authorized to access this page.", 7 | "405": "The HTTP verb you used is not supported for this URL.", 8 | "500": "Internal server error." 9 | }, 10 | "concurrencyFailure": "Another user modified this data at the same time as you. Your changes were rejected.", 11 | "validation": "Validation error on the server." 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Chapter04/SpringAuthResource/src/main/java/com/nilangpatel/springauthresource/ServletInitializer.java: -------------------------------------------------------------------------------- 1 | package com.nilangpatel.springauthresource; 2 | 3 | import org.springframework.boot.builder.SpringApplicationBuilder; 4 | import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; 5 | 6 | public class ServletInitializer extends SpringBootServletInitializer { 7 | 8 | @Override 9 | protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { 10 | return application.sources(SpringAuthResourceApplication.class); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/app/app.constants.ts: -------------------------------------------------------------------------------- 1 | // These constants are injected via webpack environment variables. 2 | // You can add more variables in webpack.common.js or in profile specific webpack..js files. 3 | // If you change the values in the webpack config files, you need to re run webpack to update the application 4 | 5 | export const VERSION = process.env.VERSION; 6 | export const DEBUG_INFO_ENABLED: boolean = !!process.env.DEBUG_INFO_ENABLED; 7 | export const SERVER_API_URL = process.env.SERVER_API_URL; 8 | export const BUILD_TIMESTAMP = process.env.BUILD_TIMESTAMP; 9 | -------------------------------------------------------------------------------- /Chapter04/SpringOnlyLDAP/src/main/java/com/nilangpatel/springldap/constants/LdapAuthConstant.java: -------------------------------------------------------------------------------- 1 | package com.nilangpatel.springldap.constants; 2 | 3 | public interface LdapAuthConstant { 4 | 5 | /* Page title constants */ 6 | String PAGE_TITLE = "pageTitle"; 7 | 8 | String TITLE_HOME_PAGE = "Home"; 9 | String TITLE_PRIVATE_PAGE = "Private"; 10 | String TITLE_LOGIN_PAGE = "Login"; 11 | 12 | /* LDAP Auth structure constants */ 13 | String LDAP_USER_SEARCH ="ou=users"; 14 | String LDAP_GROUP_SEARCH = "ou=roles"; 15 | String LDAP_USER_DN_PATTERN= "uid={0},ou=users"; 16 | } 17 | -------------------------------------------------------------------------------- /Chapter04/SpringOnlyOAuth/src/main/resources/templates/home.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |

6 | 7 |
8 |
9 |
Home Page
10 |

Welcome, This is home page of the application

11 |
12 | 15 |
16 | 17 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/app/account/password-reset/init/password-reset-init.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { HttpClient } from '@angular/common/http'; 3 | import { Observable } from 'rxjs'; 4 | 5 | import { SERVER_API_URL } from 'app/app.constants'; 6 | 7 | @Injectable({ providedIn: 'root' }) 8 | export class PasswordResetInitService { 9 | constructor(private http: HttpClient) {} 10 | 11 | save(mail: string): Observable { 12 | return this.http.post(SERVER_API_URL + 'api/account/reset-password/init', mail); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Chapter04/SpringAuthResource/src/main/java/com/nilangpatel/springauthresource/model/SampleUser.java: -------------------------------------------------------------------------------- 1 | package com.nilangpatel.springauthresource.model; 2 | 3 | public class SampleUser { 4 | 5 | private String firstName; 6 | private String lastName; 7 | 8 | public String getFirstName() { 9 | return firstName; 10 | } 11 | public void setFirstName(String firstName) { 12 | this.firstName = firstName; 13 | } 14 | public String getLastName() { 15 | return lastName; 16 | } 17 | public void setLastName(String lastName) { 18 | this.lastName = lastName; 19 | } 20 | 21 | 22 | } 23 | -------------------------------------------------------------------------------- /Chapter04/SpringCustomAuthorization/src/main/java/com/nilangpatel/springcustomauth/ServletInitializer.java: -------------------------------------------------------------------------------- 1 | package com.nilangpatel.springcustomauth; 2 | 3 | import org.springframework.boot.builder.SpringApplicationBuilder; 4 | import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; 5 | 6 | public class ServletInitializer extends SpringBootServletInitializer { 7 | 8 | @Override 9 | protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { 10 | return application.sources(SpringCustomAuthorizationApplication.class); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Chapter04/SpringLdapAndOAuth/src/main/resources/templates/home.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |
6 | 7 |
8 |
9 |
Home Page
10 |

Welcome, This is home page of the application

11 |
12 | 15 |
16 | 17 | -------------------------------------------------------------------------------- /Chapter06/eureka-discovery-service/src/main/java/com/eureka/discovery/EurekaDiscoveryServiceApplication.java: -------------------------------------------------------------------------------- 1 | package com.eureka.discovery; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer; 6 | 7 | @SpringBootApplication 8 | @EnableEurekaServer 9 | public class EurekaDiscoveryServiceApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(EurekaDiscoveryServiceApplication.class, args); 13 | } 14 | } -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/app/blocks/config/uib-pagination.config.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { NgbPaginationConfig } from '@ng-bootstrap/ng-bootstrap'; 3 | import { ITEMS_PER_PAGE } from 'app/shared'; 4 | 5 | @Injectable({ providedIn: 'root' }) 6 | export class PaginationConfig { 7 | // tslint:disable-next-line: no-unused-variable 8 | constructor(private config: NgbPaginationConfig) { 9 | config.boundaryLinks = true; 10 | config.maxSize = 5; 11 | config.pageSize = ITEMS_PER_PAGE; 12 | config.size = 'sm'; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Chapter06/user-service/src/main/java/com/bookstore/user/config/UserConfiguration.java: -------------------------------------------------------------------------------- 1 | package com.bookstore.user.config; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; 6 | import org.springframework.security.crypto.password.PasswordEncoder; 7 | 8 | 9 | @Configuration 10 | public class UserConfiguration { 11 | 12 | 13 | @Bean 14 | public PasswordEncoder passwordEncoder() { 15 | return new BCryptPasswordEncoder(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Chapter04/SpringLdapAndOAuth/src/main/resources/templates/admin-page.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 |
9 |
10 |
11 |
Admin Page
12 |

Welcome, This is Admin Page

13 |
14 | 16 |
17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /Chapter05/gdp/.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig helps developers define and maintain consistent 2 | # coding styles between different editors and IDEs 3 | # editorconfig.org 4 | 5 | root = true 6 | 7 | [*] 8 | 9 | # Change these settings to your own preference 10 | indent_style = space 11 | indent_size = 4 12 | 13 | # We recommend you to keep these unchanged 14 | end_of_line = lf 15 | charset = utf-8 16 | trim_trailing_whitespace = true 17 | insert_final_newline = true 18 | 19 | [*.md] 20 | trim_trailing_whitespace = false 21 | 22 | [{package,bower}.json] 23 | indent_style = space 24 | indent_size = 2 25 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/docker/app.yml: -------------------------------------------------------------------------------- 1 | version: '2' 2 | services: 3 | gdp-app: 4 | image: gdp 5 | environment: 6 | - _JAVA_OPTIONS=-Xmx512m -Xms256m 7 | - SPRING_PROFILES_ACTIVE=prod,swagger 8 | - SPRING_DATASOURCE_URL=jdbc:mysql://gdp-mysql:3306/gdp?useUnicode=true&characterEncoding=utf8&useSSL=false 9 | - JHIPSTER_SLEEP=10 # gives time for the database to boot before the application 10 | ports: 11 | - 8080:8080 12 | gdp-mysql: 13 | extends: 14 | file: mysql.yml 15 | service: gdp-mysql 16 | -------------------------------------------------------------------------------- /Chapter06/spring-cloud-config-server/src/main/java/com/spring/cloud/config/SpringCloudConfigServerApplication.java: -------------------------------------------------------------------------------- 1 | package com.spring.cloud.config; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.cloud.config.server.EnableConfigServer; 6 | 7 | @SpringBootApplication 8 | @EnableConfigServer 9 | public class SpringCloudConfigServerApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(SpringCloudConfigServerApplication.class, args); 13 | } 14 | } 15 | 16 | -------------------------------------------------------------------------------- /Chapter03/blogpress/src/main/java/com/nilangpatel/blogpress/repository/BlogRepositoryCustom.java: -------------------------------------------------------------------------------- 1 | package com.nilangpatel.blogpress.repository; 2 | 3 | import java.util.List; 4 | 5 | import com.nilangpatel.blogpress.model.Blog; 6 | import com.nilangpatel.blogpress.model.Comment; 7 | 8 | public interface BlogRepositoryCustom { 9 | 10 | List getAllComments(int from, int size); 11 | 12 | List getCommentsForStatus(String status,int from, int size); 13 | 14 | int getCurrentChildSequence(String blogId, String parentCommentId); 15 | 16 | List search(String searchTxt); 17 | 18 | } 19 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/app/account/password-reset/finish/password-reset-finish.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { HttpClient } from '@angular/common/http'; 3 | import { Observable } from 'rxjs'; 4 | 5 | import { SERVER_API_URL } from 'app/app.constants'; 6 | 7 | @Injectable({ providedIn: 'root' }) 8 | export class PasswordResetFinishService { 9 | constructor(private http: HttpClient) {} 10 | 11 | save(keyAndPassword: any): Observable { 12 | return this.http.post(SERVER_API_URL + 'api/account/reset-password/finish', keyAndPassword); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/app/account/password/password.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { HttpClient } from '@angular/common/http'; 3 | import { Observable } from 'rxjs'; 4 | 5 | import { SERVER_API_URL } from 'app/app.constants'; 6 | 7 | @Injectable({ providedIn: 'root' }) 8 | export class PasswordService { 9 | constructor(private http: HttpClient) {} 10 | 11 | save(newPassword: string, currentPassword: string): Observable { 12 | return this.http.post(SERVER_API_URL + 'api/account/change-password', { currentPassword, newPassword }); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Chapter06/book-service/src/main/java/com/bookstore/book/BookServiceApplication.java: -------------------------------------------------------------------------------- 1 | package com.bookstore.book; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.data.jpa.repository.config.EnableJpaRepositories; 6 | 7 | @SpringBootApplication 8 | @EnableJpaRepositories(basePackages="com.bookstore.book.repository") 9 | public class BookServiceApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(BookServiceApplication.class, args); 13 | } 14 | 15 | } 16 | 17 | -------------------------------------------------------------------------------- /Chapter07/taskmanagementsystem/src/main/resources/templates/control-page.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | Select any of the menu from left section for further actions ..!! 15 |
16 |
17 |
18 | 19 | 20 | -------------------------------------------------------------------------------- /Chapter01/worldgdp/target/classes/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | %d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /Chapter02/SpringWebFluxDemo/src/main/java/com/nilangpatel/webflux/repository/StudentMongoRepository.java: -------------------------------------------------------------------------------- 1 | package com.nilangpatel.webflux.repository; 2 | 3 | import org.springframework.data.mongodb.repository.ReactiveMongoRepository; 4 | import org.springframework.stereotype.Repository; 5 | 6 | import com.nilangpatel.webflux.model.Student; 7 | 8 | import reactor.core.publisher.Mono; 9 | 10 | @Repository 11 | public interface StudentMongoRepository extends ReactiveMongoRepository{ 12 | public Mono findByRollNo(Integer rollNo); 13 | public Mono findByName(String name); 14 | } 15 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/java/com/nilangpatel/domain/converter/ContinentEnumConvertor.java: -------------------------------------------------------------------------------- 1 | package com.nilangpatel.domain.converter; 2 | 3 | import javax.persistence.AttributeConverter; 4 | 5 | import com.nilangpatel.domain.enumeration.Continent; 6 | 7 | public class ContinentEnumConvertor implements AttributeConverter{ 8 | @Override 9 | public String convertToDatabaseColumn(Continent continent) { 10 | return continent.getName(); 11 | } 12 | @Override 13 | public Continent convertToEntityAttribute(String continentValue) { 14 | return Continent.getContinent(continentValue); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/app/account/activate/activate.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { HttpClient, HttpParams } from '@angular/common/http'; 3 | import { Observable } from 'rxjs'; 4 | 5 | import { SERVER_API_URL } from 'app/app.constants'; 6 | 7 | @Injectable({ providedIn: 'root' }) 8 | export class ActivateService { 9 | constructor(private http: HttpClient) {} 10 | 11 | get(key: string): Observable { 12 | return this.http.get(SERVER_API_URL + 'api/activate', { 13 | params: new HttpParams().set('key', key) 14 | }); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/test/javascript/jest-global-mocks.ts: -------------------------------------------------------------------------------- 1 | const mock = () => { 2 | let storage = {}; 3 | return { 4 | getItem: key => (key in storage ? storage[key] : null), 5 | setItem: (key, value) => (storage[key] = value || ''), 6 | removeItem: key => delete storage[key], 7 | clear: () => (storage = {}) 8 | }; 9 | }; 10 | 11 | Object.defineProperty(window, 'localStorage', { value: mock() }); 12 | Object.defineProperty(window, 'sessionStorage', { value: mock() }); 13 | Object.defineProperty(window, 'getComputedStyle', { 14 | value: () => ['-webkit-appearance'] 15 | }); 16 | -------------------------------------------------------------------------------- /Chapter01/worldgdp/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | %d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /Chapter04/SpringOnlyLDAP/src/main/resources/templates/private-page.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 |
9 |
10 |
11 |
Private Page
12 |

Welcome, This is private page of the application

13 |
14 | 16 |
17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /Chapter04/SpringOnlyOAuth/src/main/resources/templates/private-page.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 |
9 |
10 |
11 |
Private Page
12 |

Welcome, This is private page of the application

13 |
14 | 16 |
17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /Chapter01/worldgdp/src/main/java/com/nilangpatel/worldgdp/model/CountryGDP.java: -------------------------------------------------------------------------------- 1 | package com.nilangpatel.worldgdp.model; 2 | 3 | import lombok.Data; 4 | import lombok.Getter; 5 | import lombok.Setter; 6 | 7 | @Data 8 | @Setter 9 | @Getter 10 | public class CountryGDP { 11 | 12 | private Short year; 13 | private Double value; 14 | 15 | public Short getYear() { 16 | return year; 17 | } 18 | public void setYear(Short year) { 19 | this.year = year; 20 | } 21 | public Double getValue() { 22 | return value; 23 | } 24 | public void setValue(Double value) { 25 | this.value = value; 26 | } 27 | 28 | 29 | } 30 | -------------------------------------------------------------------------------- /Chapter04/SpringLdapAndOAuth/src/main/resources/templates/private-page.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 |
9 |
10 |
11 |
Private Page
12 |

Welcome, This is private page of the application

13 |
14 | 16 |
17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /Chapter04/SpringCustomAuthorization/src/main/resources/templates/private-page.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 |
9 | This is private page ..!!! If you able to see this, means you are successfully authenticated. 10 |
11 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/app/shared/util/request-util.ts: -------------------------------------------------------------------------------- 1 | import { HttpParams } from '@angular/common/http'; 2 | 3 | export const createRequestOption = (req?: any): HttpParams => { 4 | let options: HttpParams = new HttpParams(); 5 | if (req) { 6 | Object.keys(req).forEach(key => { 7 | if (key !== 'sort') { 8 | options = options.set(key, req[key]); 9 | } 10 | }); 11 | if (req.sort) { 12 | req.sort.forEach(val => { 13 | options = options.append('sort', val); 14 | }); 15 | } 16 | } 17 | return options; 18 | }; 19 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/i18n/en/login.json: -------------------------------------------------------------------------------- 1 | { 2 | "login": { 3 | "title": "Sign in", 4 | "form": { 5 | "password": "Password", 6 | "password.placeholder": "Your password", 7 | "rememberme": "Remember me", 8 | "button": "Sign in" 9 | }, 10 | "messages": { 11 | "error": { 12 | "authentication": "Failed to sign in! Please check your credentials and try again." 13 | } 14 | }, 15 | "password": { 16 | "forgot": "Did you forget your password?" 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/test/javascript/spec/helpers/mock-principal.service.ts: -------------------------------------------------------------------------------- 1 | import { SpyObject } from './spyobject'; 2 | import { Principal } from 'app/core/auth/principal.service'; 3 | import Spy = jasmine.Spy; 4 | 5 | export class MockPrincipal extends SpyObject { 6 | identitySpy: Spy; 7 | 8 | constructor() { 9 | super(Principal); 10 | 11 | this.setIdentitySpy({}); 12 | } 13 | setIdentitySpy(json: any): any { 14 | this.identitySpy = this.spy('identity').andReturn(Promise.resolve(json)); 15 | } 16 | 17 | setResponse(json: any): void { 18 | this.setIdentitySpy(json); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Chapter07/taskmanagementsystem/src/main/kotlin/com/nilangpatel/tms/repository/CommentRepository.kt: -------------------------------------------------------------------------------- 1 | package com.nilangpatel.tms.repository 2 | 3 | import com.nilangpatel.tms.model.Comments 4 | import org.springframework.data.jpa.repository.JpaRepository 5 | import org.springframework.data.jpa.repository.Query 6 | 7 | interface CommentRepository: JpaRepository { 8 | 9 | @Query("SELECT c.id, c.comment, concat(u.firstname,' ',u.lastname) FROM comments c inner join users u on c.user_id=u.id inner join task t on t. id = c.task_id and t.id =:taskId",nativeQuery = true) 10 | fun findByTaskId(taskId: Int):List> 11 | } -------------------------------------------------------------------------------- /Chapter06/order-service/src/main/java/com/bookstore/order/OrderServiceApplication.java: -------------------------------------------------------------------------------- 1 | package com.bookstore.order; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.cloud.client.discovery.EnableDiscoveryClient; 6 | 7 | @SpringBootApplication 8 | @EnableDiscoveryClient 9 | //@EnableJpaRepositories(basePackages="com.bookstore.order.repository") 10 | public class OrderServiceApplication { 11 | 12 | public static void main(String[] args) { 13 | SpringApplication.run(OrderServiceApplication.class, args); 14 | } 15 | 16 | } 17 | 18 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/java/com/nilangpatel/config/LoggingAspectConfiguration.java: -------------------------------------------------------------------------------- 1 | package com.nilangpatel.config; 2 | 3 | import com.nilangpatel.aop.logging.LoggingAspect; 4 | 5 | import io.github.jhipster.config.JHipsterConstants; 6 | 7 | import org.springframework.context.annotation.*; 8 | import org.springframework.core.env.Environment; 9 | 10 | @Configuration 11 | @EnableAspectJAutoProxy 12 | public class LoggingAspectConfiguration { 13 | 14 | @Bean 15 | @Profile(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT) 16 | public LoggingAspect loggingAspect(Environment env) { 17 | return new LoggingAspect(env); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/app/admin/audits/audits.route.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { Resolve, ActivatedRouteSnapshot, RouterStateSnapshot, Route } from '@angular/router'; 3 | import { JhiPaginationUtil, JhiResolvePagingParams } from 'ng-jhipster'; 4 | 5 | import { AuditsComponent } from './audits.component'; 6 | 7 | export const auditsRoute: Route = { 8 | path: 'audits', 9 | component: AuditsComponent, 10 | resolve: { 11 | pagingParams: JhiResolvePagingParams 12 | }, 13 | data: { 14 | pageTitle: 'audits.title', 15 | defaultSort: 'auditEventDate,desc' 16 | } 17 | }; 18 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/app/layouts/error/error.route.ts: -------------------------------------------------------------------------------- 1 | import { Routes } from '@angular/router'; 2 | 3 | import { ErrorComponent } from './error.component'; 4 | 5 | export const errorRoute: Routes = [ 6 | { 7 | path: 'error', 8 | component: ErrorComponent, 9 | data: { 10 | authorities: [], 11 | pageTitle: 'error.title' 12 | } 13 | }, 14 | { 15 | path: 'accessdenied', 16 | component: ErrorComponent, 17 | data: { 18 | authorities: [], 19 | pageTitle: 'error.title', 20 | error403: true 21 | } 22 | } 23 | ]; 24 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/java/com/nilangpatel/web/rest/errors/InternalServerErrorException.java: -------------------------------------------------------------------------------- 1 | package com.nilangpatel.web.rest.errors; 2 | 3 | import org.zalando.problem.AbstractThrowableProblem; 4 | import org.zalando.problem.Status; 5 | 6 | /** 7 | * Simple exception with a message, that returns an Internal Server Error code. 8 | */ 9 | public class InternalServerErrorException extends AbstractThrowableProblem { 10 | 11 | private static final long serialVersionUID = 1L; 12 | 13 | public InternalServerErrorException(String message) { 14 | super(ErrorConstants.DEFAULT_TYPE, message, Status.INTERNAL_SERVER_ERROR); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Chapter02/simple-rx-java-demo/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | rx-java 4 | simple-rx-java-demo 5 | 0.0.1-SNAPSHOT 6 | Simple RxJava demo 7 | 8 | 9 | io.reactivex.rxjava2 10 | rxjava 11 | 2.2.6 12 | 13 | 14 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/app/shared/index.ts: -------------------------------------------------------------------------------- 1 | export * from './constants/error.constants'; 2 | export * from './constants/pagination.constants'; 3 | export * from './constants/input.constants'; 4 | export * from './alert/alert.component'; 5 | export * from './alert/alert-error.component'; 6 | export * from './auth/has-any-authority.directive'; 7 | export * from './language/find-language-from-key.pipe'; 8 | export * from './login/login.component'; 9 | export * from './util/request-util'; 10 | export * from './shared-libs.module'; 11 | export * from './shared-common.module'; 12 | export * from './shared.module'; 13 | export * from './util/datepicker-adapter'; 14 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/app/admin/metrics/metrics.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { HttpClient } from '@angular/common/http'; 3 | import { Observable } from 'rxjs'; 4 | 5 | import { SERVER_API_URL } from 'app/app.constants'; 6 | 7 | @Injectable({ providedIn: 'root' }) 8 | export class JhiMetricsService { 9 | constructor(private http: HttpClient) {} 10 | 11 | getMetrics(): Observable { 12 | return this.http.get(SERVER_API_URL + 'management/metrics'); 13 | } 14 | 15 | threadDump(): Observable { 16 | return this.http.get(SERVER_API_URL + 'management/threaddump'); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Chapter03/blogpress/src/main/java/com/nilangpatel/blogpress/util/BlogpressCommentComparator.java: -------------------------------------------------------------------------------- 1 | package com.nilangpatel.blogpress.util; 2 | 3 | import java.util.Comparator; 4 | 5 | import com.nilangpatel.blogpress.model.Comment; 6 | 7 | public class BlogpressCommentComparator implements Comparator { 8 | 9 | @Override 10 | public int compare(Comment c1, Comment c2) { 11 | if(c1 == null && c2== null) { 12 | return 0; 13 | }else if(c1 !=null && c2==null) { 14 | return 1; 15 | }else if(c1 == null && c2 !=null) { 16 | return -1; 17 | }else { 18 | return c1.getPosition().compareTo(c2.getPosition()); 19 | } 20 | 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/java/com/nilangpatel/security/UserNotActivatedException.java: -------------------------------------------------------------------------------- 1 | package com.nilangpatel.security; 2 | 3 | import org.springframework.security.core.AuthenticationException; 4 | 5 | /** 6 | * This exception is thrown in case of a not activated user trying to authenticate. 7 | */ 8 | public class UserNotActivatedException extends AuthenticationException { 9 | 10 | private static final long serialVersionUID = 1L; 11 | 12 | public UserNotActivatedException(String message) { 13 | super(message); 14 | } 15 | 16 | public UserNotActivatedException(String message, Throwable t) { 17 | super(message, t); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Chapter02/simple-reactor-demo/pom.xml: -------------------------------------------------------------------------------- 1 | 4 | 4.0.0 5 | reactor-demo 6 | simple-reactor-demo 7 | 0.0.1-SNAPSHOT 8 | Smiple Reactor Dmo 9 | 10 | 11 | io.projectreactor 12 | reactor-core 13 | 3.2.6.RELEASE 14 | 15 | 16 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/resources/config/liquibase/users.csv: -------------------------------------------------------------------------------- 1 | id;login;password_hash;first_name;last_name;email;image_url;activated;lang_key;created_by;last_modified_by 2 | 1;system;$2a$10$mE.qmcV0mFU5NcKh73TZx.z4ueI/.bDWbj0T1BYyqP481kGGarKLG;System;System;system@localhost;;true;en;system;system 3 | 2;anonymoususer;$2a$10$j8S5d7Sr7.8VTOYNviDPOeWX8KcYILUVJBsYV83Y5NtECayypx9lO;Anonymous;User;anonymous@localhost;;true;en;system;system 4 | 3;admin;$2a$10$gSAhZrxMllrbgj/kkK9UceBPpChGWJA7SYIb1Mqo.n5aNLq1/oRrC;Administrator;Administrator;admin@localhost;;true;en;system;system 5 | 4;user;$2a$10$VEjxo0jq2YG9Rbk2HmX9S.k1uZBGYUHdUcid3g/vfiEl7lwWgOH/K;User;User;user@localhost;;true;en;system;system 6 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/app/admin/admin.route.ts: -------------------------------------------------------------------------------- 1 | import { Routes } from '@angular/router'; 2 | 3 | import { auditsRoute, configurationRoute, docsRoute, healthRoute, logsRoute, metricsRoute, userMgmtRoute } from './'; 4 | 5 | import { UserRouteAccessService } from 'app/core'; 6 | 7 | const ADMIN_ROUTES = [auditsRoute, configurationRoute, docsRoute, healthRoute, logsRoute, ...userMgmtRoute, metricsRoute]; 8 | 9 | export const adminState: Routes = [ 10 | { 11 | path: '', 12 | data: { 13 | authorities: ['ROLE_ADMIN'] 14 | }, 15 | canActivate: [UserRouteAccessService], 16 | children: ADMIN_ROUTES 17 | } 18 | ]; 19 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/app/core/index.ts: -------------------------------------------------------------------------------- 1 | export * from './auth/csrf.service'; 2 | export * from './auth/state-storage.service'; 3 | export * from './auth/account.service'; 4 | export * from './auth/auth-session.service'; 5 | export * from './language/language.helper'; 6 | export * from './language/language.constants'; 7 | export * from './user/account.model'; 8 | export * from './user/user.model'; 9 | export * from './auth/principal.service'; 10 | export * from './auth/user-route-access-service'; 11 | export * from './login/login-modal.service'; 12 | export * from './login/login.service'; 13 | export * from './user/user.service'; 14 | export * from './core.module'; 15 | -------------------------------------------------------------------------------- /Chapter07/taskmanagementsystem/src/main/kotlin/com/nilangpatel/tms/repository/RoleRepository.kt: -------------------------------------------------------------------------------- 1 | package com.nilangpatel.tms.repository 2 | 3 | import com.nilangpatel.tms.model.Role 4 | import org.springframework.data.jpa.repository.JpaRepository 5 | // import org.springframework.data.jpa.repository.Query 6 | 7 | interface RoleRepository : JpaRepository { 8 | 9 | 10 | fun findByRole(role:String):Role? 11 | 12 | /*@Query("select r.id, r.role from role r inner join user_role ur on r.id = ur.role_id inner join users u on u.id = ur.user_id where u.username = :username",nativeQuery = true) 13 | fun findRolesByUsername(username: String): Set?*/ 14 | } -------------------------------------------------------------------------------- /Chapter02/simple-reactor-demo/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | simple-reactor-demo 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.m2e.core.maven2Builder 15 | 16 | 17 | 18 | 19 | 20 | org.eclipse.jdt.core.javanature 21 | org.eclipse.m2e.core.maven2Nature 22 | 23 | 24 | -------------------------------------------------------------------------------- /Chapter02/simple-rx-java-demo/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | simple-rx-java-demo 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.m2e.core.maven2Builder 15 | 16 | 17 | 18 | 19 | 20 | org.eclipse.jdt.core.javanature 21 | org.eclipse.m2e.core.maven2Nature 22 | 23 | 24 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/java/com/nilangpatel/repository/PersistentTokenRepository.java: -------------------------------------------------------------------------------- 1 | package com.nilangpatel.repository; 2 | 3 | import com.nilangpatel.domain.PersistentToken; 4 | import com.nilangpatel.domain.User; 5 | import java.time.LocalDate; 6 | import org.springframework.data.jpa.repository.JpaRepository; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | * Spring Data JPA repository for the PersistentToken entity. 12 | */ 13 | public interface PersistentTokenRepository extends JpaRepository { 14 | 15 | List findByUser(User user); 16 | 17 | List findByTokenDateBefore(LocalDate localDate); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/app/account/account.route.ts: -------------------------------------------------------------------------------- 1 | import { Routes } from '@angular/router'; 2 | 3 | import { 4 | activateRoute, 5 | passwordRoute, 6 | passwordResetFinishRoute, 7 | passwordResetInitRoute, 8 | registerRoute, 9 | sessionsRoute, 10 | settingsRoute 11 | } from './'; 12 | 13 | const ACCOUNT_ROUTES = [ 14 | activateRoute, 15 | passwordRoute, 16 | passwordResetFinishRoute, 17 | passwordResetInitRoute, 18 | registerRoute, 19 | sessionsRoute, 20 | settingsRoute 21 | ]; 22 | 23 | export const accountState: Routes = [ 24 | { 25 | path: '', 26 | children: ACCOUNT_ROUTES 27 | } 28 | ]; 29 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/java/com/nilangpatel/web/rest/vm/KeyAndPasswordVM.java: -------------------------------------------------------------------------------- 1 | package com.nilangpatel.web.rest.vm; 2 | 3 | /** 4 | * View Model object for storing the user's key and password. 5 | */ 6 | public class KeyAndPasswordVM { 7 | 8 | private String key; 9 | 10 | private String newPassword; 11 | 12 | public String getKey() { 13 | return key; 14 | } 15 | 16 | public void setKey(String key) { 17 | this.key = key; 18 | } 19 | 20 | public String getNewPassword() { 21 | return newPassword; 22 | } 23 | 24 | public void setNewPassword(String newPassword) { 25 | this.newPassword = newPassword; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/java/com/nilangpatel/security/SpringSecurityAuditorAware.java: -------------------------------------------------------------------------------- 1 | package com.nilangpatel.security; 2 | 3 | import com.nilangpatel.config.Constants; 4 | 5 | import java.util.Optional; 6 | 7 | import org.springframework.data.domain.AuditorAware; 8 | import org.springframework.stereotype.Component; 9 | 10 | /** 11 | * Implementation of AuditorAware based on Spring Security. 12 | */ 13 | @Component 14 | public class SpringSecurityAuditorAware implements AuditorAware { 15 | 16 | @Override 17 | public Optional getCurrentAuditor() { 18 | return Optional.of(SecurityUtils.getCurrentUserLogin().orElse(Constants.SYSTEM_ACCOUNT)); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/app/account/password/password-strength-bar.scss: -------------------------------------------------------------------------------- 1 | /* ========================================================================== 2 | start Password strength bar style 3 | ========================================================================== */ 4 | ul#strength { 5 | display: inline; 6 | list-style: none; 7 | margin: 0; 8 | margin-left: 15px; 9 | padding: 0; 10 | vertical-align: 2px; 11 | } 12 | 13 | .point { 14 | background: #ddd; 15 | border-radius: 2px; 16 | display: inline-block; 17 | height: 5px; 18 | margin-right: 1px; 19 | width: 20px; 20 | &:last-child { 21 | margin: 0 !important; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/app/admin/user-management/user-management-detail.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, OnDestroy } from '@angular/core'; 2 | import { ActivatedRoute } from '@angular/router'; 3 | 4 | import { User } from 'app/core'; 5 | 6 | @Component({ 7 | selector: 'jhi-user-mgmt-detail', 8 | templateUrl: './user-management-detail.component.html' 9 | }) 10 | export class UserMgmtDetailComponent implements OnInit { 11 | user: User; 12 | 13 | constructor(private route: ActivatedRoute) {} 14 | 15 | ngOnInit() { 16 | this.route.data.subscribe(({ user }) => { 17 | this.user = user.body ? user.body : user; 18 | }); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/app/layouts/error/error.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 |
6 |
7 |

Error Page!

8 | 9 |
10 |
{{errorMessage}} 11 |
12 |
13 |
You are not authorized to access this page. 14 |
15 |
16 |
17 |
18 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/app/shared/model/country-language.model.ts: -------------------------------------------------------------------------------- 1 | export const enum TrueFalse { 2 | T = 'T', 3 | F = 'F' 4 | } 5 | 6 | export interface ICountryLanguage { 7 | id?: number; 8 | language?: string; 9 | isOfficial?: TrueFalse; 10 | percentage?: number; 11 | countryName?: string; 12 | countryId?: number; 13 | } 14 | 15 | export class CountryLanguage implements ICountryLanguage { 16 | constructor( 17 | public id?: number, 18 | public language?: string, 19 | public isOfficial?: TrueFalse, 20 | public percentage?: number, 21 | public countryName?: string, 22 | public countryId?: number 23 | ) {} 24 | } 25 | -------------------------------------------------------------------------------- /Chapter01/worldgdp/.settings/.jsdtscope: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /Chapter01/worldgdp/src/main/java/com/nilangpatel/worldgdp/WorldApplicationInitializer.java: -------------------------------------------------------------------------------- 1 | package com.nilangpatel.worldgdp; 2 | 3 | import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer; 4 | 5 | public class WorldApplicationInitializer extends 6 | AbstractAnnotationConfigDispatcherServletInitializer { 7 | 8 | @Override 9 | protected Class[] getRootConfigClasses() { 10 | return null; 11 | } 12 | 13 | @Override 14 | protected Class[] getServletConfigClasses() { 15 | return new Class[] {AppConfiguration.class}; 16 | } 17 | 18 | @Override 19 | protected String[] getServletMappings() { 20 | return new String[] { "/" }; 21 | } 22 | 23 | 24 | } -------------------------------------------------------------------------------- /Chapter02/simple-rx-java-demo/target/classes/META-INF/maven/rx-java/simple-rx-java-demo/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | rx-java 4 | simple-rx-java-demo 5 | 0.0.1-SNAPSHOT 6 | Simple RxJava demo 7 | 8 | 9 | io.reactivex.rxjava2 10 | rxjava 11 | 2.2.6 12 | 13 | 14 | -------------------------------------------------------------------------------- /Chapter07/KotlinBasics/src/com/nilangpatel/kotlin/function/extension/FunExtension.kt: -------------------------------------------------------------------------------- 1 | package com.nilangpatel.kotlin.function.extension 2 | 3 | fun main(args: Array) { 4 | //Un comment this to see Extension Function on String 5 | print("this is just for sample".camelCase()) 6 | print(3.square()) 7 | } 8 | 9 | fun String.camelCase():String{ 10 | var camelCaseStr = StringBuffer() 11 | var wordLst : List = this.trim().split(" ") 12 | 13 | for(word in wordLst){ 14 | camelCaseStr.append(word.replaceFirst(word[0], word[0].toUpperCase())).append(" ") 15 | } 16 | return camelCaseStr.trim().toString() 17 | } 18 | 19 | fun Int.square():Int{ 20 | return this * this 21 | } -------------------------------------------------------------------------------- /Chapter07/taskmanagementsystem/src/main/kotlin/com/nilangpatel/tms/constant/TaskMgmntConstant.kt: -------------------------------------------------------------------------------- 1 | package com.nilangpatel.tms.constant 2 | 3 | object TaskMgmntConstant { 4 | const val ROLE_USER :String = "ROLE_USER" 5 | const val ROLE_ADMIN :String = "ROLE_ADMIN" 6 | 7 | const val TITLE_HOME_PAGE: String = "Home" 8 | const val TITLE_LOGIN_PAGE: String = "Login" 9 | const val TITLE_LANDING_CONTROL_PAGE:String = "Control Page" 10 | const val TITLE_ADD_TASK_PAGE:String = "Add Task" 11 | const val TITLE_UPDATE_TASK_PAGE:String = "Update Task" 12 | const val PAGE_TITLE: String = "pageTitle" 13 | 14 | fun getRolesLst():List{ 15 | return listOf(ROLE_ADMIN, ROLE_USER) 16 | } 17 | } 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /Chapter02/simple-rx-java-demo/src/main/java/com/nilangpatel/rxjava/RxJavaBasics.java: -------------------------------------------------------------------------------- 1 | package com.nilangpatel.rxjava; 2 | 3 | import io.reactivex.Observable; 4 | 5 | public class RxJavaBasics { 6 | 7 | public static void main(String[] args) { 8 | 9 | /* Observable */ 10 | Observable adminUsers = 11 | Observable.just("Dave", 12 | "John", 13 | "Nilang", 14 | "Komal", 15 | "David"); 16 | 17 | /* Observer in form of lambda expression */ 18 | //adminUsers.subscribe(s -> System.out.println(s)); 19 | 20 | /* User map operator */ 21 | adminUsers.map(s->s.startsWith("D") ? s:"*******") 22 | .subscribe(s -> System.out.println(s)); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/test/javascript/spec/helpers/mock-state-storage.service.ts: -------------------------------------------------------------------------------- 1 | import { SpyObject } from './spyobject'; 2 | import { StateStorageService } from 'app/core/auth/state-storage.service'; 3 | import Spy = jasmine.Spy; 4 | 5 | export class MockStateStorageService extends SpyObject { 6 | getUrlSpy: Spy; 7 | storeUrlSpy: Spy; 8 | 9 | constructor() { 10 | super(StateStorageService); 11 | this.setUrlSpy({}); 12 | this.storeUrlSpy = this.spy('storeUrl').andReturn(this); 13 | } 14 | 15 | setUrlSpy(json) { 16 | this.getUrlSpy = this.spy('getUrl').andReturn(json); 17 | } 18 | 19 | setResponse(json: any): void { 20 | this.setUrlSpy(json); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Chapter07/taskmanagementsystem/src/main/resources/templates/users.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |
6 |
7 |
8 | 9 | 10 | userfull name 11 |
12 |
13 |
14 | 15 | -------------------------------------------------------------------------------- /Chapter01/worldgdp/src/main/java/com/nilangpatel/worldgdp/config/PropertiesWithJavaConfig.java: -------------------------------------------------------------------------------- 1 | package com.nilangpatel.worldgdp.config; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | import org.springframework.context.annotation.PropertySource; 6 | import org.springframework.context.support.PropertySourcesPlaceholderConfigurer; 7 | 8 | @Configuration 9 | @PropertySource("classpath:application.properties") 10 | public class PropertiesWithJavaConfig { 11 | 12 | @Bean 13 | public static PropertySourcesPlaceholderConfigurer 14 | propertySourcesPlaceholderConfigurer() { 15 | return new PropertySourcesPlaceholderConfigurer(); 16 | } 17 | } -------------------------------------------------------------------------------- /Chapter02/simple-reactor-demo/target/classes/META-INF/maven/reactor-demo/simple-reactor-demo/pom.xml: -------------------------------------------------------------------------------- 1 | 4 | 4.0.0 5 | reactor-demo 6 | simple-reactor-demo 7 | 0.0.1-SNAPSHOT 8 | Smiple Reactor Dmo 9 | 10 | 11 | io.projectreactor 12 | reactor-core 13 | 3.2.6.RELEASE 14 | 15 | 16 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/app/entities/city/city-detail.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { ActivatedRoute } from '@angular/router'; 3 | 4 | import { ICity } from 'app/shared/model/city.model'; 5 | 6 | @Component({ 7 | selector: 'jhi-city-detail', 8 | templateUrl: './city-detail.component.html' 9 | }) 10 | export class CityDetailComponent implements OnInit { 11 | city: ICity; 12 | 13 | constructor(private activatedRoute: ActivatedRoute) {} 14 | 15 | ngOnInit() { 16 | this.activatedRoute.data.subscribe(({ city }) => { 17 | this.city = city; 18 | }); 19 | } 20 | 21 | previousState() { 22 | window.history.back(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Chapter06/catalog-service/src/main/java/com/bookstore/catalog/CatalogServiceApplication.java: -------------------------------------------------------------------------------- 1 | package com.bookstore.catalog; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.cloud.client.discovery.EnableDiscoveryClient; 6 | import org.springframework.data.jpa.repository.config.EnableJpaRepositories; 7 | 8 | @SpringBootApplication 9 | @EnableDiscoveryClient 10 | @EnableJpaRepositories(basePackages="com.bookstore.catalog.repository") 11 | public class CatalogServiceApplication { 12 | 13 | public static void main(String[] args) { 14 | SpringApplication.run(CatalogServiceApplication.class, args); 15 | } 16 | 17 | } 18 | 19 | -------------------------------------------------------------------------------- /Chapter01/worldgdp/.settings/org.eclipse.wst.common.component: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/app/core/core.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule, LOCALE_ID } from '@angular/core'; 2 | import { DatePipe, registerLocaleData } from '@angular/common'; 3 | import { HttpClientModule } from '@angular/common/http'; 4 | import { Title } from '@angular/platform-browser'; 5 | import locale from '@angular/common/locales/en'; 6 | 7 | @NgModule({ 8 | imports: [HttpClientModule], 9 | exports: [], 10 | declarations: [], 11 | providers: [ 12 | Title, 13 | { 14 | provide: LOCALE_ID, 15 | useValue: 'en' 16 | }, 17 | DatePipe 18 | ] 19 | }) 20 | export class GdpCoreModule { 21 | constructor() { 22 | registerLocaleData(locale); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Chapter01/worldgdp/src/main/java/com/nilangpatel/worldgdp/dao/mapper/CityRowMapper.java: -------------------------------------------------------------------------------- 1 | package com.nilangpatel.worldgdp.dao.mapper; 2 | 3 | import java.sql.ResultSet; 4 | import java.sql.SQLException; 5 | 6 | import org.springframework.jdbc.core.RowMapper; 7 | 8 | import com.nilangpatel.worldgdp.model.City; 9 | 10 | public class CityRowMapper implements RowMapper{ 11 | 12 | public City mapRow(ResultSet rs, int rowNum) throws SQLException { 13 | City city = new City(); 14 | city.setCountryCode(rs.getString("country_code")); 15 | city.setDistrict(rs.getString("district")); 16 | city.setId(rs.getLong("id")); 17 | city.setName(rs.getString("name")); 18 | city.setPopulation(rs.getLong("population")); 19 | return city; 20 | 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /Chapter04/SpringLdapAndOAuth/src/main/java/com/nilangpatel/springauth/constants/LdapAuthConstant.java: -------------------------------------------------------------------------------- 1 | package com.nilangpatel.springauth.constants; 2 | 3 | public interface LdapAuthConstant { 4 | 5 | /* Page title constants */ 6 | String PAGE_TITLE = "pageTitle"; 7 | 8 | String TITLE_HOME_PAGE = "Home"; 9 | String TITLE_PRIVATE_PAGE = "Private"; 10 | String TITLE_LOGIN_PAGE = "Login"; 11 | String TITLE_USER_PAGE = "User"; 12 | String TITLE_ADMIN_PAGE = "Admin"; 13 | 14 | /* LDAP Auth structure constants */ 15 | String LDAP_USER_SEARCH ="ou=users"; 16 | String LDAP_GROUP_SEARCH = "ou=roles"; 17 | String LDAP_USER_DN_PATTERN= "uid={0},ou=users"; 18 | 19 | /* Roles */ 20 | String ROLE_USER = "ROLE_USER"; 21 | String ROLE_ADMIN = "ROLE_ADMIN"; 22 | } 23 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/test/javascript/spec/helpers/mock-account.service.ts: -------------------------------------------------------------------------------- 1 | import { SpyObject } from './spyobject'; 2 | import { AccountService } from 'app/core/auth/account.service'; 3 | import Spy = jasmine.Spy; 4 | 5 | export class MockAccountService extends SpyObject { 6 | getSpy: Spy; 7 | saveSpy: Spy; 8 | fakeResponse: any; 9 | 10 | constructor() { 11 | super(AccountService); 12 | 13 | this.fakeResponse = null; 14 | this.getSpy = this.spy('get').andReturn(this); 15 | this.saveSpy = this.spy('save').andReturn(this); 16 | } 17 | 18 | subscribe(callback: any) { 19 | callback(this.fakeResponse); 20 | } 21 | 22 | setResponse(json: any): void { 23 | this.fakeResponse = json; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Chapter05/gdp/src/main/webapp/app/entities/country/country-detail.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { ActivatedRoute } from '@angular/router'; 3 | 4 | import { ICountry } from 'app/shared/model/country.model'; 5 | 6 | @Component({ 7 | selector: 'jhi-country-detail', 8 | templateUrl: './country-detail.component.html' 9 | }) 10 | export class CountryDetailComponent implements OnInit { 11 | country: ICountry; 12 | 13 | constructor(private activatedRoute: ActivatedRoute) {} 14 | 15 | ngOnInit() { 16 | this.activatedRoute.data.subscribe(({ country }) => { 17 | this.country = country; 18 | }); 19 | } 20 | 21 | previousState() { 22 | window.history.back(); 23 | } 24 | } 25 | --------------------------------------------------------------------------------