View RSS Feed

Apache Commons

Apache Commons lang, logging, HttpClient etc.

  1. Security aspects of server authentication

    by , 02-24-2012 at 07:04 PM
    To do communication with non-trusted web applications or websites, extra care shall be taken while using the default credentials. Activation of the preemptive authentication is done, or for a specific authentication when credentials have not been given explicitly and default credentials would be used by the host HttpClient so that to get authentication with the targeted site.


    To avoid giving the critical & sensitive credentials to some non-trustable website, you shall ...
  2. Preemptive Authentication

    by , 02-24-2012 at 07:03 PM
    Within HttpClient, preemptive authentication can be enabled. HttpClient sends the response of basic authentication before unauthorized is given by server, in preemptive authentication mode. This will be reducing overhead for connection making.
    To enable it, use this code.
    Java Code:
    client.getParams().setAuthenticationPreemptive(true);
    For preemptive authentication, default credentials are required to be set for proxy host or target. Preemptive authentication will ...
  3. HttpClient Exception handling

    by , 02-24-2012 at 07:01 PM
    Exception types which might be encountered to a HttpClient when HTTP methods are executed, are as following:

    1. protocol exceptions
    2. transport exceptions

    In regular use of the HttpClient, all these exceptions would not propagate to user. Internally handled exceptions by HttpClient have been marked as internal.

    I. Transport exceptions
    II. HTTP transport safety
    III. Protocol exceptions
    IV. Custom exception handler
    V. ...
  4. Apache Server Authentication

    by , 02-24-2012 at 07:00 PM
    Transparent mechanism is present in HttpClient for handling of the authentication. Login credentials are required for the development of application.

    • In HttpState instance, login credentials are being stored.
    • Use the setCredentials method to set these credentials.
    • Use the getCredentials method to retrieve these credentials.



    setDoAuthentication method is present in HttpMethod class. Automatic authorization is provided by it for the HttpClient. Changes ...
  5. Apache Commons HTTPClient

    by , 02-24-2012 at 06:59 PM
    The HTTP i.e. Hyper Text Transfer Protocol is one of the most significant & popular protocol nowadays. HTTP protocol’s role has been expanded by the network growth; web services and other network enable applications. Also, applications which need HTTP protocol are also increasing in number.

    Core functionality is being provided by the java.net package to access resources through HTTP. Full functionality is not provided by this package which is needed by applications. Apache Commons ...
  6. Apache IOUtils

    by , 02-24-2012 at 06:57 PM
    These utility methods are provided by the IOUtils:

    1. Reading
    2. Copying
    3. Writing

    Given methods work at:

    1. InputStream
    2. OutputStream
    3. Writer
    4. Reader

    Bytes would be read a URL by the help of this code and will make them printed.
    Java Code: This is the code to explain IOUtils
    InputStream in = new URL( "http://jakarta.apache.org" ).openStream();
     try {
       InputStreamReader inR = new InputStreamReader( in
    ...
    Categories
    Commons IO
  7. Apache Commons IO

    by , 02-24-2012 at 06:55 PM
    Commons IO is utilitie’s library to help for development of the IO functionality.
    Main six main areas are:

    • Utility classes – Performance of the common tasks with static methods.
    • Input - Reader implementations & useful input stream.
    • Output - Writer implementations & useful output stream.
    • Filters - File filters implementations.
    • Comparators - java.util.Comparator implementations for files
    • File Monitor - Component to monitor ...
    Categories
    Commons IO
  8. Apache Commons Collections

    by , 02-24-2012 at 06:54 PM
    Java Commons Collections Framework accelerates the Java applications development, being an empowered data structure. For collection handling, it has now taken a position of standard in Java.
    Java Collections provides implementations, new interfaces & utilities. They are built at JDK classes top. List of features of Java Collections is as following:

    • Bag interface consist of various copies for each object.
    • MapIterator is for iteration, on a Map.
    • Interface BidiMap is
    ...
  9. Apache Commons Lang

    by , 02-24-2012 at 06:51 PM
    Core classes manipulation methods are not provided by the Standard Java libraries. Extra methods provided by Apache Commons Lang are:

    For Java, these utilities are provided by the Apache Commons Lang.

    • Lang API
    • Numerical methods
    • String manipulation methods
    • Object reflection
    • Creation and serialization
    • Concurrency
    • System properties
    • Utilities for hashCode
    • Utilities for equals
    • Basic enhancements to java.util.Date
    • Utilities for toString
  10. Apache Commons

    by , 02-24-2012 at 06:48 PM
    Apache commons basic focus is at the Java components which are reusable. It is basically an apache project which consists of three parts.

    • The Commons Proper:

    Reusable Java component repository.
    • The Commons Sandbox :


    Workspace for developing java components.
    • The Commons Dormant :


    Sandbox component repository, which is not active currently.

    Major Principals of the Apache Commons Proper:
    • To create or
    ...
    Categories
    Commons Lang