Today's Question:  What does your personal desk look like?        GIVE A SHOUT

 PROGRAMMING


  A HTTPS client and HTTPS server demo in Java

In this post, I will create a HTTPS server and HTTPS client demo which can establish HTTPS communication between a server and a client using Java. This should be very useful when we want to test our understanding about SSL communication. We will use both a detailed SSL client and a simple HttpsURLConnection as the HTTPS client.Before creating the actual HTTPS server and HTTPS client, we first need to generate the keystore and truststore to be used by the server and client. To generate the keystore, we can follow instructions at Different types of keystore in Java -- JKS. In this demo, we ...

69,621 5       JAVA SSL DEMO HTTPS


  The Greatest Regex Trick Ever (Simplified)

There is a post which is really hot recently which showcased a best ever regular expression trick. In this post, it provides a trick which can be adapted to situations where one wants to match some patterns desired and exclude the patterns undesired. In simple, the trick is :Pattern not desired | (Pattern desired)Then taking the group 1 match of the capturing group of matched. This group will contain the strings matching the desired patterns.Have to say this trick is really neat and brilliant. Here is a simple explanation on how this works. The above regular expression will first try to m...

4,855 0       JAVA PROGRAMMING REGULAR EXPRESSION


  How Java Application Developers Can Build Secure Internet Based Apps?

There are few compiled solution tested by experts to guide Java application development and maintenance team how they can start safe journey on Internet. Strong encryption, wise passwords, secure hardware are few of the tech tools that should be used by Java app development team to secure their Internet based apps. The Internet is most amazing yet most risky platform where nobody knows either they are doing safe transaction on Internet or there is some dog watching out for data packets that are exchanged by you over web. So we cannot be sure that we are safe every time we are using Intern...

5,052 0       JAVA APPLICATION DEVELOPMENT JAVA APPLICATION MAINTENANCE


  Set file permission in Java

Prior to Java 6,  there is no good solution at the Java level to provide file permission management. You need to implement your own native methods or call the Runtime.exec() to invoke the system routine such as chmod in LInux. Since Java 6, Java introduces a set of methods which can be used to set the file permission at Java level. These methods include:File.setReadable(boolean);File.setWritable(boolean);FIle.setExecutable(boolean);File.setReadable(boolean, boolean);File.setWritable(boolean, boolean);FIle.setExecutable(boolean, boolean);Here File.setReadable(boolean, true) is the same as ...

27,116 0       JAVA FILE PERMISSION POSIX LEARNJAVA


  A simple tutorial on writing Java native program

Java provides Java Native Interface(JNI) to enable developers to write programs which can utilize the underlying native libraries of the operating system. The benefits of writing native code are that they normally provide better performance compared to Java codes. Sometimes if you want to utilize some system specific functions you may also want to use JNI. One main drawback of writing native code is that your application may not be platform independent anymore. This is not what Java is designed for.Today we will show you a small tutorial on how to write a Java program calling native code....

5,393 0       SAMPLE JAVA NATIVE INTERFACE JNI NATIVE CODE


  Java Cipher encryption/decryption example

In Java, Cipher is the API for doing data encryption/decryption. Many cryptographic algorithms such as AES, DES, RC4 etc can be specified when creating Cipher instance. The Cipher instance calls the underlying algorithm specific implementation to do the actual encryption/decryption. Before doing the encryption/decryption, a key needs to be created and it will be used to do the encryption/decryption. A sample program for performing all these is :import java.security.Key;import javax.crypto.Cipher;import javax.crypto.KeyGenerator;public class CipherSample { public static void main(String[] ...

30,272 1       JAVA EXAMPLE JAVA SECURITY CIPHER SAMPLE


  Top 5 Hot WordPress Social Media Plugins

Social media has become a great need for businesses as well as personal brands in order to carve a vital presence over web. It has become necessary for everyone to have an energetic presence in social networks like Facebook, Twitter, Linkedin, and Youtube etc. Having a great virtual persona, you can be in constant touch with your followers. If you are using a platform like a WordPress then there is a great pool of social media plugins. Some of its plugins are free to download and others are paid. Following, I am giving you 5 hottest wordpress media plugins which will convert your average ratin...

9,374 1       CUSTOM WORDPRESS DEVELOPMENT


  ByteBuffer in Java

ByteBuffer is introduced in java.nio since Java 1.4. It provides a way of representing raw structured data such as from a file or from network. It enables fast access of underlying data compared to traditional ways like byte[]Prior to Java 1.4, if you want to represent a structured raw data, you need to create a byte[] and then having a set of checks to delimit the byte array to get the expected tokens.There are three ways to create a ByteBuffer:Wrapping an exiting array by calling ByteBuffer.wrap();Creating an empty buffer with capacity by calling ByteBuffer.allocate();Creating an direct empt...

3,227 0       JAVA BYTEBUFFER ALLOCATION