Answers for "smtp url example"

0

smtp url example

class Demo { 
  public static void main( String ... args ) throws Exception  { 
    System.out.println( inspect( new URI("smtp://user:port@host:25")));
  }
  // invoke all the getXyz methods on object and construct 
  // a string with the result. 
  private static String inspect( Object o ) throws Exception  { 
    StringBuilder builder = new StringBuilder();
    for( Method m : o.getClass().getMethods() ) { 
      String name = m.getName();
      if( name.startsWith("get")) { 
        builder.append( name )
        .append(" = " )
        .append( m.invoke( o ) )
        .append( "\n" );
      }
    }
    return builder.toString();
  }
}
Posted by: Guest on October-26-2021

Browse Popular Code Answers by Language