├── SPELDemostation ├── .idea │ ├── .gitignore │ ├── vcs.xml │ ├── encodings.xml │ ├── compiler.xml │ ├── misc.xml │ ├── jarRepositories.xml │ └── workspace.xml ├── src │ ├── main │ │ └── java │ │ │ └── org │ │ │ └── example │ │ │ ├── AppConfig.java │ │ │ ├── App.java │ │ │ └── Alien.java │ └── test │ │ └── java │ │ └── org │ │ └── example │ │ └── AppTest.java └── pom.xml ├── SpringBootAssign1 ├── .idea │ ├── .gitignore │ ├── vcs.xml │ ├── encodings.xml │ ├── misc.xml │ ├── compiler.xml │ └── jarRepositories.xml ├── src │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── genspark │ │ │ └── SpringBootAssign1 │ │ │ └── SpringBootDemoAppApplicationTests.java │ └── main │ │ ├── java │ │ └── com │ │ │ └── genspark │ │ │ └── SpringBootAssign1 │ │ │ ├── Dao │ │ │ └── CourseDao.java │ │ │ ├── SpringBootAssign1Application.java │ │ │ ├── Service │ │ │ ├── CourseService.java │ │ │ ├── EmployeeService.java │ │ │ ├── CourseServiceImpl.java │ │ │ └── EmployeeServiceImpl.java │ │ │ ├── Entity │ │ │ ├── Employee.java │ │ │ └── Course.java │ │ │ └── Controller │ │ │ └── MyController.java │ │ └── resources │ │ └── application.properties ├── target │ └── classes │ │ └── application.properties ├── HELP.md ├── pom.xml ├── mvnw.cmd └── mvnw ├── MailSendAssignment ├── .idea │ ├── .gitignore │ ├── vcs.xml │ ├── encodings.xml │ ├── misc.xml │ ├── compiler.xml │ ├── jarRepositories.xml │ └── uiDesigner.xml ├── src │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── genspark │ │ │ │ └── MailSendAssignment │ │ │ │ ├── Service │ │ │ │ ├── EmailSenderService.java │ │ │ │ ├── CourseService.java │ │ │ │ ├── EmployeeService.java │ │ │ │ ├── EmailSenderServiceImpl.java │ │ │ │ ├── CourseServiceImpl.java │ │ │ │ └── EmployeeServiceImpl.java │ │ │ │ ├── Dao │ │ │ │ ├── EmployeeDao.java │ │ │ │ └── CourseDao.java │ │ │ │ ├── MailSendAssignmentApplication.java │ │ │ │ ├── Entity │ │ │ │ ├── Employee.java │ │ │ │ └── Course.java │ │ │ │ └── Controller │ │ │ │ └── MyController.java │ │ └── resources │ │ │ ├── application.properties │ │ │ └── hibernate.cfg.xml │ └── test │ │ └── java │ │ └── com │ │ └── genspark │ │ └── MailSendAssignment │ │ └── SpringBootDemoAppApplicationTests.java ├── target │ └── classes │ │ ├── application.properties │ │ └── hibernate.cfg.xml ├── HELP.md ├── pom.xml ├── mvnw.cmd └── mvnw ├── SpringBootImageGallery ├── .idea │ ├── .gitignore │ ├── vcs.xml │ ├── encodings.xml │ ├── misc.xml │ ├── compiler.xml │ └── jarRepositories.xml ├── src │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── genspark │ │ │ │ └── SpringBootAssign1 │ │ │ │ ├── Service │ │ │ │ ├── ImageService.java │ │ │ │ ├── CourseService.java │ │ │ │ ├── EmployeeService.java │ │ │ │ ├── ImageServiceImpl.java │ │ │ │ ├── CourseServiceImpl.java │ │ │ │ └── EmployeeServiceImpl.java │ │ │ │ ├── Dao │ │ │ │ ├── ImageDao.java │ │ │ │ └── CourseDao.java │ │ │ │ ├── SpringBootImageGalleryApplication.java │ │ │ │ ├── Entity │ │ │ │ ├── Image.java │ │ │ │ ├── Employee.java │ │ │ │ └── Course.java │ │ │ │ └── Controller │ │ │ │ ├── ImageController.java │ │ │ │ └── MyController.java │ │ └── resources │ │ │ └── application.properties │ └── test │ │ └── java │ │ └── com │ │ └── genspark │ │ └── SpringBootAssign1 │ │ └── SpringBootDemoAppApplicationTests.java ├── target │ └── classes │ │ └── application.properties ├── HELP.md ├── pom.xml ├── mvnw.cmd └── mvnw ├── SpringFrameworkAssignment2 └── SpringFrameworkAssignment2 │ ├── .idea │ ├── .gitignore │ ├── vcs.xml │ ├── encodings.xml │ ├── misc.xml │ ├── compiler.xml │ └── jarRepositories.xml │ ├── src │ ├── main │ │ ├── java │ │ │ └── org │ │ │ │ └── genspark │ │ │ │ ├── Phone.java │ │ │ │ ├── App.java │ │ │ │ ├── AppConfig.java │ │ │ │ ├── Student.java │ │ │ │ └── Address.java │ │ └── resources │ │ │ └── Spring.xml │ └── test │ │ └── java │ │ └── org │ │ └── genspark │ │ └── AppTest.java │ ├── target │ └── classes │ │ └── Spring.xml │ └── pom.xml ├── SpringFrameworkDemo1 ├── src │ ├── main │ │ ├── java │ │ │ └── org │ │ │ │ └── genspark │ │ │ │ ├── Vehicle.java │ │ │ │ ├── Bike.java │ │ │ │ ├── Car.java │ │ │ │ ├── App.java │ │ │ │ └── Tyre.java │ │ └── resources │ │ │ └── Spring.xml │ └── test │ │ └── java │ │ └── org │ │ └── genspark │ │ └── AppTest.java ├── target │ └── classes │ │ └── Spring.xml ├── .idea │ └── workspace.xml └── pom.xml ├── SpringFrameworkClass3 └── .idea │ ├── misc.xml │ ├── modules.xml │ ├── libraries │ ├── Maven__junit_junit_4_11.xml │ ├── Maven__aspectj_aspectjrt_1_5_3.xml │ ├── Maven__org_hamcrest_hamcrest_core_1_3.xml │ ├── Maven__org_aspectj_aspectjweaver_1_9_8.xml │ ├── Maven__org_springframework_spring_aop_5_3_18.xml │ ├── Maven__org_springframework_spring_jcl_5_3_18.xml │ ├── Maven__org_springframework_spring_core_5_3_18.xml │ ├── Maven__org_springframework_spring_beans_5_3_18.xml │ ├── Maven__org_springframework_spring_context_5_3_18.xml │ └── Maven__org_springframework_spring_expression_5_3_18.xml │ ├── SpringFrameworkClass3.iml │ └── workspace.xml ├── SpringFrameworkDemo2 ├── .idea │ ├── misc.xml │ ├── compiler.xml │ ├── modules.xml │ ├── libraries │ │ ├── Maven__junit_junit_4_11.xml │ │ ├── Maven__org_hamcrest_hamcrest_core_1_3.xml │ │ ├── Maven__org_springframework_spring_aop_5_3_13.xml │ │ ├── Maven__org_springframework_spring_jcl_5_3_13.xml │ │ ├── Maven__org_springframework_spring_core_5_3_13.xml │ │ ├── Maven__org_springframework_spring_beans_5_3_13.xml │ │ ├── Maven__org_springframework_spring_context_5_3_13.xml │ │ └── Maven__org_springframework_spring_expression_5_3_13.xml │ └── workspace.xml └── SpringFrameworkDemo2.iml ├── SpringFrameworkAssign1 ├── src │ ├── main │ │ ├── java │ │ │ └── org │ │ │ │ └── genspark │ │ │ │ ├── Phone.java │ │ │ │ ├── App.java │ │ │ │ ├── Address.java │ │ │ │ └── Student.java │ │ └── resources │ │ │ └── Spring.xml │ └── test │ │ └── java │ │ └── org │ │ └── genspark │ │ └── AppTest.java ├── target │ └── classes │ │ └── Spring.xml ├── .idea │ └── workspace.xml └── pom.xml └── .gitignore /SPELDemostation/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | -------------------------------------------------------------------------------- /SpringBootAssign1/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | -------------------------------------------------------------------------------- /MailSendAssignment/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | -------------------------------------------------------------------------------- /SpringBootImageGallery/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | -------------------------------------------------------------------------------- /SpringFrameworkAssignment2/SpringFrameworkAssignment2/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | -------------------------------------------------------------------------------- /SpringFrameworkDemo1/src/main/java/org/genspark/Vehicle.java: -------------------------------------------------------------------------------- 1 | package org.genspark; 2 | 3 | public interface Vehicle { 4 | 5 | void drive(); 6 | 7 | } 8 | -------------------------------------------------------------------------------- /SPELDemostation/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /MailSendAssignment/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /SpringBootAssign1/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /SpringBootAssign1/.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /SpringBootImageGallery/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /MailSendAssignment/.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /SpringBootImageGallery/.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /SpringFrameworkClass3/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /SpringFrameworkDemo2/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /SpringFrameworkAssignment2/SpringFrameworkAssignment2/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /MailSendAssignment/src/main/java/com/genspark/MailSendAssignment/Service/EmailSenderService.java: -------------------------------------------------------------------------------- 1 | package com.genspark.MailSendAssignment.Service; 2 | 3 | public interface EmailSenderService { 4 | 5 | void sendEmail(String toEmail, String subject, String body); 6 | 7 | } 8 | -------------------------------------------------------------------------------- /SpringFrameworkDemo2/.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /SPELDemostation/.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /SPELDemostation/src/main/java/org/example/AppConfig.java: -------------------------------------------------------------------------------- 1 | package org.example; 2 | 3 | import org.springframework.context.annotation.ComponentScan; 4 | import org.springframework.context.annotation.Configuration; 5 | 6 | @Configuration 7 | @ComponentScan(basePackages = "org.example") 8 | public class AppConfig { 9 | } 10 | -------------------------------------------------------------------------------- /SpringBootImageGallery/src/main/java/com/genspark/SpringBootAssign1/Service/ImageService.java: -------------------------------------------------------------------------------- 1 | package com.genspark.SpringBootAssign1.Service; 2 | 3 | import org.springframework.web.multipart.MultipartFile; 4 | 5 | public interface ImageService { 6 | 7 | void saveImageFile(int imageId, MultipartFile file); 8 | 9 | } 10 | -------------------------------------------------------------------------------- /SpringFrameworkAssign1/src/main/java/org/genspark/Phone.java: -------------------------------------------------------------------------------- 1 | package org.genspark; 2 | 3 | public class Phone { 4 | 5 | private String mob; 6 | 7 | public String getMob() { 8 | return mob; 9 | } 10 | 11 | public void setMob(String mob) { 12 | this.mob = mob; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /SpringFrameworkDemo2/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /MailSendAssignment/src/main/java/com/genspark/MailSendAssignment/Dao/EmployeeDao.java: -------------------------------------------------------------------------------- 1 | package com.genspark.MailSendAssignment.Dao; 2 | 3 | import com.genspark.MailSendAssignment.Entity.Employee; 4 | import org.springframework.data.jpa.repository.JpaRepository; 5 | 6 | public interface EmployeeDao extends JpaRepository { 7 | } 8 | -------------------------------------------------------------------------------- /SpringFrameworkAssignment2/SpringFrameworkAssignment2/.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /SpringFrameworkClass3/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /SpringFrameworkDemo1/src/main/java/org/genspark/Bike.java: -------------------------------------------------------------------------------- 1 | package org.genspark; 2 | 3 | public class Bike implements Vehicle{ 4 | 5 | public Tyre ty; 6 | 7 | public Bike(Tyre ty) { 8 | this.ty = ty; 9 | } 10 | 11 | public void drive(){ 12 | 13 | System.out.println("Driving bike.."+ty); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /SpringBootImageGallery/src/main/java/com/genspark/SpringBootAssign1/Dao/ImageDao.java: -------------------------------------------------------------------------------- 1 | package com.genspark.SpringBootAssign1.Dao; 2 | 3 | import com.genspark.SpringBootAssign1.Entity.Course; 4 | import com.genspark.SpringBootAssign1.Entity.Image; 5 | import org.springframework.data.jpa.repository.JpaRepository; 6 | 7 | public interface ImageDao extends JpaRepository { 8 | } 9 | -------------------------------------------------------------------------------- /MailSendAssignment/src/test/java/com/genspark/MailSendAssignment/SpringBootDemoAppApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.genspark.MailSendAssignment; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SpringBootDemoAppApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /SpringBootAssign1/src/test/java/com/genspark/SpringBootAssign1/SpringBootDemoAppApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.genspark.SpringBootAssign1; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SpringBootDemoAppApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /SpringFrameworkAssignment2/SpringFrameworkAssignment2/src/main/java/org/genspark/Phone.java: -------------------------------------------------------------------------------- 1 | package org.genspark; 2 | 3 | import org.springframework.stereotype.Component; 4 | 5 | public class Phone { 6 | private String mob; 7 | public String getMob() { 8 | return mob; 9 | } 10 | public void setMob(String mob) { 11 | this.mob = mob; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /SpringBootImageGallery/src/test/java/com/genspark/SpringBootAssign1/SpringBootDemoAppApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.genspark.SpringBootAssign1; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SpringBootDemoAppApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /SpringBootAssign1/src/main/java/com/genspark/SpringBootAssign1/Dao/CourseDao.java: -------------------------------------------------------------------------------- 1 | package com.genspark.SpringBootAssign1.Dao; 2 | 3 | import com.genspark.SpringBootAssign1.Entity.Course; 4 | import org.springframework.data.jpa.repository.JpaRepository; 5 | import org.springframework.stereotype.Repository; 6 | 7 | @Repository 8 | public interface CourseDao extends JpaRepository { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /MailSendAssignment/src/main/java/com/genspark/MailSendAssignment/Dao/CourseDao.java: -------------------------------------------------------------------------------- 1 | package com.genspark.MailSendAssignment.Dao; 2 | 3 | import com.genspark.MailSendAssignment.Entity.Course; 4 | import org.springframework.data.jpa.repository.JpaRepository; 5 | import org.springframework.stereotype.Repository; 6 | 7 | @Repository 8 | public interface CourseDao extends JpaRepository { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /SpringBootImageGallery/src/main/java/com/genspark/SpringBootAssign1/Dao/CourseDao.java: -------------------------------------------------------------------------------- 1 | package com.genspark.SpringBootAssign1.Dao; 2 | 3 | import com.genspark.SpringBootAssign1.Entity.Course; 4 | import org.springframework.data.jpa.repository.JpaRepository; 5 | import org.springframework.stereotype.Repository; 6 | 7 | @Repository 8 | public interface CourseDao extends JpaRepository { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /SPELDemostation/src/test/java/org/example/AppTest.java: -------------------------------------------------------------------------------- 1 | package org.example; 2 | 3 | import static org.junit.Assert.assertTrue; 4 | 5 | import org.junit.Test; 6 | 7 | /** 8 | * Unit test for simple App. 9 | */ 10 | public class AppTest 11 | { 12 | /** 13 | * Rigorous Test :-) 14 | */ 15 | @Test 16 | public void shouldAnswerWithTrue() 17 | { 18 | assertTrue( true ); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /SpringFrameworkAssign1/src/test/java/org/genspark/AppTest.java: -------------------------------------------------------------------------------- 1 | package org.genspark; 2 | 3 | import static org.junit.Assert.assertTrue; 4 | 5 | import org.junit.Test; 6 | 7 | /** 8 | * Unit test for simple App. 9 | */ 10 | public class AppTest 11 | { 12 | /** 13 | * Rigorous Test :-) 14 | */ 15 | @Test 16 | public void shouldAnswerWithTrue() 17 | { 18 | assertTrue( true ); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /SpringFrameworkDemo1/src/test/java/org/genspark/AppTest.java: -------------------------------------------------------------------------------- 1 | package org.genspark; 2 | 3 | import static org.junit.Assert.assertTrue; 4 | 5 | import org.junit.Test; 6 | 7 | /** 8 | * Unit test for simple App. 9 | */ 10 | public class AppTest 11 | { 12 | /** 13 | * Rigorous Test :-) 14 | */ 15 | @Test 16 | public void shouldAnswerWithTrue() 17 | { 18 | assertTrue( true ); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /SpringFrameworkAssignment2/SpringFrameworkAssignment2/src/test/java/org/genspark/AppTest.java: -------------------------------------------------------------------------------- 1 | package org.genspark; 2 | 3 | import static org.junit.Assert.assertTrue; 4 | 5 | import org.junit.Test; 6 | 7 | /** 8 | * Unit test for simple App. 9 | */ 10 | public class AppTest 11 | { 12 | /** 13 | * Rigorous Test :-) 14 | */ 15 | @Test 16 | public void shouldAnswerWithTrue() 17 | { 18 | assertTrue( true ); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /SpringBootAssign1/src/main/java/com/genspark/SpringBootAssign1/SpringBootAssign1Application.java: -------------------------------------------------------------------------------- 1 | package com.genspark.SpringBootAssign1; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringBootAssign1Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringBootAssign1Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /SpringBootAssign1/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | server.port=9080 3 | 4 | #MySQL Configuration 5 | spring.datasource.url=jdbc:mysql://localhost:3306/mygensparkdemo 6 | spring.datasource.username=root 7 | spring.datasource.password=win-vm 8 | spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver 9 | 10 | #Hibernate config 11 | spring.jpa.hibernate.ddl-auto=update 12 | spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL8Dialect 13 | spring.jpa.show-sql=true -------------------------------------------------------------------------------- /SpringBootAssign1/target/classes/application.properties: -------------------------------------------------------------------------------- 1 | 2 | server.port=9080 3 | 4 | #MySQL Configuration 5 | spring.datasource.url=jdbc:mysql://localhost:3306/mygensparkdemo 6 | spring.datasource.username=root 7 | spring.datasource.password=win-vm 8 | spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver 9 | 10 | #Hibernate config 11 | spring.jpa.hibernate.ddl-auto=update 12 | spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL8Dialect 13 | spring.jpa.show-sql=true -------------------------------------------------------------------------------- /MailSendAssignment/src/main/java/com/genspark/MailSendAssignment/MailSendAssignmentApplication.java: -------------------------------------------------------------------------------- 1 | package com.genspark.MailSendAssignment; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class MailSendAssignmentApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(MailSendAssignmentApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /SpringBootImageGallery/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | server.port=9080 3 | 4 | #MySQL Configuration 5 | spring.datasource.url=jdbc:mysql://localhost:3306/mygensparkdemo 6 | spring.datasource.username=root 7 | spring.datasource.password=win-vm 8 | spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver 9 | 10 | #Hibernate config 11 | spring.jpa.hibernate.ddl-auto=update 12 | spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL8Dialect 13 | spring.jpa.show-sql=true -------------------------------------------------------------------------------- /SpringBootImageGallery/target/classes/application.properties: -------------------------------------------------------------------------------- 1 | 2 | server.port=9080 3 | 4 | #MySQL Configuration 5 | spring.datasource.url=jdbc:mysql://localhost:3306/mygensparkdemo 6 | spring.datasource.username=root 7 | spring.datasource.password=win-vm 8 | spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver 9 | 10 | #Hibernate config 11 | spring.jpa.hibernate.ddl-auto=update 12 | spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL8Dialect 13 | spring.jpa.show-sql=true -------------------------------------------------------------------------------- /MailSendAssignment/src/main/java/com/genspark/MailSendAssignment/Service/CourseService.java: -------------------------------------------------------------------------------- 1 | package com.genspark.MailSendAssignment.Service; 2 | 3 | import com.genspark.MailSendAssignment.Entity.Course; 4 | 5 | import java.util.List; 6 | 7 | public interface CourseService { 8 | 9 | List getAllCourses(); 10 | Course getByCourseId(int id); 11 | Course addCourse(Course course); 12 | Course updateCourse(Course course); 13 | String deleteCourse(int courseId); 14 | 15 | } 16 | -------------------------------------------------------------------------------- /SpringBootImageGallery/src/main/java/com/genspark/SpringBootAssign1/Service/CourseService.java: -------------------------------------------------------------------------------- 1 | package com.genspark.SpringBootAssign1.Service; 2 | 3 | import com.genspark.SpringBootAssign1.Entity.Course; 4 | 5 | import java.util.List; 6 | 7 | public interface CourseService { 8 | 9 | List getAllCourses(); 10 | Course getByCourseId(int id); 11 | Course addCourse(Course course); 12 | Course updateCourse(Course course); 13 | String deleteCourse(int courseId); 14 | 15 | } 16 | -------------------------------------------------------------------------------- /SpringBootAssign1/src/main/java/com/genspark/SpringBootAssign1/Service/CourseService.java: -------------------------------------------------------------------------------- 1 | package com.genspark.SpringBootAssign1.Service; 2 | 3 | import com.genspark.SpringBootAssign1.Entity.Course; 4 | 5 | import java.util.List; 6 | 7 | public interface CourseService { 8 | 9 | List getAllCourses(); 10 | Course getByCourseId(int id); 11 | Course addCourse(Course course); 12 | Course updateCourse(Course course); 13 | String deleteCourse(int courseId); 14 | 15 | } 16 | -------------------------------------------------------------------------------- /SpringBootImageGallery/src/main/java/com/genspark/SpringBootAssign1/SpringBootImageGalleryApplication.java: -------------------------------------------------------------------------------- 1 | package com.genspark.SpringBootAssign1; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringBootImageGalleryApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringBootImageGalleryApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /MailSendAssignment/src/main/java/com/genspark/MailSendAssignment/Service/EmployeeService.java: -------------------------------------------------------------------------------- 1 | package com.genspark.MailSendAssignment.Service; 2 | 3 | import com.genspark.MailSendAssignment.Entity.Employee; 4 | 5 | import java.util.List; 6 | 7 | public interface EmployeeService { 8 | 9 | 10 | List getAllEmployees(); 11 | Employee getByEmployeeId(int id); 12 | Employee addEmployee(Employee employee); 13 | Employee updateEmployee(Employee employee); 14 | String deleteEmployee(int employeeId); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /SpringBootAssign1/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /MailSendAssignment/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /SpringBootImageGallery/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /SpringBootImageGallery/src/main/java/com/genspark/SpringBootAssign1/Service/EmployeeService.java: -------------------------------------------------------------------------------- 1 | package com.genspark.SpringBootAssign1.Service; 2 | 3 | import com.genspark.SpringBootAssign1.Entity.Employee; 4 | 5 | import java.util.List; 6 | 7 | public interface EmployeeService { 8 | 9 | 10 | List getAllEmployees(); 11 | Employee getByEmployeeId(int id); 12 | Employee addEmployee(Employee employee); 13 | Employee updateEmployee(Employee employee); 14 | Employee deleteEmployee(int employeeId); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /SpringFrameworkDemo2/.idea/libraries/Maven__junit_junit_4_11.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /SpringFrameworkClass3/.idea/libraries/Maven__junit_junit_4_11.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /SpringBootAssign1/src/main/java/com/genspark/SpringBootAssign1/Service/EmployeeService.java: -------------------------------------------------------------------------------- 1 | package com.genspark.SpringBootAssign1.Service; 2 | 3 | import com.genspark.SpringBootAssign1.Entity.Employee; 4 | 5 | import java.util.List; 6 | 7 | public interface EmployeeService { 8 | 9 | 10 | List getAllEmployees(); 11 | Employee getByEmployeeId(int id); 12 | Employee addEmployee(Employee employee); 13 | Employee updateEmployee(Employee employee); 14 | Employee deleteEmployee(int employeeId); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /SPELDemostation/src/main/java/org/example/App.java: -------------------------------------------------------------------------------- 1 | package org.example; 2 | 3 | import org.springframework.context.ApplicationContext; 4 | import org.springframework.context.annotation.AnnotationConfigApplicationContext; 5 | 6 | /** 7 | * Hello world! 8 | * 9 | */ 10 | public class App 11 | { 12 | public static void main( String[] args ) 13 | { 14 | ApplicationContext context = new AnnotationConfigApplicationContext(AppConfig.class); 15 | Alien obj = (Alien) context.getBean(Alien.class); 16 | System.out.println(obj); 17 | 18 | 19 | 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /SpringFrameworkAssign1/src/main/java/org/genspark/App.java: -------------------------------------------------------------------------------- 1 | package org.genspark; 2 | 3 | import org.springframework.context.ApplicationContext; 4 | import org.springframework.context.support.ClassPathXmlApplicationContext; 5 | 6 | /** 7 | * Hello world! 8 | * 9 | */ 10 | public class App 11 | { 12 | public static void main( String[] args ) 13 | { 14 | ApplicationContext context = new ClassPathXmlApplicationContext("Spring.xml"); 15 | Object obj = (Object) context.getBean("Student"); 16 | System.out.println(obj.toString()); 17 | 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /SpringFrameworkClass3/.idea/libraries/Maven__aspectj_aspectjrt_1_5_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /SPELDemostation/.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /SpringFrameworkDemo1/src/main/java/org/genspark/Car.java: -------------------------------------------------------------------------------- 1 | package org.genspark; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | 5 | public class Car implements Vehicle { 6 | 7 | @Autowired 8 | public Tyre ty; 9 | 10 | public Car(Tyre ty){ 11 | this.ty = ty; 12 | } 13 | 14 | // public Tyre getTy() { 15 | // return ty; 16 | // } 17 | // 18 | // public void setTy(Tyre ty) { 19 | // this.ty = ty; 20 | // } 21 | 22 | public void drive() 23 | { 24 | System.out.println("Driving car..." + ty); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /SpringFrameworkClass3/.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /SpringFrameworkDemo2/.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /SpringFrameworkAssignment2/SpringFrameworkAssignment2/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /SpringFrameworkClass3/.idea/libraries/Maven__org_aspectj_aspectjweaver_1_9_8.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /SpringFrameworkDemo1/src/main/java/org/genspark/App.java: -------------------------------------------------------------------------------- 1 | package org.genspark; 2 | 3 | import org.springframework.beans.factory.BeanFactory; 4 | import org.springframework.context.ApplicationContext; 5 | import org.springframework.context.support.ClassPathXmlApplicationContext; 6 | 7 | /** 8 | * Hello world! 9 | * 10 | */ 11 | public class App 12 | { 13 | public static void main( String[] args ) 14 | { 15 | ApplicationContext context = new ClassPathXmlApplicationContext("Spring.xml"); 16 | 17 | Vehicle obj = (Vehicle) context.getBean("Vehicle"); 18 | obj.drive(); 19 | 20 | 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /SpringFrameworkAssignment2/SpringFrameworkAssignment2/.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /SpringFrameworkClass3/.idea/libraries/Maven__org_springframework_spring_aop_5_3_18.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /SpringFrameworkClass3/.idea/libraries/Maven__org_springframework_spring_jcl_5_3_18.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /SpringFrameworkDemo2/.idea/libraries/Maven__org_springframework_spring_aop_5_3_13.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /SpringFrameworkDemo2/.idea/libraries/Maven__org_springframework_spring_jcl_5_3_13.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /SpringFrameworkClass3/.idea/libraries/Maven__org_springframework_spring_core_5_3_18.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /SpringFrameworkDemo2/.idea/libraries/Maven__org_springframework_spring_core_5_3_13.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /SpringFrameworkClass3/.idea/libraries/Maven__org_springframework_spring_beans_5_3_18.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /SpringFrameworkDemo2/.idea/libraries/Maven__org_springframework_spring_beans_5_3_13.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /SpringBootImageGallery/src/main/java/com/genspark/SpringBootAssign1/Entity/Image.java: -------------------------------------------------------------------------------- 1 | package com.genspark.SpringBootAssign1.Entity; 2 | 3 | 4 | import javax.persistence.Entity; 5 | import javax.persistence.Lob; 6 | 7 | @Entity 8 | public class Image { 9 | 10 | private int imageId; 11 | @Lob 12 | private Byte[] bytes; 13 | 14 | public int getImageId() { 15 | return imageId; 16 | } 17 | 18 | public void setImageId(int imageId) { 19 | this.imageId = imageId; 20 | } 21 | 22 | public Byte[] getBytes() { 23 | return bytes; 24 | } 25 | 26 | public void setBytes(Byte[] bytes) { 27 | this.bytes = bytes; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /SPELDemostation/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 10 | 11 | 12 | 13 | 14 | 15 | 17 | -------------------------------------------------------------------------------- /SpringFrameworkClass3/.idea/libraries/Maven__org_springframework_spring_context_5_3_18.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /SpringFrameworkDemo2/.idea/libraries/Maven__org_springframework_spring_context_5_3_13.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /SpringFrameworkClass3/.idea/libraries/Maven__org_springframework_spring_expression_5_3_18.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /SpringFrameworkDemo2/.idea/libraries/Maven__org_springframework_spring_expression_5_3_13.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /MailSendAssignment/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port=9080 2 | 3 | #MySQL Configuration 4 | spring.datasource.url=jdbc:mysql://localhost:3306/mailsenddemo 5 | spring.datasource.username=root 6 | spring.datasource.password=win-vm 7 | spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver 8 | 9 | #Hibernate config 10 | spring.jpa.hibernate.ddl-auto=update 11 | spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL8Dialect 12 | spring.jpa.show-sql=true 13 | 14 | #Mail config 15 | spring.mail.host=smtp.gmail.com 16 | spring.mail.port=587 17 | spring.mail.username=amdalr@gmail.com 18 | spring.mail.password= 19 | spring.mail.properties.mail.smtp.auth=true 20 | spring.mail.properties.mail.smtp.starttls.enable=true 21 | 22 | -------------------------------------------------------------------------------- /MailSendAssignment/target/classes/application.properties: -------------------------------------------------------------------------------- 1 | server.port=9080 2 | 3 | #MySQL Configuration 4 | spring.datasource.url=jdbc:mysql://localhost:3306/mailsenddemo 5 | spring.datasource.username=root 6 | spring.datasource.password=win-vm 7 | spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver 8 | 9 | #Hibernate config 10 | spring.jpa.hibernate.ddl-auto=update 11 | spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL8Dialect 12 | spring.jpa.show-sql=true 13 | 14 | #Mail config 15 | spring.mail.host=smtp.gmail.com 16 | spring.mail.port=587 17 | spring.mail.username=amdalr@gmail.com 18 | spring.mail.password=dwntbkzcserdymzc 19 | spring.mail.properties.mail.smtp.auth=true 20 | spring.mail.properties.mail.smtp.starttls.enable=true 21 | 22 | -------------------------------------------------------------------------------- /SpringFrameworkAssignment2/SpringFrameworkAssignment2/src/main/java/org/genspark/App.java: -------------------------------------------------------------------------------- 1 | package org.genspark; 2 | 3 | import org.springframework.context.ApplicationContext; 4 | import org.springframework.context.annotation.AnnotationConfigApplicationContext; 5 | import org.springframework.context.support.AbstractApplicationContext; 6 | import org.springframework.context.support.ClassPathXmlApplicationContext; 7 | 8 | /** 9 | * Hello world! 10 | * 11 | */ 12 | public class App 13 | { 14 | public static void main( String[] args ) 15 | { 16 | AbstractApplicationContext context = new AnnotationConfigApplicationContext(AppConfig.class); 17 | Student obj = (Student) context.getBean(Student.class); 18 | System.out.println(obj.toString()); 19 | 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /SpringBootAssign1/.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 17 | 18 | -------------------------------------------------------------------------------- /SpringFrameworkAssign1/src/main/java/org/genspark/Address.java: -------------------------------------------------------------------------------- 1 | package org.genspark; 2 | 3 | public class Address { 4 | private String city; 5 | private String state; 6 | private String country; 7 | private String zipcode; 8 | 9 | public Address(String city, String state, String country, String zipcode) { 10 | this.city = city; 11 | this.state = state; 12 | this.country = country; 13 | this.zipcode = zipcode; 14 | } 15 | 16 | @Override 17 | public String toString() { 18 | return "Address{" + 19 | "city='" + city + '\'' + 20 | ", state='" + state + '\'' + 21 | ", country='" + country + '\'' + 22 | ", zipcode='" + zipcode + '\'' + 23 | '}'; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /MailSendAssignment/.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 19 | 20 | -------------------------------------------------------------------------------- /SpringBootImageGallery/.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 19 | 20 | -------------------------------------------------------------------------------- /SpringFrameworkDemo1/src/main/java/org/genspark/Tyre.java: -------------------------------------------------------------------------------- 1 | package org.genspark; 2 | 3 | public class Tyre { 4 | 5 | public String brand; 6 | public int size; 7 | 8 | public Tyre() { 9 | } 10 | public Tyre(String brand, int size) { 11 | this.brand = brand; 12 | this.size = size; 13 | } 14 | 15 | // public String getBrand() { 16 | // return brand; 17 | // } 18 | // 19 | // public void setBrand(String brand) { 20 | // this.brand = brand; 21 | // } 22 | // 23 | // public int getSize() { 24 | // return size; 25 | // } 26 | // 27 | // public void setSize(int size) { 28 | // this.size = size; 29 | // } 30 | 31 | @Override 32 | public String toString() { 33 | return "Tyre{" + 34 | "brand='" + brand + '\'' + 35 | ", size=" + size + 36 | '}'; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /SPELDemostation/.idea/jarRepositories.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | 10 | 14 | 15 | 19 | 20 | -------------------------------------------------------------------------------- /MailSendAssignment/.idea/jarRepositories.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | 10 | 14 | 15 | 19 | 20 | -------------------------------------------------------------------------------- /SpringBootAssign1/.idea/jarRepositories.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | 10 | 14 | 15 | 19 | 20 | -------------------------------------------------------------------------------- /SpringBootImageGallery/.idea/jarRepositories.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | 10 | 14 | 15 | 19 | 20 | -------------------------------------------------------------------------------- /MailSendAssignment/HELP.md: -------------------------------------------------------------------------------- 1 | # Getting Started 2 | 3 | ### Reference Documentation 4 | For further reference, please consider the following sections: 5 | 6 | * [Official Apache Maven documentation](https://maven.apache.org/guides/index.html) 7 | * [Spring Boot Maven Plugin Reference Guide](https://docs.spring.io/spring-boot/docs/2.6.6/maven-plugin/reference/html/) 8 | * [Create an OCI image](https://docs.spring.io/spring-boot/docs/2.6.6/maven-plugin/reference/html/#build-image) 9 | * [Spring Web](https://docs.spring.io/spring-boot/docs/2.6.6/reference/htmlsingle/#boot-features-developing-web-applications) 10 | 11 | ### Guides 12 | The following guides illustrate how to use some features concretely: 13 | 14 | * [Building a RESTful Web Service](https://spring.io/guides/gs/rest-service/) 15 | * [Serving Web Content with Spring MVC](https://spring.io/guides/gs/serving-web-content/) 16 | * [Building REST services with Spring](https://spring.io/guides/tutorials/bookmarks/) 17 | 18 | -------------------------------------------------------------------------------- /SpringBootAssign1/HELP.md: -------------------------------------------------------------------------------- 1 | # Getting Started 2 | 3 | ### Reference Documentation 4 | For further reference, please consider the following sections: 5 | 6 | * [Official Apache Maven documentation](https://maven.apache.org/guides/index.html) 7 | * [Spring Boot Maven Plugin Reference Guide](https://docs.spring.io/spring-boot/docs/2.6.6/maven-plugin/reference/html/) 8 | * [Create an OCI image](https://docs.spring.io/spring-boot/docs/2.6.6/maven-plugin/reference/html/#build-image) 9 | * [Spring Web](https://docs.spring.io/spring-boot/docs/2.6.6/reference/htmlsingle/#boot-features-developing-web-applications) 10 | 11 | ### Guides 12 | The following guides illustrate how to use some features concretely: 13 | 14 | * [Building a RESTful Web Service](https://spring.io/guides/gs/rest-service/) 15 | * [Serving Web Content with Spring MVC](https://spring.io/guides/gs/serving-web-content/) 16 | * [Building REST services with Spring](https://spring.io/guides/tutorials/bookmarks/) 17 | 18 | -------------------------------------------------------------------------------- /SpringBootImageGallery/HELP.md: -------------------------------------------------------------------------------- 1 | # Getting Started 2 | 3 | ### Reference Documentation 4 | For further reference, please consider the following sections: 5 | 6 | * [Official Apache Maven documentation](https://maven.apache.org/guides/index.html) 7 | * [Spring Boot Maven Plugin Reference Guide](https://docs.spring.io/spring-boot/docs/2.6.6/maven-plugin/reference/html/) 8 | * [Create an OCI image](https://docs.spring.io/spring-boot/docs/2.6.6/maven-plugin/reference/html/#build-image) 9 | * [Spring Web](https://docs.spring.io/spring-boot/docs/2.6.6/reference/htmlsingle/#boot-features-developing-web-applications) 10 | 11 | ### Guides 12 | The following guides illustrate how to use some features concretely: 13 | 14 | * [Building a RESTful Web Service](https://spring.io/guides/gs/rest-service/) 15 | * [Serving Web Content with Spring MVC](https://spring.io/guides/gs/serving-web-content/) 16 | * [Building REST services with Spring](https://spring.io/guides/tutorials/bookmarks/) 17 | 18 | -------------------------------------------------------------------------------- /MailSendAssignment/src/main/java/com/genspark/MailSendAssignment/Service/EmailSenderServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.genspark.MailSendAssignment.Service; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.mail.SimpleMailMessage; 5 | import org.springframework.mail.javamail.JavaMailSender; 6 | import org.springframework.stereotype.Service; 7 | 8 | @Service 9 | public class EmailSenderServiceImpl implements EmailSenderService{ 10 | 11 | @Autowired 12 | private JavaMailSender javaMailSender; 13 | 14 | public void sendEmail(String toEmail, String subject, String body) 15 | { 16 | SimpleMailMessage message = new SimpleMailMessage(); 17 | message.setFrom("amdalr@gmail.com"); 18 | message.setTo(toEmail); 19 | message.setSubject(subject); 20 | message.setText(body); 21 | javaMailSender.send(message); 22 | System.out.println("Mail Sent Successfully"); 23 | 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /SpringFrameworkAssignment2/SpringFrameworkAssignment2/.idea/jarRepositories.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | 10 | 14 | 15 | 19 | 20 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | SpringBootAssign1/target/classes/com/genspark/SpringBootAssign1/Controller/MyController.class 3 | 4 | SpringBootAssign1/target/classes/com/genspark/SpringBootAssign1/Dao/CourseDao.class 5 | 6 | SpringBootAssign1/target/classes/com/genspark/SpringBootAssign1/Entity/Course.class 7 | 8 | SpringBootAssign1/target/classes/com/genspark/SpringBootAssign1/Entity/Employee.class 9 | 10 | SpringBootAssign1/target/classes/com/genspark/SpringBootAssign1/Service/CourseService.class 11 | 12 | SpringBootAssign1/target/classes/com/genspark/SpringBootAssign1/Service/CourseServiceImpl.class 13 | 14 | SpringBootAssign1/target/classes/com/genspark/SpringBootAssign1/Service/EmployeeService.class 15 | 16 | SpringBootAssign1/target/classes/com/genspark/SpringBootAssign1/Service/EmployeeServiceImpl.class 17 | 18 | SpringBootAssign1/target/classes/com/genspark/SpringBootAssign1/SpringBootAssign1Application.class 19 | 20 | SpringBootAssign1/target/test-classes/com/genspark/SpringBootAssign1/SpringBootDemoAppApplicationTests.class 21 | 22 | *.class 23 | -------------------------------------------------------------------------------- /SpringFrameworkDemo1/src/main/resources/Spring.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /SpringFrameworkDemo1/target/classes/Spring.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /MailSendAssignment/src/main/resources/hibernate.cfg.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | com.mysql.cj.jdbc.Driver 8 | jdbc:mysql://localhost:3306/myprojectdemp 9 | root 10 | praMoma@302 11 | org.hibernate.dialect.MySQL8Dialect 12 | update 13 | true 14 | true 15 | 3 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /MailSendAssignment/target/classes/hibernate.cfg.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | com.mysql.cj.jdbc.Driver 8 | jdbc:mysql://localhost:3306/myprojectdemp 9 | root 10 | praMoma@302 11 | org.hibernate.dialect.MySQL8Dialect 12 | update 13 | true 14 | true 15 | 3 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /SpringFrameworkAssign1/src/main/java/org/genspark/Student.java: -------------------------------------------------------------------------------- 1 | package org.genspark; 2 | 3 | import java.util.List; 4 | 5 | public class Student { 6 | 7 | public int getId() { 8 | return id; 9 | } 10 | 11 | public void setId(int id) { 12 | this.id = id; 13 | } 14 | 15 | public String getName() { 16 | return name; 17 | } 18 | 19 | public void setName(String name) { 20 | this.name = name; 21 | } 22 | 23 | public List getPh() { 24 | return ph; 25 | } 26 | 27 | public void setPh(List ph) { 28 | this.ph = ph; 29 | } 30 | 31 | public Address getAdd() { 32 | return add; 33 | } 34 | 35 | public void setAdd(Address add) { 36 | this.add = add; 37 | } 38 | 39 | private int id; 40 | private String name; 41 | private List ph; 42 | private Address add; 43 | 44 | @Override 45 | public String toString() { 46 | return "Student{" + 47 | "id=" + id + 48 | ", name='" + name + '\'' + 49 | ", ph=" + ph + 50 | ", add=" + add + 51 | '}'; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /SpringBootImageGallery/src/main/java/com/genspark/SpringBootAssign1/Service/ImageServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.genspark.SpringBootAssign1.Service; 2 | 3 | import com.genspark.SpringBootAssign1.Dao.ImageDao; 4 | import com.genspark.SpringBootAssign1.Entity.Image; 5 | import org.springframework.transaction.annotation.Transactional; 6 | import org.springframework.web.multipart.MultipartFile; 7 | 8 | import java.io.IOException; 9 | 10 | public class ImageServiceImpl implements ImageService{ 11 | 12 | 13 | private final ImageDao imageDao; 14 | 15 | public ImageServiceImpl( ImageDao imageDao) { 16 | 17 | this.imageDao = imageDao; 18 | } 19 | 20 | @Override 21 | @Transactional 22 | public void saveImageFile(int imageId, MultipartFile file) { 23 | 24 | try { 25 | Image image = imageDao.findById(imageId).get(); 26 | Byte[] byteObjects = new Byte[file.getBytes().length]; 27 | 28 | int i = 0; 29 | for (byte b : file.getBytes()){ 30 | byteObjects[i++] = b; 31 | } 32 | 33 | image.setBytes(byteObjects); 34 | imageDao.save(image); 35 | 36 | } catch (IOException e) { 37 | e.printStackTrace(); 38 | } 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /SpringFrameworkAssignment2/SpringFrameworkAssignment2/src/main/java/org/genspark/AppConfig.java: -------------------------------------------------------------------------------- 1 | package org.genspark; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.ComponentScan; 5 | import org.springframework.context.annotation.Configuration; 6 | import java.util.ArrayList; 7 | 8 | @Configuration 9 | public class AppConfig { 10 | 11 | @Bean 12 | public Student getStudent(){ 13 | ArrayList phoneArrayList = new ArrayList<>(); 14 | Phone phone1 = getPhone(); 15 | Phone phone2 = getPhone(); 16 | Phone phone3 = getPhone(); 17 | phone1.setMob("123"); 18 | phone2.setMob("456"); 19 | phone3.setMob("789"); 20 | phoneArrayList.add(phone1); 21 | phoneArrayList.add(phone2); 22 | phoneArrayList.add(phone3); 23 | Student s = new Student(); 24 | s.setId(5); 25 | s.setName("TestStudent"); 26 | s.setPh(phoneArrayList); 27 | return s; 28 | } 29 | 30 | @Bean 31 | public Address getAddress(){ 32 | return new Address("provo", "ut", "usa", "84601"); 33 | } 34 | 35 | @Bean 36 | public Phone getPhone(){ 37 | return new Phone(); 38 | } 39 | 40 | 41 | 42 | } 43 | -------------------------------------------------------------------------------- /SpringBootImageGallery/src/main/java/com/genspark/SpringBootAssign1/Entity/Employee.java: -------------------------------------------------------------------------------- 1 | package com.genspark.SpringBootAssign1.Entity; 2 | 3 | public class Employee { 4 | 5 | private int employeeId; 6 | private String name; 7 | private String email; 8 | 9 | public Employee() { 10 | } 11 | 12 | public Employee(int employeeId, String name, String email) { 13 | this.employeeId = employeeId; 14 | this.name = name; 15 | this.email = email; 16 | } 17 | 18 | public int getEmployeeId() { 19 | return employeeId; 20 | } 21 | 22 | public void setEmployeeId(int employeeId) { 23 | this.employeeId = employeeId; 24 | } 25 | 26 | public String getName() { 27 | return name; 28 | } 29 | 30 | public void setName(String name) { 31 | this.name = name; 32 | } 33 | 34 | public String getEmail() { 35 | return email; 36 | } 37 | 38 | public void setEmail(String email) { 39 | this.email = email; 40 | } 41 | 42 | @Override 43 | public String toString() { 44 | return "Employee{" + 45 | "employeeId=" + employeeId + 46 | ", name='" + name + '\'' + 47 | ", email='" + email + '\'' + 48 | '}'; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /SpringBootImageGallery/src/main/java/com/genspark/SpringBootAssign1/Service/CourseServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.genspark.SpringBootAssign1.Service; 2 | 3 | import com.genspark.SpringBootAssign1.Dao.CourseDao; 4 | import com.genspark.SpringBootAssign1.Entity.Course; 5 | import org.springframework.stereotype.Service; 6 | 7 | import java.util.ArrayList; 8 | import java.util.List; 9 | import java.util.Optional; 10 | 11 | @Service 12 | public class CourseServiceImpl implements CourseService{ 13 | 14 | private CourseDao courseDao; 15 | 16 | public Course getByCourseId(int id){ 17 | Optional c = this.courseDao.findById(id); 18 | Course course = null; 19 | if (c.isPresent()) course = c.get(); 20 | else throw new RuntimeException("Course not found for id: "+id); 21 | return course; 22 | } 23 | 24 | public List getAllCourses(){ 25 | return this.courseDao.findAll(); 26 | } 27 | 28 | public Course addCourse(Course course){ 29 | return this.courseDao.save(course); 30 | } 31 | 32 | public Course updateCourse(Course course){ 33 | return this.courseDao.save(course); 34 | } 35 | 36 | public String deleteCourse(int courseId){ 37 | this.courseDao.deleteById(courseId); 38 | return "Deleted Successfully "; 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /SpringBootAssign1/src/main/java/com/genspark/SpringBootAssign1/Entity/Employee.java: -------------------------------------------------------------------------------- 1 | package com.genspark.SpringBootAssign1.Entity; 2 | 3 | public class Employee { 4 | 5 | private int employeeId; 6 | private String name; 7 | private String email; 8 | 9 | public Employee() { 10 | } 11 | 12 | public Employee(int employeeId, String name, String email) { 13 | this.employeeId = employeeId; 14 | this.name = name; 15 | this.email = email; 16 | } 17 | 18 | public int getEmployeeId() { 19 | return employeeId; 20 | } 21 | 22 | public void setEmployeeId(int employeeId) { 23 | this.employeeId = employeeId; 24 | } 25 | 26 | public String getName() { 27 | return name; 28 | } 29 | 30 | public void setName(String name) { 31 | this.name = name; 32 | } 33 | 34 | public String getEmail() { 35 | return email; 36 | } 37 | 38 | public void setEmail(String email) { 39 | this.email = email; 40 | } 41 | 42 | @Override 43 | public String toString() { 44 | return "Employee{" + 45 | "employeeId=" + employeeId + 46 | ", name='" + name + '\'' + 47 | ", email='" + email + '\'' + 48 | '}'; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /SpringBootAssign1/src/main/java/com/genspark/SpringBootAssign1/Service/CourseServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.genspark.SpringBootAssign1.Service; 2 | 3 | import com.genspark.SpringBootAssign1.Dao.CourseDao; 4 | import com.genspark.SpringBootAssign1.Entity.Course; 5 | import org.springframework.stereotype.Service; 6 | 7 | import java.util.ArrayList; 8 | import java.util.List; 9 | import java.util.Optional; 10 | 11 | @Service 12 | public class CourseServiceImpl implements CourseService{ 13 | 14 | private CourseDao courseDao; 15 | 16 | public Course getByCourseId(int id){ 17 | Optional c = this.courseDao.findById(id); 18 | Course course = null; 19 | if (c.isPresent()) course = c.get(); 20 | else throw new RuntimeException("Course not found for id: "+id); 21 | return course; 22 | } 23 | 24 | public List getAllCourses(){ 25 | return this.courseDao.findAll(); 26 | } 27 | 28 | public Course addCourse(Course course){ 29 | return this.courseDao.save(course); 30 | } 31 | 32 | public Course updateCourse(Course course){ 33 | return this.courseDao.save(course); 34 | } 35 | 36 | public String deleteCourse(int courseId){ 37 | this.courseDao.deleteById(courseId); 38 | return "Deleted Successfully "; 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /SpringFrameworkAssignment2/SpringFrameworkAssignment2/src/main/java/org/genspark/Student.java: -------------------------------------------------------------------------------- 1 | package org.genspark; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.beans.factory.annotation.Qualifier; 5 | import org.springframework.stereotype.Component; 6 | 7 | import java.util.List; 8 | 9 | public class Student { 10 | 11 | public int getId() { 12 | return id; 13 | } 14 | public void setId(int id) { 15 | this.id = id; 16 | } 17 | public String getName() { 18 | return name; 19 | } 20 | public void setName(String name) { 21 | this.name = name; 22 | } 23 | public List getPh() { 24 | return ph; 25 | } 26 | public void setPh(List ph) { 27 | this.ph = ph; 28 | } 29 | public Address getAdd() { 30 | return add; 31 | } 32 | public void setAdd(Address add) { 33 | this.add = add; 34 | } 35 | 36 | private int id; 37 | private String name; 38 | private List ph; 39 | @Autowired 40 | private Address add; 41 | 42 | @Override 43 | public String toString() { 44 | return "Student{" + 45 | "id=" + id + 46 | ", name='" + name + '\'' + 47 | ", ph=" + ph + 48 | ", add=" + add + 49 | '}'; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /SpringBootImageGallery/src/main/java/com/genspark/SpringBootAssign1/Controller/ImageController.java: -------------------------------------------------------------------------------- 1 | package com.genspark.SpringBootAssign1.Controller; 2 | 3 | import com.genspark.SpringBootAssign1.Service.ImageService; 4 | import org.springframework.stereotype.Controller; 5 | import org.springframework.ui.Model; 6 | import org.springframework.web.bind.annotation.GetMapping; 7 | import org.springframework.web.bind.annotation.PathVariable; 8 | import org.springframework.web.bind.annotation.PostMapping; 9 | import org.springframework.web.bind.annotation.RequestParam; 10 | import org.springframework.web.multipart.MultipartFile; 11 | 12 | @Controller 13 | public class ImageController { 14 | 15 | private final ImageService imageService; 16 | 17 | public ImageController(ImageService imageService) { 18 | this.imageService = imageService; 19 | } 20 | 21 | @GetMapping("image/{id}") 22 | public String showUploadForm(@PathVariable String id, Model model){ 23 | model.addAttribute("recipe", imageService.findCommandById(Long.valueOf(id))); 24 | 25 | return "recipe/imageuploadform"; 26 | } 27 | 28 | @PostMapping("image/{id}") 29 | public String handleImagePost(@PathVariable String id, @RequestParam("imagefile") MultipartFile file){ 30 | 31 | imageService.saveImageFile(Long.valueOf(id), file); 32 | 33 | return "redirect:/recipe/" + id + "/show"; 34 | } 35 | 36 | 37 | } 38 | -------------------------------------------------------------------------------- /MailSendAssignment/src/main/java/com/genspark/MailSendAssignment/Entity/Employee.java: -------------------------------------------------------------------------------- 1 | package com.genspark.MailSendAssignment.Entity; 2 | 3 | import javax.persistence.*; 4 | 5 | @Entity 6 | @Table(name="tbl_employees") 7 | public class Employee { 8 | 9 | @Id 10 | @GeneratedValue(strategy = GenerationType.AUTO) 11 | @Column(name="e_id") 12 | private int employeeId; 13 | private String name; 14 | private String email; 15 | 16 | public Employee() { 17 | } 18 | 19 | public Employee(int employeeId, String name, String email) { 20 | this.employeeId = employeeId; 21 | this.name = name; 22 | this.email = email; 23 | } 24 | 25 | public int getEmployeeId() { 26 | return employeeId; 27 | } 28 | 29 | public void setEmployeeId(int employeeId) { 30 | this.employeeId = employeeId; 31 | } 32 | 33 | public String getName() { 34 | return name; 35 | } 36 | 37 | public void setName(String name) { 38 | this.name = name; 39 | } 40 | 41 | public String getEmail() { 42 | return email; 43 | } 44 | 45 | public void setEmail(String email) { 46 | this.email = email; 47 | } 48 | 49 | @Override 50 | public String toString() { 51 | return "Employee{" + 52 | "employeeId=" + employeeId + 53 | ", name='" + name + '\'' + 54 | ", email='" + email + '\'' + 55 | '}'; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /MailSendAssignment/src/main/java/com/genspark/MailSendAssignment/Entity/Course.java: -------------------------------------------------------------------------------- 1 | package com.genspark.MailSendAssignment.Entity; 2 | 3 | import javax.persistence.*; 4 | 5 | @Entity 6 | @Table(name="tbl_courses") 7 | public class Course { 8 | 9 | 10 | @Id 11 | @GeneratedValue(strategy = GenerationType.AUTO) 12 | @Column(name="c_id") 13 | private int courseId; 14 | private String title; 15 | private String instructor; 16 | 17 | public Course() { 18 | } 19 | 20 | public Course(int courseId, String title, String instructor) { 21 | this.courseId = courseId; 22 | this.title = title; 23 | this.instructor = instructor; 24 | } 25 | 26 | public int getCourseId() { 27 | return courseId; 28 | } 29 | 30 | public void setCourseId(int courseId) { 31 | this.courseId = courseId; 32 | } 33 | 34 | public String getTitle() { 35 | return title; 36 | } 37 | 38 | public void setTitle(String title) { 39 | this.title = title; 40 | } 41 | 42 | public String getInstructor() { 43 | return instructor; 44 | } 45 | 46 | public void setInstructor(String instructor) { 47 | this.instructor = instructor; 48 | } 49 | 50 | @Override 51 | public String toString() { 52 | return "Course{" + 53 | "courseId=" + courseId + 54 | ", title='" + title + '\'' + 55 | ", instructor='" + instructor + '\'' + 56 | '}'; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /SpringBootImageGallery/src/main/java/com/genspark/SpringBootAssign1/Entity/Course.java: -------------------------------------------------------------------------------- 1 | package com.genspark.SpringBootAssign1.Entity; 2 | 3 | import javax.persistence.Column; 4 | import javax.persistence.Entity; 5 | import javax.persistence.Id; 6 | import javax.persistence.Table; 7 | 8 | @Entity 9 | @Table(name="tbl_courses") 10 | public class Course { 11 | 12 | 13 | @Id 14 | @Column(name="c_id") 15 | private int courseId; 16 | private String title; 17 | private String instructor; 18 | 19 | public Course() { 20 | } 21 | 22 | public Course(int courseId, String title, String instructor) { 23 | this.courseId = courseId; 24 | this.title = title; 25 | this.instructor = instructor; 26 | } 27 | 28 | public int getCourseId() { 29 | return courseId; 30 | } 31 | 32 | public void setCourseId(int courseId) { 33 | this.courseId = courseId; 34 | } 35 | 36 | public String getTitle() { 37 | return title; 38 | } 39 | 40 | public void setTitle(String title) { 41 | this.title = title; 42 | } 43 | 44 | public String getInstructor() { 45 | return instructor; 46 | } 47 | 48 | public void setInstructor(String instructor) { 49 | this.instructor = instructor; 50 | } 51 | 52 | @Override 53 | public String toString() { 54 | return "Course{" + 55 | "courseId=" + courseId + 56 | ", title='" + title + '\'' + 57 | ", instructor='" + instructor + '\'' + 58 | '}'; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /SpringBootAssign1/src/main/java/com/genspark/SpringBootAssign1/Entity/Course.java: -------------------------------------------------------------------------------- 1 | package com.genspark.SpringBootAssign1.Entity; 2 | 3 | import javax.persistence.Column; 4 | import javax.persistence.Entity; 5 | import javax.persistence.Id; 6 | import javax.persistence.Table; 7 | 8 | @Entity 9 | @Table(name="tbl_courses") 10 | public class Course { 11 | 12 | 13 | @Id 14 | @Column(name="c_id") 15 | private int courseId; 16 | private String title; 17 | private String instructor; 18 | 19 | public Course() { 20 | } 21 | 22 | public Course(int courseId, String title, String instructor) { 23 | this.courseId = courseId; 24 | this.title = title; 25 | this.instructor = instructor; 26 | } 27 | 28 | public int getCourseId() { 29 | return courseId; 30 | } 31 | 32 | public void setCourseId(int courseId) { 33 | this.courseId = courseId; 34 | } 35 | 36 | public String getTitle() { 37 | return title; 38 | } 39 | 40 | public void setTitle(String title) { 41 | this.title = title; 42 | } 43 | 44 | public String getInstructor() { 45 | return instructor; 46 | } 47 | 48 | public void setInstructor(String instructor) { 49 | this.instructor = instructor; 50 | } 51 | 52 | @Override 53 | public String toString() { 54 | return "Course{" + 55 | "courseId=" + courseId + 56 | ", title='" + title + '\'' + 57 | ", instructor='" + instructor + '\'' + 58 | '}'; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /MailSendAssignment/src/main/java/com/genspark/MailSendAssignment/Service/CourseServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.genspark.MailSendAssignment.Service; 2 | 3 | import com.genspark.MailSendAssignment.Dao.CourseDao; 4 | import com.genspark.MailSendAssignment.Entity.Course; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Service; 7 | 8 | import java.util.List; 9 | import java.util.Optional; 10 | 11 | @Service 12 | public class CourseServiceImpl implements CourseService{ 13 | 14 | @Autowired 15 | private CourseDao courseDao; 16 | @Autowired 17 | private EmailSenderService emailSenderService; 18 | 19 | public Course getByCourseId(int id){ 20 | Optional c = this.courseDao.findById(id); 21 | Course course = null; 22 | if (c.isPresent()) course = c.get(); 23 | else throw new RuntimeException("Course not found for id: "+id); 24 | return course; 25 | } 26 | 27 | public List getAllCourses(){ 28 | return this.courseDao.findAll(); 29 | } 30 | 31 | public Course addCourse(Course course){ 32 | emailSenderService.sendEmail("amdalr@gmail.com", "Test Mail","Course added"); 33 | return this.courseDao.save(course); 34 | } 35 | 36 | public Course updateCourse(Course course){ 37 | return this.courseDao.save(course); 38 | } 39 | 40 | public String deleteCourse(int courseId){ 41 | this.courseDao.deleteById(courseId); 42 | emailSenderService.sendEmail("amdalr@gmail.com", "Test Mail","Course deleted"); 43 | return "Deleted Successfully"; 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /SpringFrameworkAssignment2/SpringFrameworkAssignment2/src/main/java/org/genspark/Address.java: -------------------------------------------------------------------------------- 1 | package org.genspark; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.beans.factory.annotation.Qualifier; 5 | import org.springframework.stereotype.Component; 6 | 7 | public class Address { 8 | private String city; 9 | private String state; 10 | private String country; 11 | private String zipcode; 12 | 13 | public Address(String city, String state, String country, String zipcode) { 14 | this.city = city; 15 | this.state = state; 16 | this.country = country; 17 | this.zipcode = zipcode; 18 | } 19 | 20 | public String getCity() { 21 | return city; 22 | } 23 | public void setCity(String city) { 24 | this.city = city; 25 | } 26 | public String getState() { 27 | return state; 28 | } 29 | public void setState(String state) { 30 | this.state = state; 31 | } 32 | public String getCountry() { 33 | return country; 34 | } 35 | public void setCountry(String country) { 36 | this.country = country; 37 | } 38 | public String getZipcode() { 39 | return zipcode; 40 | } 41 | public void setZipcode(String zipcode) { 42 | this.zipcode = zipcode; 43 | } 44 | 45 | @Override 46 | public String toString() { 47 | return "Address{" + 48 | "city='" + city + '\'' + 49 | ", state='" + state + '\'' + 50 | ", country='" + country + '\'' + 51 | ", zipcode='" + zipcode + '\'' + 52 | '}'; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /SpringFrameworkDemo2/SpringFrameworkDemo2.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /SpringBootAssign1/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | org.springframework.boot 7 | spring-boot-starter-parent 8 | 2.6.6 9 | 10 | 11 | com.genspark 12 | SpringBootDemoApp 13 | 0.0.1-SNAPSHOT 14 | SpringBootDemoApp 15 | Demo project for Spring Boot 16 | 17 | 11 18 | 19 | 20 | 21 | org.springframework.boot 22 | spring-boot-starter-web 23 | 24 | 25 | 26 | org.springframework.boot 27 | spring-boot-starter-test 28 | test 29 | 30 | 31 | 32 | org.springframework.boot 33 | spring-boot-starter-data-jpa 34 | 35 | 36 | 37 | com.oracle.database.jdbc 38 | ojdbc8 39 | runtime 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | org.springframework.boot 48 | spring-boot-maven-plugin 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /SpringFrameworkAssign1/src/main/resources/Spring.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /SpringFrameworkAssign1/target/classes/Spring.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /MailSendAssignment/src/main/java/com/genspark/MailSendAssignment/Service/EmployeeServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.genspark.MailSendAssignment.Service; 2 | 3 | 4 | import com.genspark.MailSendAssignment.Dao.CourseDao; 5 | import com.genspark.MailSendAssignment.Dao.EmployeeDao; 6 | import com.genspark.MailSendAssignment.Entity.Course; 7 | import com.genspark.MailSendAssignment.Entity.Employee; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.stereotype.Service; 10 | 11 | import java.util.ArrayList; 12 | import java.util.List; 13 | import java.util.Optional; 14 | 15 | @Service 16 | public class EmployeeServiceImpl implements EmployeeService{ 17 | 18 | @Autowired 19 | private EmployeeDao employeeDao; 20 | @Autowired 21 | private EmailSenderService emailSenderService; 22 | 23 | public Employee getByEmployeeId(int id){ 24 | Optional e = this.employeeDao.findById(id); 25 | Employee employee = null; 26 | if (e.isPresent()) employee = e.get(); 27 | else throw new RuntimeException("Employee not found for id: "+id); 28 | return employee; 29 | } 30 | 31 | public List getAllEmployees(){ 32 | 33 | return this.employeeDao.findAll(); 34 | } 35 | 36 | public Employee addEmployee(Employee employee){ 37 | emailSenderService.sendEmail("amdalr@gmail.com", "Test Mail","Employee added"); 38 | return this.employeeDao.save(employee); 39 | } 40 | 41 | public Employee updateEmployee(Employee employee){ 42 | return this.employeeDao.save(employee); 43 | } 44 | 45 | public String deleteEmployee(int employeeId){ 46 | this.employeeDao.deleteById(employeeId); 47 | emailSenderService.sendEmail("amdalr@gmail.com", "Test Mail","Employee deleted"); 48 | return "Deleted Successfully"; 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /SpringFrameworkClass3/.idea/SpringFrameworkClass3.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /SpringBootImageGallery/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | org.springframework.boot 7 | spring-boot-starter-parent 8 | 2.6.6 9 | 10 | 11 | com.genspark 12 | SpringBootDemoApp 13 | 0.0.1-SNAPSHOT 14 | SpringBootDemoApp 15 | Demo project for Spring Boot 16 | 17 | 11 18 | 19 | 20 | 21 | org.springframework.boot 22 | spring-boot-starter-web 23 | 24 | 25 | 26 | org.springframework.boot 27 | spring-boot-starter-test 28 | test 29 | 30 | 31 | 32 | org.springframework.boot 33 | spring-boot-starter-data-jpa 34 | 35 | 36 | 37 | com.oracle.database.jdbc 38 | ojdbc8 39 | runtime 40 | 41 | 42 | 43 | mysql 44 | mysql-connector-java 45 | runtime 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | org.springframework.boot 54 | spring-boot-maven-plugin 55 | 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /SpringFrameworkAssignment2/SpringFrameworkAssignment2/src/main/resources/Spring.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /SpringFrameworkAssignment2/SpringFrameworkAssignment2/target/classes/Spring.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /SPELDemostation/src/main/java/org/example/Alien.java: -------------------------------------------------------------------------------- 1 | package org.example; 2 | 3 | import org.springframework.beans.factory.annotation.Value; 4 | import org.springframework.stereotype.Component; 5 | 6 | @Component 7 | public class Alien { 8 | @Value("#{20}") 9 | private int x; 10 | 11 | @Value("#{30}") 12 | private int y; 13 | 14 | 15 | @Value("#{alien.x+alien.y}") 16 | private int z; 17 | 18 | @Value("#{T(org.example.Alien).hello(5.77)}") 19 | private double d; 20 | 21 | @Value("#{new java.lang.String('Genspark')}") 22 | private String name; 23 | 24 | @Value("#{'true'}") 25 | private boolean isActive; 26 | 27 | public int getX() { 28 | return x; 29 | } 30 | 31 | public void setX(int x) { 32 | this.x = x; 33 | } 34 | 35 | public int getY() { 36 | return y; 37 | } 38 | 39 | public void setY(int y) { 40 | this.y = y; 41 | } 42 | 43 | public int getZ() { 44 | return z; 45 | } 46 | 47 | public void setZ(int z) { 48 | this.z = z; 49 | } 50 | 51 | 52 | public static double hello(double a) 53 | { 54 | return a; 55 | } 56 | 57 | public double getD() { 58 | return d; 59 | } 60 | 61 | public void setD(double d) { 62 | this.d = d; 63 | } 64 | 65 | public String getName() { 66 | return name; 67 | } 68 | 69 | public void setName(String name) { 70 | this.name = name; 71 | } 72 | 73 | public boolean isActive() { 74 | return isActive; 75 | } 76 | 77 | public void setActive(boolean active) { 78 | isActive = active; 79 | } 80 | 81 | @Override 82 | public String toString() { 83 | return "Alien{" + 84 | "x=" + x + 85 | ", y=" + y + 86 | ", z=" + z + 87 | ", d=" + d + 88 | ", name='" + name + '\'' + 89 | ", isActive=" + isActive + 90 | '}'; 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /MailSendAssignment/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | org.springframework.boot 7 | spring-boot-starter-parent 8 | 2.6.6 9 | 10 | 11 | com.genspark 12 | SpringBootDemoApp 13 | 0.0.1-SNAPSHOT 14 | SpringBootDemoApp 15 | Demo project for Spring Boot 16 | 17 | 11 18 | 19 | 20 | 21 | org.springframework.boot 22 | spring-boot-starter-web 23 | 24 | 25 | 26 | org.springframework.boot 27 | spring-boot-starter-test 28 | test 29 | 30 | 31 | 32 | org.springframework.boot 33 | spring-boot-starter-data-jpa 34 | 35 | 36 | 37 | com.oracle.database.jdbc 38 | ojdbc8 39 | runtime 40 | 41 | 42 | 43 | 44 | org.springframework.boot 45 | spring-boot-starter-mail 46 | 47 | 48 | 49 | 50 | org.hibernate 51 | hibernate-core 52 | 5.6.5.Final 53 | 54 | 55 | mysql 56 | mysql-connector-java 57 | 8.0.18 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | org.springframework.boot 66 | spring-boot-maven-plugin 67 | 68 | 69 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /SpringBootImageGallery/src/main/java/com/genspark/SpringBootAssign1/Service/EmployeeServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.genspark.SpringBootAssign1.Service; 2 | 3 | 4 | import com.genspark.SpringBootAssign1.Entity.Employee; 5 | import org.springframework.stereotype.Service; 6 | 7 | import java.util.ArrayList; 8 | import java.util.List; 9 | 10 | @Service 11 | public class EmployeeServiceImpl implements EmployeeService{ 12 | 13 | List list; 14 | 15 | public EmployeeServiceImpl() { 16 | list = new ArrayList<>(); 17 | list.add(new Employee(1,"Employee One", "EmployeeOne@employees.org")); 18 | list.add(new Employee(2,"Employee Two", "EmployeeTwo@employees.org")); 19 | list.add(new Employee(3,"Employee Three", "EmployeeThree@employees.org")); 20 | list.add(new Employee(4,"Employee Four", "EmployeeFour@employees.org")); 21 | } 22 | 23 | public Employee getByEmployeeId(int id){ 24 | Employee c = null; 25 | for (Employee employee : this.list){ 26 | if (employee.getEmployeeId() == id) { 27 | c = employee; 28 | break; 29 | } 30 | } 31 | 32 | return c; 33 | } 34 | 35 | public List getAllEmployees(){ 36 | return list; 37 | } 38 | 39 | public Employee addEmployee(Employee Employee){ 40 | list.add(Employee); 41 | return getByEmployeeId(Employee.getEmployeeId()); 42 | } 43 | 44 | public Employee updateEmployee(Employee Employee){ 45 | String title = Employee.getName(); 46 | String instructor = Employee.getEmail(); 47 | Employee c = null; 48 | for ( Employee e : this.list){ 49 | if (e.getEmployeeId() == Employee.getEmployeeId()){ 50 | e.setName(title); 51 | e.setEmail(instructor); 52 | c = e; 53 | break; 54 | } 55 | } 56 | return c; 57 | } 58 | 59 | public Employee deleteEmployee(int EmployeeId){ 60 | Employee c = null; 61 | for ( Employee e : this.list){ 62 | if (e.getEmployeeId() == EmployeeId){ 63 | list.remove(e); 64 | break; 65 | } 66 | } 67 | return c; 68 | } 69 | 70 | } 71 | -------------------------------------------------------------------------------- /SpringBootAssign1/src/main/java/com/genspark/SpringBootAssign1/Service/EmployeeServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.genspark.SpringBootAssign1.Service; 2 | 3 | 4 | import com.genspark.SpringBootAssign1.Entity.Employee; 5 | import org.springframework.stereotype.Service; 6 | 7 | import java.util.ArrayList; 8 | import java.util.List; 9 | 10 | @Service 11 | public class EmployeeServiceImpl implements EmployeeService{ 12 | 13 | List list; 14 | 15 | public EmployeeServiceImpl() { 16 | list = new ArrayList<>(); 17 | list.add(new Employee(1,"Employee One", "EmployeeOne@employees.org")); 18 | list.add(new Employee(2,"Employee Two", "EmployeeTwo@employees.org")); 19 | list.add(new Employee(3,"Employee Three", "EmployeeThree@employees.org")); 20 | list.add(new Employee(4,"Employee Four", "EmployeeFour@employees.org")); 21 | } 22 | 23 | public Employee getByEmployeeId(int id){ 24 | Employee c = null; 25 | for (Employee employee : this.list){ 26 | if (employee.getEmployeeId() == id) { 27 | c = employee; 28 | break; 29 | } 30 | } 31 | 32 | return c; 33 | } 34 | 35 | public List getAllEmployees(){ 36 | return list; 37 | } 38 | 39 | public Employee addEmployee(Employee Employee){ 40 | list.add(Employee); 41 | return getByEmployeeId(Employee.getEmployeeId()); 42 | } 43 | 44 | public Employee updateEmployee(Employee Employee){ 45 | String title = Employee.getName(); 46 | String instructor = Employee.getEmail(); 47 | Employee c = null; 48 | for ( Employee e : this.list){ 49 | if (e.getEmployeeId() == Employee.getEmployeeId()){ 50 | e.setName(title); 51 | e.setEmail(instructor); 52 | c = e; 53 | break; 54 | } 55 | } 56 | return c; 57 | } 58 | 59 | public Employee deleteEmployee(int EmployeeId){ 60 | Employee c = null; 61 | for ( Employee e : this.list){ 62 | if (e.getEmployeeId() == EmployeeId){ 63 | list.remove(e); 64 | break; 65 | } 66 | } 67 | return c; 68 | } 69 | 70 | } 71 | -------------------------------------------------------------------------------- /SpringFrameworkDemo1/.idea/workspace.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | 13 | 14 | 16 | 17 | 19 | 20 | 25 | 26 | 27 | 28 | 29 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 1648731952488 42 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /SpringFrameworkAssign1/.idea/workspace.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | 13 | 14 | 16 | 17 | 19 | 20 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 1648728755877 44 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /MailSendAssignment/src/main/java/com/genspark/MailSendAssignment/Controller/MyController.java: -------------------------------------------------------------------------------- 1 | package com.genspark.MailSendAssignment.Controller; 2 | 3 | import com.genspark.MailSendAssignment.Entity.Course; 4 | import com.genspark.MailSendAssignment.Entity.Employee; 5 | import com.genspark.MailSendAssignment.Service.CourseService; 6 | import com.genspark.MailSendAssignment.Service.EmployeeService; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.web.bind.annotation.*; 9 | 10 | import java.util.List; 11 | 12 | @RestController 13 | public class MyController { 14 | 15 | @Autowired 16 | private CourseService courseService; 17 | @Autowired 18 | private EmployeeService employeeService; 19 | 20 | @GetMapping("home") 21 | public String home(){ 22 | return "

Welcome to the course application

"; 23 | } 24 | 25 | // // // // // 26 | // COURSES // 27 | // // // // // 28 | @GetMapping("courses") 29 | public List getCourses(){ 30 | return this.courseService.getAllCourses(); 31 | } 32 | 33 | @GetMapping("/courses/{courseId}") 34 | public Course getCourse(@PathVariable String courseId){ 35 | return this.courseService.getByCourseId(Integer.parseInt(courseId)); 36 | } 37 | 38 | @PostMapping("/courses") 39 | public Course addCourse(@RequestBody Course course){ 40 | return this.courseService.addCourse(course); 41 | } 42 | 43 | @PutMapping("/courses") 44 | public Course updateCourse(@RequestBody Course course){ 45 | return this.courseService.updateCourse(course); 46 | } 47 | 48 | @DeleteMapping("/courses/{courseId}") 49 | public String deleteCourse(@PathVariable String courseId){ 50 | this.courseService.deleteCourse(Integer.parseInt(courseId)); 51 | return "Deleted Successfully"; 52 | } 53 | 54 | // // // // // // 55 | // EMPLOYEES // 56 | // // // // // 57 | @GetMapping("employees") 58 | public List getEmployees(){ 59 | return this.employeeService.getAllEmployees(); 60 | } 61 | 62 | @GetMapping("/employees/{employeeId}") 63 | public Employee getEmployee(@PathVariable String employeeId){ 64 | return this.employeeService.getByEmployeeId(Integer.parseInt(employeeId)); 65 | } 66 | 67 | @PostMapping("/employees") 68 | public Employee addEmployee(@RequestBody Employee employee){ 69 | return this.employeeService.addEmployee(employee); 70 | } 71 | 72 | @PutMapping("/employees") 73 | public Employee updateCourse(@RequestBody Employee employee){ 74 | return this.employeeService.updateEmployee(employee); 75 | } 76 | 77 | @DeleteMapping("/employees/{employeeId}") 78 | public String deleteEmployee(@PathVariable String employeeId){ 79 | this.employeeService.deleteEmployee(Integer.parseInt(employeeId)); 80 | return "Deleted Successfully"; 81 | } 82 | 83 | } 84 | -------------------------------------------------------------------------------- /SpringBootImageGallery/src/main/java/com/genspark/SpringBootAssign1/Controller/MyController.java: -------------------------------------------------------------------------------- 1 | package com.genspark.SpringBootAssign1.Controller; 2 | 3 | import com.genspark.SpringBootAssign1.Entity.Course; 4 | import com.genspark.SpringBootAssign1.Entity.Employee; 5 | import com.genspark.SpringBootAssign1.Service.CourseService; 6 | import com.genspark.SpringBootAssign1.Service.EmployeeService; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.web.bind.annotation.*; 9 | 10 | import java.util.List; 11 | 12 | @RestController 13 | public class MyController { 14 | 15 | @Autowired 16 | private CourseService courseService; 17 | @Autowired 18 | private EmployeeService employeeService; 19 | 20 | @GetMapping("home") 21 | public String home(){ 22 | return "

Welcome to the course application

"; 23 | } 24 | 25 | // // // // // 26 | // COURSES // 27 | // // // // // 28 | @GetMapping("courses") 29 | public List getCourses(){ 30 | return this.courseService.getAllCourses(); 31 | } 32 | 33 | @GetMapping("/courses/{courseId}") 34 | public Course getCourse(@PathVariable String courseId){ 35 | return this.courseService.getByCourseId(Integer.parseInt(courseId)); 36 | } 37 | 38 | @PostMapping("/courses") 39 | public Course addCourse(@RequestBody Course course){ 40 | return this.courseService.addCourse(course); 41 | } 42 | 43 | @PutMapping("/courses") 44 | public Course updateCourse(@RequestBody Course course){ 45 | return this.courseService.updateCourse(course); 46 | } 47 | 48 | @DeleteMapping("/courses/{courseId}") 49 | public String deleteCourse(@PathVariable String courseId){ 50 | this.courseService.deleteCourse(Integer.parseInt(courseId)); 51 | return "Deleted Successfully"; 52 | } 53 | 54 | // // // // // // 55 | // EMPLOYEES // 56 | // // // // // 57 | @GetMapping("employees") 58 | public List getEmployees(){ 59 | return this.employeeService.getAllEmployees(); 60 | } 61 | 62 | @GetMapping("/employees/{employeeId}") 63 | public Employee getEmployee(@PathVariable String employeeId){ 64 | return this.employeeService.getByEmployeeId(Integer.parseInt(employeeId)); 65 | } 66 | 67 | @PostMapping("/employees") 68 | public Employee addEmployee(@RequestBody Employee employee){ 69 | return this.employeeService.addEmployee(employee); 70 | } 71 | 72 | @PutMapping("/employees") 73 | public Employee updateCourse(@RequestBody Employee employee){ 74 | return this.employeeService.updateEmployee(employee); 75 | } 76 | 77 | @DeleteMapping("/employees/{employeeId}") 78 | public String deleteEmployee(@PathVariable String employeeId){ 79 | this.employeeService.deleteEmployee(Integer.parseInt(employeeId)); 80 | return "Deleted Successfully"; 81 | } 82 | 83 | } 84 | -------------------------------------------------------------------------------- /SpringBootAssign1/src/main/java/com/genspark/SpringBootAssign1/Controller/MyController.java: -------------------------------------------------------------------------------- 1 | package com.genspark.SpringBootAssign1.Controller; 2 | 3 | import com.genspark.SpringBootAssign1.Entity.Course; 4 | import com.genspark.SpringBootAssign1.Entity.Employee; 5 | import com.genspark.SpringBootAssign1.Service.CourseService; 6 | import com.genspark.SpringBootAssign1.Service.EmployeeService; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.web.bind.annotation.*; 9 | 10 | import java.util.List; 11 | 12 | @RestController 13 | public class MyController { 14 | 15 | @Autowired 16 | private CourseService courseService; 17 | @Autowired 18 | private EmployeeService employeeService; 19 | 20 | @GetMapping("home") 21 | public String home(){ 22 | return "

Welcome to the course application

"; 23 | } 24 | 25 | // // // // // 26 | // COURSES // 27 | // // // // // 28 | @GetMapping("courses") 29 | public List getCourses(){ 30 | return this.courseService.getAllCourses(); 31 | } 32 | 33 | @GetMapping("/courses/{courseId}") 34 | public Course getCourse(@PathVariable String courseId){ 35 | return this.courseService.getByCourseId(Integer.parseInt(courseId)); 36 | } 37 | 38 | @PostMapping("/courses") 39 | public Course addCourse(@RequestBody Course course){ 40 | return this.courseService.addCourse(course); 41 | } 42 | 43 | @PutMapping("/courses") 44 | public Course updateCourse(@RequestBody Course course){ 45 | return this.courseService.updateCourse(course); 46 | } 47 | 48 | @DeleteMapping("/courses/{courseId}") 49 | public String deleteCourse(@PathVariable String courseId){ 50 | this.courseService.deleteCourse(Integer.parseInt(courseId)); 51 | return "Deleted Successfully"; 52 | } 53 | 54 | // // // // // // 55 | // EMPLOYEES // 56 | // // // // // 57 | @GetMapping("employees") 58 | public List getEmployees(){ 59 | return this.employeeService.getAllEmployees(); 60 | } 61 | 62 | @GetMapping("/employees/{employeeId}") 63 | public Employee getEmployee(@PathVariable String employeeId){ 64 | return this.employeeService.getByEmployeeId(Integer.parseInt(employeeId)); 65 | } 66 | 67 | @PostMapping("/employees") 68 | public Employee addEmployee(@RequestBody Employee employee){ 69 | return this.employeeService.addEmployee(employee); 70 | } 71 | 72 | @PutMapping("/employees") 73 | public Employee updateCourse(@RequestBody Employee employee){ 74 | return this.employeeService.updateEmployee(employee); 75 | } 76 | 77 | @DeleteMapping("/employees/{employeeId}") 78 | public String deleteEmployee(@PathVariable String employeeId){ 79 | this.employeeService.deleteEmployee(Integer.parseInt(employeeId)); 80 | return "Deleted Successfully"; 81 | } 82 | 83 | } 84 | -------------------------------------------------------------------------------- /SPELDemostation/.idea/workspace.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | 13 | 14 | 19 | 20 | 21 | 23 | 24 | 26 | 27 | 28 | 29 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 1648824210809 62 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /SpringFrameworkClass3/.idea/workspace.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | 13 | 14 | 19 | 20 | 21 | 23 | 24 | 26 | 27 | 28 | 29 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 1648822427066 62 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /SPELDemostation/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 4.0.0 6 | 7 | org.example 8 | SPELDemostation 9 | 1.0-SNAPSHOT 10 | 11 | SPELDemostation 12 | 13 | http://www.example.com 14 | 15 | 16 | UTF-8 17 | 1.7 18 | 1.7 19 | 20 | 21 | 22 | 23 | junit 24 | junit 25 | 4.11 26 | test 27 | 28 | 29 | 30 | 31 | org.springframework 32 | spring-context 33 | 5.3.17 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | maven-clean-plugin 44 | 3.1.0 45 | 46 | 47 | 48 | maven-resources-plugin 49 | 3.0.2 50 | 51 | 52 | maven-compiler-plugin 53 | 3.8.0 54 | 55 | 56 | maven-surefire-plugin 57 | 2.22.1 58 | 59 | 60 | maven-jar-plugin 61 | 3.0.2 62 | 63 | 64 | maven-install-plugin 65 | 2.5.2 66 | 67 | 68 | maven-deploy-plugin 69 | 2.8.2 70 | 71 | 72 | 73 | maven-site-plugin 74 | 3.7.1 75 | 76 | 77 | maven-project-info-reports-plugin 78 | 3.0.0 79 | 80 | 81 | 82 | 83 | 84 | -------------------------------------------------------------------------------- /SpringFrameworkAssignment2/SpringFrameworkAssignment2/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 4.0.0 6 | 7 | org.genspark 8 | SpringFrameworkAssignment2 9 | 1.0-SNAPSHOT 10 | 11 | SpringFrameworkAssignment2 12 | 13 | http://www.example.com 14 | 15 | 16 | UTF-8 17 | 1.7 18 | 1.7 19 | 20 | 21 | 22 | 23 | junit 24 | junit 25 | 4.11 26 | test 27 | 28 | 29 | 30 | 31 | org.springframework 32 | spring-context 33 | 5.3.13 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | maven-clean-plugin 44 | 3.1.0 45 | 46 | 47 | 48 | maven-resources-plugin 49 | 3.0.2 50 | 51 | 52 | maven-compiler-plugin 53 | 3.8.0 54 | 55 | 56 | maven-surefire-plugin 57 | 2.22.1 58 | 59 | 60 | maven-jar-plugin 61 | 3.0.2 62 | 63 | 64 | maven-install-plugin 65 | 2.5.2 66 | 67 | 68 | maven-deploy-plugin 69 | 2.8.2 70 | 71 | 72 | 73 | maven-site-plugin 74 | 3.7.1 75 | 76 | 77 | maven-project-info-reports-plugin 78 | 3.0.0 79 | 80 | 81 | 82 | 83 | 84 | -------------------------------------------------------------------------------- /SpringFrameworkDemo1/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 4.0.0 6 | 7 | org.genspark 8 | SpringFrameworkDemo1 9 | 1.0-SNAPSHOT 10 | 11 | SpringFrameworkDemo1 12 | 13 | http://www.example.com 14 | 15 | 16 | UTF-8 17 | 1.7 18 | 1.7 19 | 20 | 21 | 22 | 23 | junit 24 | junit 25 | 4.11 26 | test 27 | 28 | 29 | 30 | 31 | org.springframework 32 | spring-context 33 | 5.3.13 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | maven-clean-plugin 44 | 3.1.0 45 | 46 | 47 | 48 | maven-resources-plugin 49 | 3.0.2 50 | 51 | 52 | maven-compiler-plugin 53 | 3.8.0 54 | 55 | 56 | maven-surefire-plugin 57 | 2.22.1 58 | 59 | 60 | maven-jar-plugin 61 | 3.0.2 62 | 63 | 64 | maven-install-plugin 65 | 2.5.2 66 | 67 | 68 | maven-deploy-plugin 69 | 2.8.2 70 | 71 | 72 | 73 | maven-site-plugin 74 | 3.7.1 75 | 76 | 77 | maven-project-info-reports-plugin 78 | 3.0.0 79 | 80 | 81 | 82 | 83 | 84 | -------------------------------------------------------------------------------- /SpringFrameworkAssign1/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 4.0.0 6 | 7 | org.genspark 8 | SpringFrameworkAssign1 9 | 1.0-SNAPSHOT 10 | 11 | SpringFrameworkAssign1 12 | 13 | http://www.example.com 14 | 15 | 16 | UTF-8 17 | 1.7 18 | 1.7 19 | 20 | 21 | 22 | 23 | junit 24 | junit 25 | 4.11 26 | test 27 | 28 | 29 | 30 | 31 | org.springframework 32 | spring-context 33 | 5.3.13 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | maven-clean-plugin 44 | 3.1.0 45 | 46 | 47 | 48 | maven-resources-plugin 49 | 3.0.2 50 | 51 | 52 | maven-compiler-plugin 53 | 3.8.0 54 | 55 | 56 | maven-surefire-plugin 57 | 2.22.1 58 | 59 | 60 | maven-jar-plugin 61 | 3.0.2 62 | 63 | 64 | maven-install-plugin 65 | 2.5.2 66 | 67 | 68 | maven-deploy-plugin 69 | 2.8.2 70 | 71 | 72 | 73 | maven-site-plugin 74 | 3.7.1 75 | 76 | 77 | maven-project-info-reports-plugin 78 | 3.0.0 79 | 80 | 81 | 82 | 83 | 84 | -------------------------------------------------------------------------------- /SpringFrameworkDemo2/.idea/workspace.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | 13 | 14 | 20 | 21 | 22 | 24 | 25 | 27 | 28 | 29 | 30 | 31 | 32 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 1648690931445 65 | 69 | 70 | 71 | 72 | 81 | 82 | -------------------------------------------------------------------------------- /MailSendAssignment/mvnw.cmd: -------------------------------------------------------------------------------- 1 | @REM ---------------------------------------------------------------------------- 2 | @REM Licensed to the Apache Software Foundation (ASF) under one 3 | @REM or more contributor license agreements. See the NOTICE file 4 | @REM distributed with this work for additional information 5 | @REM regarding copyright ownership. The ASF licenses this file 6 | @REM to you under the Apache License, Version 2.0 (the 7 | @REM "License"); you may not use this file except in compliance 8 | @REM with the License. You may obtain a copy of the License at 9 | @REM 10 | @REM https://www.apache.org/licenses/LICENSE-2.0 11 | @REM 12 | @REM Unless required by applicable law or agreed to in writing, 13 | @REM software distributed under the License is distributed on an 14 | @REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | @REM KIND, either express or implied. See the License for the 16 | @REM specific language governing permissions and limitations 17 | @REM under the License. 18 | @REM ---------------------------------------------------------------------------- 19 | 20 | @REM ---------------------------------------------------------------------------- 21 | @REM Maven Start Up Batch script 22 | @REM 23 | @REM Required ENV vars: 24 | @REM JAVA_HOME - location of a JDK home dir 25 | @REM 26 | @REM Optional ENV vars 27 | @REM M2_HOME - location of maven2's installed home dir 28 | @REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands 29 | @REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending 30 | @REM MAVEN_OPTS - parameters passed to the Java VM when running Maven 31 | @REM e.g. to debug Maven itself, use 32 | @REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 33 | @REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files 34 | @REM ---------------------------------------------------------------------------- 35 | 36 | @REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' 37 | @echo off 38 | @REM set title of command window 39 | title %0 40 | @REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' 41 | @if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% 42 | 43 | @REM set %HOME% to equivalent of $HOME 44 | if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") 45 | 46 | @REM Execute a user defined script before this one 47 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre 48 | @REM check for pre script, once with legacy .bat ending and once with .cmd ending 49 | if exist "%USERPROFILE%\mavenrc_pre.bat" call "%USERPROFILE%\mavenrc_pre.bat" %* 50 | if exist "%USERPROFILE%\mavenrc_pre.cmd" call "%USERPROFILE%\mavenrc_pre.cmd" %* 51 | :skipRcPre 52 | 53 | @setlocal 54 | 55 | set ERROR_CODE=0 56 | 57 | @REM To isolate internal variables from possible post scripts, we use another setlocal 58 | @setlocal 59 | 60 | @REM ==== START VALIDATION ==== 61 | if not "%JAVA_HOME%" == "" goto OkJHome 62 | 63 | echo. 64 | echo Error: JAVA_HOME not found in your environment. >&2 65 | echo Please set the JAVA_HOME variable in your environment to match the >&2 66 | echo location of your Java installation. >&2 67 | echo. 68 | goto error 69 | 70 | :OkJHome 71 | if exist "%JAVA_HOME%\bin\java.exe" goto init 72 | 73 | echo. 74 | echo Error: JAVA_HOME is set to an invalid directory. >&2 75 | echo JAVA_HOME = "%JAVA_HOME%" >&2 76 | echo Please set the JAVA_HOME variable in your environment to match the >&2 77 | echo location of your Java installation. >&2 78 | echo. 79 | goto error 80 | 81 | @REM ==== END VALIDATION ==== 82 | 83 | :init 84 | 85 | @REM Find the project base dir, i.e. the directory that contains the folder ".mvn". 86 | @REM Fallback to current working directory if not found. 87 | 88 | set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% 89 | IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir 90 | 91 | set EXEC_DIR=%CD% 92 | set WDIR=%EXEC_DIR% 93 | :findBaseDir 94 | IF EXIST "%WDIR%"\.mvn goto baseDirFound 95 | cd .. 96 | IF "%WDIR%"=="%CD%" goto baseDirNotFound 97 | set WDIR=%CD% 98 | goto findBaseDir 99 | 100 | :baseDirFound 101 | set MAVEN_PROJECTBASEDIR=%WDIR% 102 | cd "%EXEC_DIR%" 103 | goto endDetectBaseDir 104 | 105 | :baseDirNotFound 106 | set MAVEN_PROJECTBASEDIR=%EXEC_DIR% 107 | cd "%EXEC_DIR%" 108 | 109 | :endDetectBaseDir 110 | 111 | IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig 112 | 113 | @setlocal EnableExtensions EnableDelayedExpansion 114 | for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a 115 | @endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% 116 | 117 | :endReadAdditionalConfig 118 | 119 | SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" 120 | set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" 121 | set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain 122 | 123 | set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar" 124 | 125 | FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( 126 | IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B 127 | ) 128 | 129 | @REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central 130 | @REM This allows using the maven wrapper in projects that prohibit checking in binary data. 131 | if exist %WRAPPER_JAR% ( 132 | if "%MVNW_VERBOSE%" == "true" ( 133 | echo Found %WRAPPER_JAR% 134 | ) 135 | ) else ( 136 | if not "%MVNW_REPOURL%" == "" ( 137 | SET DOWNLOAD_URL="%MVNW_REPOURL%/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar" 138 | ) 139 | if "%MVNW_VERBOSE%" == "true" ( 140 | echo Couldn't find %WRAPPER_JAR%, downloading it ... 141 | echo Downloading from: %DOWNLOAD_URL% 142 | ) 143 | 144 | powershell -Command "&{"^ 145 | "$webclient = new-object System.Net.WebClient;"^ 146 | "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ 147 | "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ 148 | "}"^ 149 | "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^ 150 | "}" 151 | if "%MVNW_VERBOSE%" == "true" ( 152 | echo Finished downloading %WRAPPER_JAR% 153 | ) 154 | ) 155 | @REM End of extension 156 | 157 | @REM Provide a "standardized" way to retrieve the CLI args that will 158 | @REM work with both Windows and non-Windows executions. 159 | set MAVEN_CMD_LINE_ARGS=%* 160 | 161 | %MAVEN_JAVA_EXE% ^ 162 | %JVM_CONFIG_MAVEN_PROPS% ^ 163 | %MAVEN_OPTS% ^ 164 | %MAVEN_DEBUG_OPTS% ^ 165 | -classpath %WRAPPER_JAR% ^ 166 | "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" ^ 167 | %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* 168 | if ERRORLEVEL 1 goto error 169 | goto end 170 | 171 | :error 172 | set ERROR_CODE=1 173 | 174 | :end 175 | @endlocal & set ERROR_CODE=%ERROR_CODE% 176 | 177 | if not "%MAVEN_SKIP_RC%"=="" goto skipRcPost 178 | @REM check for post script, once with legacy .bat ending and once with .cmd ending 179 | if exist "%USERPROFILE%\mavenrc_post.bat" call "%USERPROFILE%\mavenrc_post.bat" 180 | if exist "%USERPROFILE%\mavenrc_post.cmd" call "%USERPROFILE%\mavenrc_post.cmd" 181 | :skipRcPost 182 | 183 | @REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' 184 | if "%MAVEN_BATCH_PAUSE%"=="on" pause 185 | 186 | if "%MAVEN_TERMINATE_CMD%"=="on" exit %ERROR_CODE% 187 | 188 | cmd /C exit /B %ERROR_CODE% 189 | -------------------------------------------------------------------------------- /SpringBootAssign1/mvnw.cmd: -------------------------------------------------------------------------------- 1 | @REM ---------------------------------------------------------------------------- 2 | @REM Licensed to the Apache Software Foundation (ASF) under one 3 | @REM or more contributor license agreements. See the NOTICE file 4 | @REM distributed with this work for additional information 5 | @REM regarding copyright ownership. The ASF licenses this file 6 | @REM to you under the Apache License, Version 2.0 (the 7 | @REM "License"); you may not use this file except in compliance 8 | @REM with the License. You may obtain a copy of the License at 9 | @REM 10 | @REM https://www.apache.org/licenses/LICENSE-2.0 11 | @REM 12 | @REM Unless required by applicable law or agreed to in writing, 13 | @REM software distributed under the License is distributed on an 14 | @REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | @REM KIND, either express or implied. See the License for the 16 | @REM specific language governing permissions and limitations 17 | @REM under the License. 18 | @REM ---------------------------------------------------------------------------- 19 | 20 | @REM ---------------------------------------------------------------------------- 21 | @REM Maven Start Up Batch script 22 | @REM 23 | @REM Required ENV vars: 24 | @REM JAVA_HOME - location of a JDK home dir 25 | @REM 26 | @REM Optional ENV vars 27 | @REM M2_HOME - location of maven2's installed home dir 28 | @REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands 29 | @REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending 30 | @REM MAVEN_OPTS - parameters passed to the Java VM when running Maven 31 | @REM e.g. to debug Maven itself, use 32 | @REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 33 | @REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files 34 | @REM ---------------------------------------------------------------------------- 35 | 36 | @REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' 37 | @echo off 38 | @REM set title of command window 39 | title %0 40 | @REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' 41 | @if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% 42 | 43 | @REM set %HOME% to equivalent of $HOME 44 | if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") 45 | 46 | @REM Execute a user defined script before this one 47 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre 48 | @REM check for pre script, once with legacy .bat ending and once with .cmd ending 49 | if exist "%USERPROFILE%\mavenrc_pre.bat" call "%USERPROFILE%\mavenrc_pre.bat" %* 50 | if exist "%USERPROFILE%\mavenrc_pre.cmd" call "%USERPROFILE%\mavenrc_pre.cmd" %* 51 | :skipRcPre 52 | 53 | @setlocal 54 | 55 | set ERROR_CODE=0 56 | 57 | @REM To isolate internal variables from possible post scripts, we use another setlocal 58 | @setlocal 59 | 60 | @REM ==== START VALIDATION ==== 61 | if not "%JAVA_HOME%" == "" goto OkJHome 62 | 63 | echo. 64 | echo Error: JAVA_HOME not found in your environment. >&2 65 | echo Please set the JAVA_HOME variable in your environment to match the >&2 66 | echo location of your Java installation. >&2 67 | echo. 68 | goto error 69 | 70 | :OkJHome 71 | if exist "%JAVA_HOME%\bin\java.exe" goto init 72 | 73 | echo. 74 | echo Error: JAVA_HOME is set to an invalid directory. >&2 75 | echo JAVA_HOME = "%JAVA_HOME%" >&2 76 | echo Please set the JAVA_HOME variable in your environment to match the >&2 77 | echo location of your Java installation. >&2 78 | echo. 79 | goto error 80 | 81 | @REM ==== END VALIDATION ==== 82 | 83 | :init 84 | 85 | @REM Find the project base dir, i.e. the directory that contains the folder ".mvn". 86 | @REM Fallback to current working directory if not found. 87 | 88 | set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% 89 | IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir 90 | 91 | set EXEC_DIR=%CD% 92 | set WDIR=%EXEC_DIR% 93 | :findBaseDir 94 | IF EXIST "%WDIR%"\.mvn goto baseDirFound 95 | cd .. 96 | IF "%WDIR%"=="%CD%" goto baseDirNotFound 97 | set WDIR=%CD% 98 | goto findBaseDir 99 | 100 | :baseDirFound 101 | set MAVEN_PROJECTBASEDIR=%WDIR% 102 | cd "%EXEC_DIR%" 103 | goto endDetectBaseDir 104 | 105 | :baseDirNotFound 106 | set MAVEN_PROJECTBASEDIR=%EXEC_DIR% 107 | cd "%EXEC_DIR%" 108 | 109 | :endDetectBaseDir 110 | 111 | IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig 112 | 113 | @setlocal EnableExtensions EnableDelayedExpansion 114 | for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a 115 | @endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% 116 | 117 | :endReadAdditionalConfig 118 | 119 | SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" 120 | set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" 121 | set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain 122 | 123 | set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar" 124 | 125 | FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( 126 | IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B 127 | ) 128 | 129 | @REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central 130 | @REM This allows using the maven wrapper in projects that prohibit checking in binary data. 131 | if exist %WRAPPER_JAR% ( 132 | if "%MVNW_VERBOSE%" == "true" ( 133 | echo Found %WRAPPER_JAR% 134 | ) 135 | ) else ( 136 | if not "%MVNW_REPOURL%" == "" ( 137 | SET DOWNLOAD_URL="%MVNW_REPOURL%/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar" 138 | ) 139 | if "%MVNW_VERBOSE%" == "true" ( 140 | echo Couldn't find %WRAPPER_JAR%, downloading it ... 141 | echo Downloading from: %DOWNLOAD_URL% 142 | ) 143 | 144 | powershell -Command "&{"^ 145 | "$webclient = new-object System.Net.WebClient;"^ 146 | "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ 147 | "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ 148 | "}"^ 149 | "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^ 150 | "}" 151 | if "%MVNW_VERBOSE%" == "true" ( 152 | echo Finished downloading %WRAPPER_JAR% 153 | ) 154 | ) 155 | @REM End of extension 156 | 157 | @REM Provide a "standardized" way to retrieve the CLI args that will 158 | @REM work with both Windows and non-Windows executions. 159 | set MAVEN_CMD_LINE_ARGS=%* 160 | 161 | %MAVEN_JAVA_EXE% ^ 162 | %JVM_CONFIG_MAVEN_PROPS% ^ 163 | %MAVEN_OPTS% ^ 164 | %MAVEN_DEBUG_OPTS% ^ 165 | -classpath %WRAPPER_JAR% ^ 166 | "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" ^ 167 | %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* 168 | if ERRORLEVEL 1 goto error 169 | goto end 170 | 171 | :error 172 | set ERROR_CODE=1 173 | 174 | :end 175 | @endlocal & set ERROR_CODE=%ERROR_CODE% 176 | 177 | if not "%MAVEN_SKIP_RC%"=="" goto skipRcPost 178 | @REM check for post script, once with legacy .bat ending and once with .cmd ending 179 | if exist "%USERPROFILE%\mavenrc_post.bat" call "%USERPROFILE%\mavenrc_post.bat" 180 | if exist "%USERPROFILE%\mavenrc_post.cmd" call "%USERPROFILE%\mavenrc_post.cmd" 181 | :skipRcPost 182 | 183 | @REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' 184 | if "%MAVEN_BATCH_PAUSE%"=="on" pause 185 | 186 | if "%MAVEN_TERMINATE_CMD%"=="on" exit %ERROR_CODE% 187 | 188 | cmd /C exit /B %ERROR_CODE% 189 | -------------------------------------------------------------------------------- /SpringBootImageGallery/mvnw.cmd: -------------------------------------------------------------------------------- 1 | @REM ---------------------------------------------------------------------------- 2 | @REM Licensed to the Apache Software Foundation (ASF) under one 3 | @REM or more contributor license agreements. See the NOTICE file 4 | @REM distributed with this work for additional information 5 | @REM regarding copyright ownership. The ASF licenses this file 6 | @REM to you under the Apache License, Version 2.0 (the 7 | @REM "License"); you may not use this file except in compliance 8 | @REM with the License. You may obtain a copy of the License at 9 | @REM 10 | @REM https://www.apache.org/licenses/LICENSE-2.0 11 | @REM 12 | @REM Unless required by applicable law or agreed to in writing, 13 | @REM software distributed under the License is distributed on an 14 | @REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | @REM KIND, either express or implied. See the License for the 16 | @REM specific language governing permissions and limitations 17 | @REM under the License. 18 | @REM ---------------------------------------------------------------------------- 19 | 20 | @REM ---------------------------------------------------------------------------- 21 | @REM Maven Start Up Batch script 22 | @REM 23 | @REM Required ENV vars: 24 | @REM JAVA_HOME - location of a JDK home dir 25 | @REM 26 | @REM Optional ENV vars 27 | @REM M2_HOME - location of maven2's installed home dir 28 | @REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands 29 | @REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending 30 | @REM MAVEN_OPTS - parameters passed to the Java VM when running Maven 31 | @REM e.g. to debug Maven itself, use 32 | @REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 33 | @REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files 34 | @REM ---------------------------------------------------------------------------- 35 | 36 | @REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' 37 | @echo off 38 | @REM set title of command window 39 | title %0 40 | @REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' 41 | @if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% 42 | 43 | @REM set %HOME% to equivalent of $HOME 44 | if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") 45 | 46 | @REM Execute a user defined script before this one 47 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre 48 | @REM check for pre script, once with legacy .bat ending and once with .cmd ending 49 | if exist "%USERPROFILE%\mavenrc_pre.bat" call "%USERPROFILE%\mavenrc_pre.bat" %* 50 | if exist "%USERPROFILE%\mavenrc_pre.cmd" call "%USERPROFILE%\mavenrc_pre.cmd" %* 51 | :skipRcPre 52 | 53 | @setlocal 54 | 55 | set ERROR_CODE=0 56 | 57 | @REM To isolate internal variables from possible post scripts, we use another setlocal 58 | @setlocal 59 | 60 | @REM ==== START VALIDATION ==== 61 | if not "%JAVA_HOME%" == "" goto OkJHome 62 | 63 | echo. 64 | echo Error: JAVA_HOME not found in your environment. >&2 65 | echo Please set the JAVA_HOME variable in your environment to match the >&2 66 | echo location of your Java installation. >&2 67 | echo. 68 | goto error 69 | 70 | :OkJHome 71 | if exist "%JAVA_HOME%\bin\java.exe" goto init 72 | 73 | echo. 74 | echo Error: JAVA_HOME is set to an invalid directory. >&2 75 | echo JAVA_HOME = "%JAVA_HOME%" >&2 76 | echo Please set the JAVA_HOME variable in your environment to match the >&2 77 | echo location of your Java installation. >&2 78 | echo. 79 | goto error 80 | 81 | @REM ==== END VALIDATION ==== 82 | 83 | :init 84 | 85 | @REM Find the project base dir, i.e. the directory that contains the folder ".mvn". 86 | @REM Fallback to current working directory if not found. 87 | 88 | set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% 89 | IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir 90 | 91 | set EXEC_DIR=%CD% 92 | set WDIR=%EXEC_DIR% 93 | :findBaseDir 94 | IF EXIST "%WDIR%"\.mvn goto baseDirFound 95 | cd .. 96 | IF "%WDIR%"=="%CD%" goto baseDirNotFound 97 | set WDIR=%CD% 98 | goto findBaseDir 99 | 100 | :baseDirFound 101 | set MAVEN_PROJECTBASEDIR=%WDIR% 102 | cd "%EXEC_DIR%" 103 | goto endDetectBaseDir 104 | 105 | :baseDirNotFound 106 | set MAVEN_PROJECTBASEDIR=%EXEC_DIR% 107 | cd "%EXEC_DIR%" 108 | 109 | :endDetectBaseDir 110 | 111 | IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig 112 | 113 | @setlocal EnableExtensions EnableDelayedExpansion 114 | for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a 115 | @endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% 116 | 117 | :endReadAdditionalConfig 118 | 119 | SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" 120 | set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" 121 | set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain 122 | 123 | set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar" 124 | 125 | FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( 126 | IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B 127 | ) 128 | 129 | @REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central 130 | @REM This allows using the maven wrapper in projects that prohibit checking in binary data. 131 | if exist %WRAPPER_JAR% ( 132 | if "%MVNW_VERBOSE%" == "true" ( 133 | echo Found %WRAPPER_JAR% 134 | ) 135 | ) else ( 136 | if not "%MVNW_REPOURL%" == "" ( 137 | SET DOWNLOAD_URL="%MVNW_REPOURL%/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar" 138 | ) 139 | if "%MVNW_VERBOSE%" == "true" ( 140 | echo Couldn't find %WRAPPER_JAR%, downloading it ... 141 | echo Downloading from: %DOWNLOAD_URL% 142 | ) 143 | 144 | powershell -Command "&{"^ 145 | "$webclient = new-object System.Net.WebClient;"^ 146 | "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ 147 | "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ 148 | "}"^ 149 | "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^ 150 | "}" 151 | if "%MVNW_VERBOSE%" == "true" ( 152 | echo Finished downloading %WRAPPER_JAR% 153 | ) 154 | ) 155 | @REM End of extension 156 | 157 | @REM Provide a "standardized" way to retrieve the CLI args that will 158 | @REM work with both Windows and non-Windows executions. 159 | set MAVEN_CMD_LINE_ARGS=%* 160 | 161 | %MAVEN_JAVA_EXE% ^ 162 | %JVM_CONFIG_MAVEN_PROPS% ^ 163 | %MAVEN_OPTS% ^ 164 | %MAVEN_DEBUG_OPTS% ^ 165 | -classpath %WRAPPER_JAR% ^ 166 | "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" ^ 167 | %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* 168 | if ERRORLEVEL 1 goto error 169 | goto end 170 | 171 | :error 172 | set ERROR_CODE=1 173 | 174 | :end 175 | @endlocal & set ERROR_CODE=%ERROR_CODE% 176 | 177 | if not "%MAVEN_SKIP_RC%"=="" goto skipRcPost 178 | @REM check for post script, once with legacy .bat ending and once with .cmd ending 179 | if exist "%USERPROFILE%\mavenrc_post.bat" call "%USERPROFILE%\mavenrc_post.bat" 180 | if exist "%USERPROFILE%\mavenrc_post.cmd" call "%USERPROFILE%\mavenrc_post.cmd" 181 | :skipRcPost 182 | 183 | @REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' 184 | if "%MAVEN_BATCH_PAUSE%"=="on" pause 185 | 186 | if "%MAVEN_TERMINATE_CMD%"=="on" exit %ERROR_CODE% 187 | 188 | cmd /C exit /B %ERROR_CODE% 189 | -------------------------------------------------------------------------------- /MailSendAssignment/.idea/uiDesigner.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | -------------------------------------------------------------------------------- /MailSendAssignment/mvnw: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # ---------------------------------------------------------------------------- 3 | # Licensed to the Apache Software Foundation (ASF) under one 4 | # or more contributor license agreements. See the NOTICE file 5 | # distributed with this work for additional information 6 | # regarding copyright ownership. The ASF licenses this file 7 | # to you under the Apache License, Version 2.0 (the 8 | # "License"); you may not use this file except in compliance 9 | # with the License. You may obtain a copy of the License at 10 | # 11 | # https://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, 14 | # software distributed under the License is distributed on an 15 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | # KIND, either express or implied. See the License for the 17 | # specific language governing permissions and limitations 18 | # under the License. 19 | # ---------------------------------------------------------------------------- 20 | 21 | # ---------------------------------------------------------------------------- 22 | # Maven Start Up Batch script 23 | # 24 | # Required ENV vars: 25 | # ------------------ 26 | # JAVA_HOME - location of a JDK home dir 27 | # 28 | # Optional ENV vars 29 | # ----------------- 30 | # M2_HOME - location of maven2's installed home dir 31 | # MAVEN_OPTS - parameters passed to the Java VM when running Maven 32 | # e.g. to debug Maven itself, use 33 | # set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 34 | # MAVEN_SKIP_RC - flag to disable loading of mavenrc files 35 | # ---------------------------------------------------------------------------- 36 | 37 | if [ -z "$MAVEN_SKIP_RC" ] ; then 38 | 39 | if [ -f /usr/local/etc/mavenrc ] ; then 40 | . /usr/local/etc/mavenrc 41 | fi 42 | 43 | if [ -f /etc/mavenrc ] ; then 44 | . /etc/mavenrc 45 | fi 46 | 47 | if [ -f "$HOME/.mavenrc" ] ; then 48 | . "$HOME/.mavenrc" 49 | fi 50 | 51 | fi 52 | 53 | # OS specific support. $var _must_ be set to either true or false. 54 | cygwin=false; 55 | darwin=false; 56 | mingw=false 57 | case "`uname`" in 58 | CYGWIN*) cygwin=true ;; 59 | MINGW*) mingw=true;; 60 | Darwin*) darwin=true 61 | # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home 62 | # See https://developer.apple.com/library/mac/qa/qa1170/_index.html 63 | if [ -z "$JAVA_HOME" ]; then 64 | if [ -x "/usr/libexec/java_home" ]; then 65 | export JAVA_HOME="`/usr/libexec/java_home`" 66 | else 67 | export JAVA_HOME="/Library/Java/Home" 68 | fi 69 | fi 70 | ;; 71 | esac 72 | 73 | if [ -z "$JAVA_HOME" ] ; then 74 | if [ -r /etc/gentoo-release ] ; then 75 | JAVA_HOME=`java-config --jre-home` 76 | fi 77 | fi 78 | 79 | if [ -z "$M2_HOME" ] ; then 80 | ## resolve links - $0 may be a link to maven's home 81 | PRG="$0" 82 | 83 | # need this for relative symlinks 84 | while [ -h "$PRG" ] ; do 85 | ls=`ls -ld "$PRG"` 86 | link=`expr "$ls" : '.*-> \(.*\)$'` 87 | if expr "$link" : '/.*' > /dev/null; then 88 | PRG="$link" 89 | else 90 | PRG="`dirname "$PRG"`/$link" 91 | fi 92 | done 93 | 94 | saveddir=`pwd` 95 | 96 | M2_HOME=`dirname "$PRG"`/.. 97 | 98 | # make it fully qualified 99 | M2_HOME=`cd "$M2_HOME" && pwd` 100 | 101 | cd "$saveddir" 102 | # echo Using m2 at $M2_HOME 103 | fi 104 | 105 | # For Cygwin, ensure paths are in UNIX format before anything is touched 106 | if $cygwin ; then 107 | [ -n "$M2_HOME" ] && 108 | M2_HOME=`cygpath --unix "$M2_HOME"` 109 | [ -n "$JAVA_HOME" ] && 110 | JAVA_HOME=`cygpath --unix "$JAVA_HOME"` 111 | [ -n "$CLASSPATH" ] && 112 | CLASSPATH=`cygpath --path --unix "$CLASSPATH"` 113 | fi 114 | 115 | # For Mingw, ensure paths are in UNIX format before anything is touched 116 | if $mingw ; then 117 | [ -n "$M2_HOME" ] && 118 | M2_HOME="`(cd "$M2_HOME"; pwd)`" 119 | [ -n "$JAVA_HOME" ] && 120 | JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" 121 | fi 122 | 123 | if [ -z "$JAVA_HOME" ]; then 124 | javaExecutable="`which javac`" 125 | if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then 126 | # readlink(1) is not available as standard on Solaris 10. 127 | readLink=`which readlink` 128 | if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then 129 | if $darwin ; then 130 | javaHome="`dirname \"$javaExecutable\"`" 131 | javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" 132 | else 133 | javaExecutable="`readlink -f \"$javaExecutable\"`" 134 | fi 135 | javaHome="`dirname \"$javaExecutable\"`" 136 | javaHome=`expr "$javaHome" : '\(.*\)/bin'` 137 | JAVA_HOME="$javaHome" 138 | export JAVA_HOME 139 | fi 140 | fi 141 | fi 142 | 143 | if [ -z "$JAVACMD" ] ; then 144 | if [ -n "$JAVA_HOME" ] ; then 145 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 146 | # IBM's JDK on AIX uses strange locations for the executables 147 | JAVACMD="$JAVA_HOME/jre/sh/java" 148 | else 149 | JAVACMD="$JAVA_HOME/bin/java" 150 | fi 151 | else 152 | JAVACMD="`\\unset -f command; \\command -v java`" 153 | fi 154 | fi 155 | 156 | if [ ! -x "$JAVACMD" ] ; then 157 | echo "Error: JAVA_HOME is not defined correctly." >&2 158 | echo " We cannot execute $JAVACMD" >&2 159 | exit 1 160 | fi 161 | 162 | if [ -z "$JAVA_HOME" ] ; then 163 | echo "Warning: JAVA_HOME environment variable is not set." 164 | fi 165 | 166 | CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher 167 | 168 | # traverses directory structure from process work directory to filesystem root 169 | # first directory with .mvn subdirectory is considered project base directory 170 | find_maven_basedir() { 171 | 172 | if [ -z "$1" ] 173 | then 174 | echo "Path not specified to find_maven_basedir" 175 | return 1 176 | fi 177 | 178 | basedir="$1" 179 | wdir="$1" 180 | while [ "$wdir" != '/' ] ; do 181 | if [ -d "$wdir"/.mvn ] ; then 182 | basedir=$wdir 183 | break 184 | fi 185 | # workaround for JBEAP-8937 (on Solaris 10/Sparc) 186 | if [ -d "${wdir}" ]; then 187 | wdir=`cd "$wdir/.."; pwd` 188 | fi 189 | # end of workaround 190 | done 191 | echo "${basedir}" 192 | } 193 | 194 | # concatenates all lines of a file 195 | concat_lines() { 196 | if [ -f "$1" ]; then 197 | echo "$(tr -s '\n' ' ' < "$1")" 198 | fi 199 | } 200 | 201 | BASE_DIR=`find_maven_basedir "$(pwd)"` 202 | if [ -z "$BASE_DIR" ]; then 203 | exit 1; 204 | fi 205 | 206 | ########################################################################################## 207 | # Extension to allow automatically downloading the maven-wrapper.jar from Maven-central 208 | # This allows using the maven wrapper in projects that prohibit checking in binary data. 209 | ########################################################################################## 210 | if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then 211 | if [ "$MVNW_VERBOSE" = true ]; then 212 | echo "Found .mvn/wrapper/maven-wrapper.jar" 213 | fi 214 | else 215 | if [ "$MVNW_VERBOSE" = true ]; then 216 | echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." 217 | fi 218 | if [ -n "$MVNW_REPOURL" ]; then 219 | jarUrl="$MVNW_REPOURL/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar" 220 | else 221 | jarUrl="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar" 222 | fi 223 | while IFS="=" read key value; do 224 | case "$key" in (wrapperUrl) jarUrl="$value"; break ;; 225 | esac 226 | done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" 227 | if [ "$MVNW_VERBOSE" = true ]; then 228 | echo "Downloading from: $jarUrl" 229 | fi 230 | wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" 231 | if $cygwin; then 232 | wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"` 233 | fi 234 | 235 | if command -v wget > /dev/null; then 236 | if [ "$MVNW_VERBOSE" = true ]; then 237 | echo "Found wget ... using wget" 238 | fi 239 | if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then 240 | wget "$jarUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath" 241 | else 242 | wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath" 243 | fi 244 | elif command -v curl > /dev/null; then 245 | if [ "$MVNW_VERBOSE" = true ]; then 246 | echo "Found curl ... using curl" 247 | fi 248 | if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then 249 | curl -o "$wrapperJarPath" "$jarUrl" -f 250 | else 251 | curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f 252 | fi 253 | 254 | else 255 | if [ "$MVNW_VERBOSE" = true ]; then 256 | echo "Falling back to using Java to download" 257 | fi 258 | javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" 259 | # For Cygwin, switch paths to Windows format before running javac 260 | if $cygwin; then 261 | javaClass=`cygpath --path --windows "$javaClass"` 262 | fi 263 | if [ -e "$javaClass" ]; then 264 | if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then 265 | if [ "$MVNW_VERBOSE" = true ]; then 266 | echo " - Compiling MavenWrapperDownloader.java ..." 267 | fi 268 | # Compiling the Java class 269 | ("$JAVA_HOME/bin/javac" "$javaClass") 270 | fi 271 | if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then 272 | # Running the downloader 273 | if [ "$MVNW_VERBOSE" = true ]; then 274 | echo " - Running MavenWrapperDownloader.java ..." 275 | fi 276 | ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") 277 | fi 278 | fi 279 | fi 280 | fi 281 | ########################################################################################## 282 | # End of extension 283 | ########################################################################################## 284 | 285 | export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} 286 | if [ "$MVNW_VERBOSE" = true ]; then 287 | echo $MAVEN_PROJECTBASEDIR 288 | fi 289 | MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" 290 | 291 | # For Cygwin, switch paths to Windows format before running java 292 | if $cygwin; then 293 | [ -n "$M2_HOME" ] && 294 | M2_HOME=`cygpath --path --windows "$M2_HOME"` 295 | [ -n "$JAVA_HOME" ] && 296 | JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` 297 | [ -n "$CLASSPATH" ] && 298 | CLASSPATH=`cygpath --path --windows "$CLASSPATH"` 299 | [ -n "$MAVEN_PROJECTBASEDIR" ] && 300 | MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` 301 | fi 302 | 303 | # Provide a "standardized" way to retrieve the CLI args that will 304 | # work with both Windows and non-Windows executions. 305 | MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" 306 | export MAVEN_CMD_LINE_ARGS 307 | 308 | WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain 309 | 310 | exec "$JAVACMD" \ 311 | $MAVEN_OPTS \ 312 | $MAVEN_DEBUG_OPTS \ 313 | -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ 314 | "-Dmaven.home=${M2_HOME}" \ 315 | "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ 316 | ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" 317 | -------------------------------------------------------------------------------- /SpringBootAssign1/mvnw: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # ---------------------------------------------------------------------------- 3 | # Licensed to the Apache Software Foundation (ASF) under one 4 | # or more contributor license agreements. See the NOTICE file 5 | # distributed with this work for additional information 6 | # regarding copyright ownership. The ASF licenses this file 7 | # to you under the Apache License, Version 2.0 (the 8 | # "License"); you may not use this file except in compliance 9 | # with the License. You may obtain a copy of the License at 10 | # 11 | # https://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, 14 | # software distributed under the License is distributed on an 15 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | # KIND, either express or implied. See the License for the 17 | # specific language governing permissions and limitations 18 | # under the License. 19 | # ---------------------------------------------------------------------------- 20 | 21 | # ---------------------------------------------------------------------------- 22 | # Maven Start Up Batch script 23 | # 24 | # Required ENV vars: 25 | # ------------------ 26 | # JAVA_HOME - location of a JDK home dir 27 | # 28 | # Optional ENV vars 29 | # ----------------- 30 | # M2_HOME - location of maven2's installed home dir 31 | # MAVEN_OPTS - parameters passed to the Java VM when running Maven 32 | # e.g. to debug Maven itself, use 33 | # set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 34 | # MAVEN_SKIP_RC - flag to disable loading of mavenrc files 35 | # ---------------------------------------------------------------------------- 36 | 37 | if [ -z "$MAVEN_SKIP_RC" ] ; then 38 | 39 | if [ -f /usr/local/etc/mavenrc ] ; then 40 | . /usr/local/etc/mavenrc 41 | fi 42 | 43 | if [ -f /etc/mavenrc ] ; then 44 | . /etc/mavenrc 45 | fi 46 | 47 | if [ -f "$HOME/.mavenrc" ] ; then 48 | . "$HOME/.mavenrc" 49 | fi 50 | 51 | fi 52 | 53 | # OS specific support. $var _must_ be set to either true or false. 54 | cygwin=false; 55 | darwin=false; 56 | mingw=false 57 | case "`uname`" in 58 | CYGWIN*) cygwin=true ;; 59 | MINGW*) mingw=true;; 60 | Darwin*) darwin=true 61 | # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home 62 | # See https://developer.apple.com/library/mac/qa/qa1170/_index.html 63 | if [ -z "$JAVA_HOME" ]; then 64 | if [ -x "/usr/libexec/java_home" ]; then 65 | export JAVA_HOME="`/usr/libexec/java_home`" 66 | else 67 | export JAVA_HOME="/Library/Java/Home" 68 | fi 69 | fi 70 | ;; 71 | esac 72 | 73 | if [ -z "$JAVA_HOME" ] ; then 74 | if [ -r /etc/gentoo-release ] ; then 75 | JAVA_HOME=`java-config --jre-home` 76 | fi 77 | fi 78 | 79 | if [ -z "$M2_HOME" ] ; then 80 | ## resolve links - $0 may be a link to maven's home 81 | PRG="$0" 82 | 83 | # need this for relative symlinks 84 | while [ -h "$PRG" ] ; do 85 | ls=`ls -ld "$PRG"` 86 | link=`expr "$ls" : '.*-> \(.*\)$'` 87 | if expr "$link" : '/.*' > /dev/null; then 88 | PRG="$link" 89 | else 90 | PRG="`dirname "$PRG"`/$link" 91 | fi 92 | done 93 | 94 | saveddir=`pwd` 95 | 96 | M2_HOME=`dirname "$PRG"`/.. 97 | 98 | # make it fully qualified 99 | M2_HOME=`cd "$M2_HOME" && pwd` 100 | 101 | cd "$saveddir" 102 | # echo Using m2 at $M2_HOME 103 | fi 104 | 105 | # For Cygwin, ensure paths are in UNIX format before anything is touched 106 | if $cygwin ; then 107 | [ -n "$M2_HOME" ] && 108 | M2_HOME=`cygpath --unix "$M2_HOME"` 109 | [ -n "$JAVA_HOME" ] && 110 | JAVA_HOME=`cygpath --unix "$JAVA_HOME"` 111 | [ -n "$CLASSPATH" ] && 112 | CLASSPATH=`cygpath --path --unix "$CLASSPATH"` 113 | fi 114 | 115 | # For Mingw, ensure paths are in UNIX format before anything is touched 116 | if $mingw ; then 117 | [ -n "$M2_HOME" ] && 118 | M2_HOME="`(cd "$M2_HOME"; pwd)`" 119 | [ -n "$JAVA_HOME" ] && 120 | JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" 121 | fi 122 | 123 | if [ -z "$JAVA_HOME" ]; then 124 | javaExecutable="`which javac`" 125 | if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then 126 | # readlink(1) is not available as standard on Solaris 10. 127 | readLink=`which readlink` 128 | if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then 129 | if $darwin ; then 130 | javaHome="`dirname \"$javaExecutable\"`" 131 | javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" 132 | else 133 | javaExecutable="`readlink -f \"$javaExecutable\"`" 134 | fi 135 | javaHome="`dirname \"$javaExecutable\"`" 136 | javaHome=`expr "$javaHome" : '\(.*\)/bin'` 137 | JAVA_HOME="$javaHome" 138 | export JAVA_HOME 139 | fi 140 | fi 141 | fi 142 | 143 | if [ -z "$JAVACMD" ] ; then 144 | if [ -n "$JAVA_HOME" ] ; then 145 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 146 | # IBM's JDK on AIX uses strange locations for the executables 147 | JAVACMD="$JAVA_HOME/jre/sh/java" 148 | else 149 | JAVACMD="$JAVA_HOME/bin/java" 150 | fi 151 | else 152 | JAVACMD="`\\unset -f command; \\command -v java`" 153 | fi 154 | fi 155 | 156 | if [ ! -x "$JAVACMD" ] ; then 157 | echo "Error: JAVA_HOME is not defined correctly." >&2 158 | echo " We cannot execute $JAVACMD" >&2 159 | exit 1 160 | fi 161 | 162 | if [ -z "$JAVA_HOME" ] ; then 163 | echo "Warning: JAVA_HOME environment variable is not set." 164 | fi 165 | 166 | CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher 167 | 168 | # traverses directory structure from process work directory to filesystem root 169 | # first directory with .mvn subdirectory is considered project base directory 170 | find_maven_basedir() { 171 | 172 | if [ -z "$1" ] 173 | then 174 | echo "Path not specified to find_maven_basedir" 175 | return 1 176 | fi 177 | 178 | basedir="$1" 179 | wdir="$1" 180 | while [ "$wdir" != '/' ] ; do 181 | if [ -d "$wdir"/.mvn ] ; then 182 | basedir=$wdir 183 | break 184 | fi 185 | # workaround for JBEAP-8937 (on Solaris 10/Sparc) 186 | if [ -d "${wdir}" ]; then 187 | wdir=`cd "$wdir/.."; pwd` 188 | fi 189 | # end of workaround 190 | done 191 | echo "${basedir}" 192 | } 193 | 194 | # concatenates all lines of a file 195 | concat_lines() { 196 | if [ -f "$1" ]; then 197 | echo "$(tr -s '\n' ' ' < "$1")" 198 | fi 199 | } 200 | 201 | BASE_DIR=`find_maven_basedir "$(pwd)"` 202 | if [ -z "$BASE_DIR" ]; then 203 | exit 1; 204 | fi 205 | 206 | ########################################################################################## 207 | # Extension to allow automatically downloading the maven-wrapper.jar from Maven-central 208 | # This allows using the maven wrapper in projects that prohibit checking in binary data. 209 | ########################################################################################## 210 | if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then 211 | if [ "$MVNW_VERBOSE" = true ]; then 212 | echo "Found .mvn/wrapper/maven-wrapper.jar" 213 | fi 214 | else 215 | if [ "$MVNW_VERBOSE" = true ]; then 216 | echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." 217 | fi 218 | if [ -n "$MVNW_REPOURL" ]; then 219 | jarUrl="$MVNW_REPOURL/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar" 220 | else 221 | jarUrl="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar" 222 | fi 223 | while IFS="=" read key value; do 224 | case "$key" in (wrapperUrl) jarUrl="$value"; break ;; 225 | esac 226 | done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" 227 | if [ "$MVNW_VERBOSE" = true ]; then 228 | echo "Downloading from: $jarUrl" 229 | fi 230 | wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" 231 | if $cygwin; then 232 | wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"` 233 | fi 234 | 235 | if command -v wget > /dev/null; then 236 | if [ "$MVNW_VERBOSE" = true ]; then 237 | echo "Found wget ... using wget" 238 | fi 239 | if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then 240 | wget "$jarUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath" 241 | else 242 | wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath" 243 | fi 244 | elif command -v curl > /dev/null; then 245 | if [ "$MVNW_VERBOSE" = true ]; then 246 | echo "Found curl ... using curl" 247 | fi 248 | if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then 249 | curl -o "$wrapperJarPath" "$jarUrl" -f 250 | else 251 | curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f 252 | fi 253 | 254 | else 255 | if [ "$MVNW_VERBOSE" = true ]; then 256 | echo "Falling back to using Java to download" 257 | fi 258 | javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" 259 | # For Cygwin, switch paths to Windows format before running javac 260 | if $cygwin; then 261 | javaClass=`cygpath --path --windows "$javaClass"` 262 | fi 263 | if [ -e "$javaClass" ]; then 264 | if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then 265 | if [ "$MVNW_VERBOSE" = true ]; then 266 | echo " - Compiling MavenWrapperDownloader.java ..." 267 | fi 268 | # Compiling the Java class 269 | ("$JAVA_HOME/bin/javac" "$javaClass") 270 | fi 271 | if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then 272 | # Running the downloader 273 | if [ "$MVNW_VERBOSE" = true ]; then 274 | echo " - Running MavenWrapperDownloader.java ..." 275 | fi 276 | ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") 277 | fi 278 | fi 279 | fi 280 | fi 281 | ########################################################################################## 282 | # End of extension 283 | ########################################################################################## 284 | 285 | export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} 286 | if [ "$MVNW_VERBOSE" = true ]; then 287 | echo $MAVEN_PROJECTBASEDIR 288 | fi 289 | MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" 290 | 291 | # For Cygwin, switch paths to Windows format before running java 292 | if $cygwin; then 293 | [ -n "$M2_HOME" ] && 294 | M2_HOME=`cygpath --path --windows "$M2_HOME"` 295 | [ -n "$JAVA_HOME" ] && 296 | JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` 297 | [ -n "$CLASSPATH" ] && 298 | CLASSPATH=`cygpath --path --windows "$CLASSPATH"` 299 | [ -n "$MAVEN_PROJECTBASEDIR" ] && 300 | MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` 301 | fi 302 | 303 | # Provide a "standardized" way to retrieve the CLI args that will 304 | # work with both Windows and non-Windows executions. 305 | MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" 306 | export MAVEN_CMD_LINE_ARGS 307 | 308 | WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain 309 | 310 | exec "$JAVACMD" \ 311 | $MAVEN_OPTS \ 312 | $MAVEN_DEBUG_OPTS \ 313 | -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ 314 | "-Dmaven.home=${M2_HOME}" \ 315 | "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ 316 | ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" 317 | -------------------------------------------------------------------------------- /SpringBootImageGallery/mvnw: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # ---------------------------------------------------------------------------- 3 | # Licensed to the Apache Software Foundation (ASF) under one 4 | # or more contributor license agreements. See the NOTICE file 5 | # distributed with this work for additional information 6 | # regarding copyright ownership. The ASF licenses this file 7 | # to you under the Apache License, Version 2.0 (the 8 | # "License"); you may not use this file except in compliance 9 | # with the License. You may obtain a copy of the License at 10 | # 11 | # https://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, 14 | # software distributed under the License is distributed on an 15 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | # KIND, either express or implied. See the License for the 17 | # specific language governing permissions and limitations 18 | # under the License. 19 | # ---------------------------------------------------------------------------- 20 | 21 | # ---------------------------------------------------------------------------- 22 | # Maven Start Up Batch script 23 | # 24 | # Required ENV vars: 25 | # ------------------ 26 | # JAVA_HOME - location of a JDK home dir 27 | # 28 | # Optional ENV vars 29 | # ----------------- 30 | # M2_HOME - location of maven2's installed home dir 31 | # MAVEN_OPTS - parameters passed to the Java VM when running Maven 32 | # e.g. to debug Maven itself, use 33 | # set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 34 | # MAVEN_SKIP_RC - flag to disable loading of mavenrc files 35 | # ---------------------------------------------------------------------------- 36 | 37 | if [ -z "$MAVEN_SKIP_RC" ] ; then 38 | 39 | if [ -f /usr/local/etc/mavenrc ] ; then 40 | . /usr/local/etc/mavenrc 41 | fi 42 | 43 | if [ -f /etc/mavenrc ] ; then 44 | . /etc/mavenrc 45 | fi 46 | 47 | if [ -f "$HOME/.mavenrc" ] ; then 48 | . "$HOME/.mavenrc" 49 | fi 50 | 51 | fi 52 | 53 | # OS specific support. $var _must_ be set to either true or false. 54 | cygwin=false; 55 | darwin=false; 56 | mingw=false 57 | case "`uname`" in 58 | CYGWIN*) cygwin=true ;; 59 | MINGW*) mingw=true;; 60 | Darwin*) darwin=true 61 | # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home 62 | # See https://developer.apple.com/library/mac/qa/qa1170/_index.html 63 | if [ -z "$JAVA_HOME" ]; then 64 | if [ -x "/usr/libexec/java_home" ]; then 65 | export JAVA_HOME="`/usr/libexec/java_home`" 66 | else 67 | export JAVA_HOME="/Library/Java/Home" 68 | fi 69 | fi 70 | ;; 71 | esac 72 | 73 | if [ -z "$JAVA_HOME" ] ; then 74 | if [ -r /etc/gentoo-release ] ; then 75 | JAVA_HOME=`java-config --jre-home` 76 | fi 77 | fi 78 | 79 | if [ -z "$M2_HOME" ] ; then 80 | ## resolve links - $0 may be a link to maven's home 81 | PRG="$0" 82 | 83 | # need this for relative symlinks 84 | while [ -h "$PRG" ] ; do 85 | ls=`ls -ld "$PRG"` 86 | link=`expr "$ls" : '.*-> \(.*\)$'` 87 | if expr "$link" : '/.*' > /dev/null; then 88 | PRG="$link" 89 | else 90 | PRG="`dirname "$PRG"`/$link" 91 | fi 92 | done 93 | 94 | saveddir=`pwd` 95 | 96 | M2_HOME=`dirname "$PRG"`/.. 97 | 98 | # make it fully qualified 99 | M2_HOME=`cd "$M2_HOME" && pwd` 100 | 101 | cd "$saveddir" 102 | # echo Using m2 at $M2_HOME 103 | fi 104 | 105 | # For Cygwin, ensure paths are in UNIX format before anything is touched 106 | if $cygwin ; then 107 | [ -n "$M2_HOME" ] && 108 | M2_HOME=`cygpath --unix "$M2_HOME"` 109 | [ -n "$JAVA_HOME" ] && 110 | JAVA_HOME=`cygpath --unix "$JAVA_HOME"` 111 | [ -n "$CLASSPATH" ] && 112 | CLASSPATH=`cygpath --path --unix "$CLASSPATH"` 113 | fi 114 | 115 | # For Mingw, ensure paths are in UNIX format before anything is touched 116 | if $mingw ; then 117 | [ -n "$M2_HOME" ] && 118 | M2_HOME="`(cd "$M2_HOME"; pwd)`" 119 | [ -n "$JAVA_HOME" ] && 120 | JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" 121 | fi 122 | 123 | if [ -z "$JAVA_HOME" ]; then 124 | javaExecutable="`which javac`" 125 | if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then 126 | # readlink(1) is not available as standard on Solaris 10. 127 | readLink=`which readlink` 128 | if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then 129 | if $darwin ; then 130 | javaHome="`dirname \"$javaExecutable\"`" 131 | javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" 132 | else 133 | javaExecutable="`readlink -f \"$javaExecutable\"`" 134 | fi 135 | javaHome="`dirname \"$javaExecutable\"`" 136 | javaHome=`expr "$javaHome" : '\(.*\)/bin'` 137 | JAVA_HOME="$javaHome" 138 | export JAVA_HOME 139 | fi 140 | fi 141 | fi 142 | 143 | if [ -z "$JAVACMD" ] ; then 144 | if [ -n "$JAVA_HOME" ] ; then 145 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 146 | # IBM's JDK on AIX uses strange locations for the executables 147 | JAVACMD="$JAVA_HOME/jre/sh/java" 148 | else 149 | JAVACMD="$JAVA_HOME/bin/java" 150 | fi 151 | else 152 | JAVACMD="`\\unset -f command; \\command -v java`" 153 | fi 154 | fi 155 | 156 | if [ ! -x "$JAVACMD" ] ; then 157 | echo "Error: JAVA_HOME is not defined correctly." >&2 158 | echo " We cannot execute $JAVACMD" >&2 159 | exit 1 160 | fi 161 | 162 | if [ -z "$JAVA_HOME" ] ; then 163 | echo "Warning: JAVA_HOME environment variable is not set." 164 | fi 165 | 166 | CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher 167 | 168 | # traverses directory structure from process work directory to filesystem root 169 | # first directory with .mvn subdirectory is considered project base directory 170 | find_maven_basedir() { 171 | 172 | if [ -z "$1" ] 173 | then 174 | echo "Path not specified to find_maven_basedir" 175 | return 1 176 | fi 177 | 178 | basedir="$1" 179 | wdir="$1" 180 | while [ "$wdir" != '/' ] ; do 181 | if [ -d "$wdir"/.mvn ] ; then 182 | basedir=$wdir 183 | break 184 | fi 185 | # workaround for JBEAP-8937 (on Solaris 10/Sparc) 186 | if [ -d "${wdir}" ]; then 187 | wdir=`cd "$wdir/.."; pwd` 188 | fi 189 | # end of workaround 190 | done 191 | echo "${basedir}" 192 | } 193 | 194 | # concatenates all lines of a file 195 | concat_lines() { 196 | if [ -f "$1" ]; then 197 | echo "$(tr -s '\n' ' ' < "$1")" 198 | fi 199 | } 200 | 201 | BASE_DIR=`find_maven_basedir "$(pwd)"` 202 | if [ -z "$BASE_DIR" ]; then 203 | exit 1; 204 | fi 205 | 206 | ########################################################################################## 207 | # Extension to allow automatically downloading the maven-wrapper.jar from Maven-central 208 | # This allows using the maven wrapper in projects that prohibit checking in binary data. 209 | ########################################################################################## 210 | if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then 211 | if [ "$MVNW_VERBOSE" = true ]; then 212 | echo "Found .mvn/wrapper/maven-wrapper.jar" 213 | fi 214 | else 215 | if [ "$MVNW_VERBOSE" = true ]; then 216 | echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." 217 | fi 218 | if [ -n "$MVNW_REPOURL" ]; then 219 | jarUrl="$MVNW_REPOURL/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar" 220 | else 221 | jarUrl="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar" 222 | fi 223 | while IFS="=" read key value; do 224 | case "$key" in (wrapperUrl) jarUrl="$value"; break ;; 225 | esac 226 | done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" 227 | if [ "$MVNW_VERBOSE" = true ]; then 228 | echo "Downloading from: $jarUrl" 229 | fi 230 | wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" 231 | if $cygwin; then 232 | wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"` 233 | fi 234 | 235 | if command -v wget > /dev/null; then 236 | if [ "$MVNW_VERBOSE" = true ]; then 237 | echo "Found wget ... using wget" 238 | fi 239 | if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then 240 | wget "$jarUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath" 241 | else 242 | wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath" 243 | fi 244 | elif command -v curl > /dev/null; then 245 | if [ "$MVNW_VERBOSE" = true ]; then 246 | echo "Found curl ... using curl" 247 | fi 248 | if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then 249 | curl -o "$wrapperJarPath" "$jarUrl" -f 250 | else 251 | curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f 252 | fi 253 | 254 | else 255 | if [ "$MVNW_VERBOSE" = true ]; then 256 | echo "Falling back to using Java to download" 257 | fi 258 | javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" 259 | # For Cygwin, switch paths to Windows format before running javac 260 | if $cygwin; then 261 | javaClass=`cygpath --path --windows "$javaClass"` 262 | fi 263 | if [ -e "$javaClass" ]; then 264 | if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then 265 | if [ "$MVNW_VERBOSE" = true ]; then 266 | echo " - Compiling MavenWrapperDownloader.java ..." 267 | fi 268 | # Compiling the Java class 269 | ("$JAVA_HOME/bin/javac" "$javaClass") 270 | fi 271 | if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then 272 | # Running the downloader 273 | if [ "$MVNW_VERBOSE" = true ]; then 274 | echo " - Running MavenWrapperDownloader.java ..." 275 | fi 276 | ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") 277 | fi 278 | fi 279 | fi 280 | fi 281 | ########################################################################################## 282 | # End of extension 283 | ########################################################################################## 284 | 285 | export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} 286 | if [ "$MVNW_VERBOSE" = true ]; then 287 | echo $MAVEN_PROJECTBASEDIR 288 | fi 289 | MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" 290 | 291 | # For Cygwin, switch paths to Windows format before running java 292 | if $cygwin; then 293 | [ -n "$M2_HOME" ] && 294 | M2_HOME=`cygpath --path --windows "$M2_HOME"` 295 | [ -n "$JAVA_HOME" ] && 296 | JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` 297 | [ -n "$CLASSPATH" ] && 298 | CLASSPATH=`cygpath --path --windows "$CLASSPATH"` 299 | [ -n "$MAVEN_PROJECTBASEDIR" ] && 300 | MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` 301 | fi 302 | 303 | # Provide a "standardized" way to retrieve the CLI args that will 304 | # work with both Windows and non-Windows executions. 305 | MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" 306 | export MAVEN_CMD_LINE_ARGS 307 | 308 | WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain 309 | 310 | exec "$JAVACMD" \ 311 | $MAVEN_OPTS \ 312 | $MAVEN_DEBUG_OPTS \ 313 | -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ 314 | "-Dmaven.home=${M2_HOME}" \ 315 | "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ 316 | ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" 317 | --------------------------------------------------------------------------------