How to read and write a CSV file using Apache Commons CSV
gradle testA quick review to the java.util.Date API in Java 8
javac BetweenDays.java
java BetweenDays
javac DateOperations.java
java DateOperationsHow to read an Excel file using Apache POI
gradle testHow to read filtered rows in Excel file using Apache POI
gradle testHello World using AWS Lambda
gradle buildJarSince Java 7 we can copy files in a easy way
javac FileCopier.java
java FileCopierGeneric configuration interface which enables a Java application to read configuration data
gradle buildJarjava -jar properties-apache-commons-all-0.0.1.jarRead and copy files using AWS Lambda
gradle buildZipaws lambda invoke \
--invocation-type Event \
--function-name s3-aws-lambda \
--region us-west-1 \
--payload file://inputfile.txt \
outputfile.txtIn your computer's home directory: ${home}, create a directory called: .mailbox-reader then inside create a file called application.properties with this content
username=user@gmail.com
password=secret
pop3.server=pop.gmail.com
pop3.port=995
imap.server=imap.gmail.com
imap.port=993
ews.username=user@outlook.com
ews.password=secret
ews.server=https://exchange/EWS/Exchange.asmx
ews.protocol=https://gradle build java -jar mailbox-reader-0.0.1-SNAPSHOT.jar- This approach is using Gmail account with IMAP enabled (Settings > Forwarding and POP/IMAP)
- Using Exchange Web Services EWS Java API
- Read body email usgin text/plain as ContentType
- Read body email using multipart/mixed as ContenType
- http://josdem.io/techtalk/camel/mailbox_reader/
- http://josdem.io/techtalk/java/mailbox_reader_pop3/
- http://josdem.io/techtalk/java/mailbox_reader_imap/
- http://josdem.io/techtalk/java/mailbox_reader_exchange/
- http://josdem.io/techtalk/spring/spring_unit_testing_spock/
- http://josdem.io/techtalk/spring/spring_boot/
- http://josdem.io/techtalk/spring/spring_gradle/
Stream interface is defined in java.util.stream package. In Java 8, collections will start having methods that return Stream. Streams support Aggregate Operations. The common aggregate operations are filter, map, reduce, find, match and sort.
javac ${JAVA_PROGRAM}.java
java -ea ${JAVA_PROGRAM}A stream represents a sequence of elements and supports different operations to perform calculations in those elements, here we review the filters:
javac ${JAVA_PROGRAM}.java
java -ea ${JAVA_PROGRAM}How use collectors over streams to group by, concatenate, map and list.
javac ${JAVA_PROGRAM}.java
java -ea ${JAVA_PROGRAM}How use Executors, Callable and Futures
javac ${JAVA_PROGRAM}.java
java ${JAVA_PROGRAM}How we can use Generics in Java.
To run the code:
javac ${JAVA_PROGRAM}.java
java -ea ${JAVA_PROGRAM}To test the code:
gradle testA functional interface in Java is any with @FunctionalInterface annotation and with SAM(Single Abstract Method). It was introduced to facilitate Lambda expressions. Since a lambda function can only provide the implementation for one method, it is mandatory for the functional interfaces to have only one abstract method.
javac ConsumerExample.java
java ConsumerExamplegradle testmvn testSince Java 8 we have Lambda expressions which is a function defined under some interface contract and the main purpose is to implement functional programming in Java.
gradle testmvn testOnce called a Billion-dollar mistake. NullPointerException is by far one of the most frequent exceptions in Java and since version 8 we can use it as a way to avoid this exception. Optional is a container that can has a value or not.
gradle test