Email validation in java code


/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author A
 */
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class EmailValidate

    {
    public static void main(String args[]) throws IOException
    {
        InputStreamReader isr = new InputStreamReader(System.in);
        BufferedReader br = new BufferedReader(isr);
        String email;
        boolean status = true;

        System.out.print("Enter your email address : ");
        email = br.readLine();

        char firstCharacter = email.charAt(0);

        if( ! Character.isLetter(firstCharacter))
        {
               System.out.println("Invalid Email ! First character must be a letter !");
               status = false;
        }

       if(email.indexOf('@') < 0)
       {
            System.out.println("Invalid Email ! '@' is not present !!!");
            status = false;
       }

       else if( email.indexOf('@') != email.lastIndexOf('@') )
       {
           System.out.println("Cannot Have more than one '@' characters !!!");
           status = false;
       }

        if(email.indexOf('.') < 0)
       {
            System.out.println("Invalid Email ! '.' is not present !!!");
            status = false;
       }

       else if( email.indexOf('.') != email.lastIndexOf('.') )
       {
           System.out.println("Cannot Have more than one '.' characters !!!");
           status = false;
       }
       if((email.indexOf('@') > email.indexOf('.')) & status)
       {
           System.out.println("Invalid Email ! '@' should come before '.' ");
           status = false;

       }

       int indexAt = email.indexOf('@');
       int indexDot = email.indexOf('.');
       int length = email.length();

       if(indexDot == indexAt + 1)
       {
           System.out.println("No service provider spacefied ! Invalid email !");
           status = false;
       }
       if(indexDot+2 > length)
       {
           System.out.println("No Domain name specified ! Invalid email !");
           status = false;
       }

       if(status == true)
        {

            char userName [] = new char[indexAt];
            char service [] = new char[indexDot - indexAt - 1];
            char domain [] = new char[length - indexDot - 1];

            for(int iuser = 0; iuser< indexAt; iuser++)
                userName[iuser] = email.charAt(iuser);

            int slimit = 0;
            for(int iservice = indexAt+1; iservice< indexDot; iservice++)
            {
                service[slimit] = email.charAt(iservice);
                slimit++;

            }

            int dlimit = 0;
            for(int idomain = indexDot+1; idomain< 1;)
            {
                System.out.println("Invalid username !");
                status = false;
            }
            if(service.length < 1)
            {
                System.out.println("Invalid service provider !");
                status = false;
            }
            if(domain.length < 1)
            {
                System.out.println("Invalid Domain name !");
                status = false;
            }

       }
       if(status == true)
            System.out.println("Valid Email. Successfully Validated.");

    }
}