You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ivy-commits@incubator.apache.org by xa...@apache.org on 2007/07/03 13:29:33 UTC

svn commit: r552835 - in /incubator/ivy/core/trunk/src/java/org/apache/ivy: plugins/repository/ssh/ util/ util/extendable/ util/filter/ util/url/

Author: xavier
Date: Tue Jul  3 06:29:32 2007
New Revision: 552835

URL: http://svn.apache.org/viewvc?view=rev&rev=552835
Log:
Javadoc improvements (IVY-544) (with contribution from Tjeerd Verhagen)

Modified:
    incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/ssh/AbstractSshBasedRepository.java
    incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/ssh/SshCache.java
    incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/ssh/SshRepository.java
    incubator/ivy/core/trunk/src/java/org/apache/ivy/util/ConfigurationUtils.java
    incubator/ivy/core/trunk/src/java/org/apache/ivy/util/FileUtil.java
    incubator/ivy/core/trunk/src/java/org/apache/ivy/util/StringUtils.java
    incubator/ivy/core/trunk/src/java/org/apache/ivy/util/extendable/ExtendableItem.java
    incubator/ivy/core/trunk/src/java/org/apache/ivy/util/filter/FilterHelper.java
    incubator/ivy/core/trunk/src/java/org/apache/ivy/util/url/URLHandler.java

Modified: incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/ssh/AbstractSshBasedRepository.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/ssh/AbstractSshBasedRepository.java?view=diff&rev=552835&r1=552834&r2=552835
==============================================================================
--- incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/ssh/AbstractSshBasedRepository.java (original)
+++ incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/ssh/AbstractSshBasedRepository.java Tue Jul  3 06:29:32 2007
@@ -119,9 +119,9 @@
     /**
      * closes the session and remove it from the cache (eg. on case of errors)
      * 
-     * @param uri
+     * @param session
      *            key for the cache
-     * @param conn
+     * @param pathOrUri
      *            to release
      */
     protected void releaseSession(Session session, String pathOrUri) {
@@ -173,7 +173,7 @@
     }
 
     /**
-     * @param user
+     * @param password
      *            password to use for user/password authentication
      */
     public void setUserPassword(String password) {

Modified: incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/ssh/SshCache.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/ssh/SshCache.java?view=diff&rev=552835&r1=552834&r2=552835
==============================================================================
--- incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/ssh/SshCache.java (original)
+++ incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/ssh/SshCache.java Tue Jul  3 06:29:32 2007
@@ -250,7 +250,7 @@
     /**
      * retrieves an sftp channel from the cache
      * 
-     * @param host
+     * @param session
      *            to connect to
      * @return channelSftp or null if not successful (channel not existent or dead)
      */
@@ -272,7 +272,7 @@
      * 
      * @param session
      *            to attach the channel to
-     * @param channelSftp
+     * @param channel
      *            channel to attach
      */
     public void attachChannelSftp(Session session, ChannelSftp channel) {
@@ -286,13 +286,13 @@
     /**
      * Gets a session from the cache or establishes a new session if necessary
      * 
-     * @param username
-     *            for the session to use
      * @param host
      *            to connect to
      * @param port
      *            to use for session (-1 == use standard port)
-     * @param password
+     * @param username
+     *            for the session to use
+     * @param userPassword
      *            to use for authentication (optional)
      * @param pemFile
      *            File to use for public key authentication

Modified: incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/ssh/SshRepository.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/ssh/SshRepository.java?view=diff&rev=552835&r1=552834&r2=552835
==============================================================================
--- incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/ssh/SshRepository.java (original)
+++ incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/repository/ssh/SshRepository.java Tue Jul  3 06:29:32 2007
@@ -62,10 +62,10 @@
     }
 
     /**
-     * fetch the needed file information for a given file (size, last modification time) and report
+     * Fetch the needed file information for a given file (size, last modification time) and report
      * it back in a SshResource
      * 
-     * @param uri
+     * @param source 
      *            ssh uri for the file to get info for
      * @return SshResource filled with the needed informations
      * @see org.apache.ivy.plugins.repository.Repository#getResource(java.lang.String)

Modified: incubator/ivy/core/trunk/src/java/org/apache/ivy/util/ConfigurationUtils.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/util/ConfigurationUtils.java?view=diff&rev=552835&r1=552834&r2=552835
==============================================================================
--- incubator/ivy/core/trunk/src/java/org/apache/ivy/util/ConfigurationUtils.java (original)
+++ incubator/ivy/core/trunk/src/java/org/apache/ivy/util/ConfigurationUtils.java Tue Jul  3 06:29:32 2007
@@ -37,13 +37,17 @@
     }
 
     /**
-     * Replace all the wildcards in the given configuration array. Supported wildcards are:
+     * Replace the wildcards in the given configuration array, by the name of the given
+     * ModuleDescriptor
+     * 
+     * The supported wildcards are:
      * <ul>
-     * <li><b><tt>*</tt>:</b>all configurations</li>
-     * <li><b><tt>*(public)</tt>:</b>all public configurations</li>
-     * <li><b><tt>*(private)</tt>:</b>all private configurations</li>
+     *   <li><b><tt>*</tt> :</b> all configurations</li>
+     *   <li><b><tt>*(public)</tt> :</b> all public configurations</li>
+     *   <li><b><tt>*(private)</tt> :</b> all private configurations</li>
      * </ul>
-     * If the given array of configurations is <tt>null</tt>, all configurations are returned.
+     * If the given array of configurations is <code>null</code>, all configurations 
+     * from the given module descriptor are returned, including if this array is empty.
      * 
      * @param confs
      *            the configurations, can contain wildcards
@@ -52,12 +56,11 @@
      * @return
      */
     public static String[] replaceWildcards(String[] confs, ModuleDescriptor md) {
-        Set result = new LinkedHashSet();
-
         if (confs == null) {
             return md.getConfigurationsNames();
         }
 
+        Set result = new LinkedHashSet();
         for (int i = 0; i < confs.length; i++) {
             if ("*".equals(confs[i])) {
                 result.addAll(Arrays.asList(md.getConfigurationsNames()));

Modified: incubator/ivy/core/trunk/src/java/org/apache/ivy/util/FileUtil.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/util/FileUtil.java?view=diff&rev=552835&r1=552834&r2=552835
==============================================================================
--- incubator/ivy/core/trunk/src/java/org/apache/ivy/util/FileUtil.java (original)
+++ incubator/ivy/core/trunk/src/java/org/apache/ivy/util/FileUtil.java Tue Jul  3 06:29:32 2007
@@ -36,7 +36,7 @@
 import org.apache.ivy.util.url.URLHandlerRegistry;
 
 /**
- *
+ * Utility class used to deal with file related operations, like copy, full reading, symlink, ...
  */
 public class FileUtil {
     // tried some other values with empty files... seems to be the best one (512 * 1024 is very bad)
@@ -239,8 +239,8 @@
      * Returns a collection of all Files being contained in the given directory, recursively,
      * including directories.
      * 
-     * @param dir
-     * @return
+     * @param  dir  The directory from which all files, including files in subdirectory) are extracted.
+     * @return  A collectoin containing all the files of the given directory and it's subdirectories.
      */
     public static Collection listAll(File dir) {
         return listAll(dir, new ArrayList());

Modified: incubator/ivy/core/trunk/src/java/org/apache/ivy/util/StringUtils.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/util/StringUtils.java?view=diff&rev=552835&r1=552834&r2=552835
==============================================================================
--- incubator/ivy/core/trunk/src/java/org/apache/ivy/util/StringUtils.java (original)
+++ incubator/ivy/core/trunk/src/java/org/apache/ivy/util/StringUtils.java Tue Jul  3 06:29:32 2007
@@ -35,12 +35,16 @@
     }
 
     /**
-     * Joins the given object array in one string, each separated by the given separator. Example:
+     * Joins the given object array in one string, each separated by the given separator. 
+     * 
+     * Example:
+     * <pre>
      * join(new String[] {"one", "two", "three"}, ", ") -> "one, two, three"
+     * </pre>
      * 
-     * @param objs
-     * @param sep
-     * @return
+     * @param  objs  The array of objects (<code>toString()</code> is used).
+     * @param  sep  The separator to use.
+     * @return  The concatinated string.
      */
     public static String join(Object[] objs, String sep) {
         StringBuffer buf = new StringBuffer();
@@ -102,7 +106,7 @@
      * 
      * @param str
      *            the encrypted string to decrypt
-     * @return
+     * @return  The decrypted string.
      */
     public final static String decrypt(String str) {
         if (str == null) {

Modified: incubator/ivy/core/trunk/src/java/org/apache/ivy/util/extendable/ExtendableItem.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/util/extendable/ExtendableItem.java?view=diff&rev=552835&r1=552834&r2=552835
==============================================================================
--- incubator/ivy/core/trunk/src/java/org/apache/ivy/util/extendable/ExtendableItem.java (original)
+++ incubator/ivy/core/trunk/src/java/org/apache/ivy/util/extendable/ExtendableItem.java Tue Jul  3 06:29:32 2007
@@ -55,7 +55,7 @@
      * The Map keys are attribute names as Strings, and values are corresponding attribute values
      * (as String too)
      * 
-     * @return
+     * @return A Map instance containing all the attributes and their values.
      */
     Map getAttributes();
 
@@ -63,7 +63,7 @@
      * Returns a Map of all standard attributes of this extendable item. The Map keys are attribute
      * names as Strings, and values are corresponding attribute values (as String too)
      * 
-     * @return
+     * @return A Map instance containing all the standard attributes and their values.
      */
     Map getStandardAttributes();
 
@@ -71,7 +71,7 @@
      * Returns a Map of all extra attributes of this extendable item. The Map keys are attribute
      * names as Strings, and values are corresponding attribute values (as String too)
      * 
-     * @return
+     * @return A Map instance containing all the extra attributes and their values.
      */
     Map getExtraAttributes();
 }

Modified: incubator/ivy/core/trunk/src/java/org/apache/ivy/util/filter/FilterHelper.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/util/filter/FilterHelper.java?view=diff&rev=552835&r1=552834&r2=552835
==============================================================================
--- incubator/ivy/core/trunk/src/java/org/apache/ivy/util/filter/FilterHelper.java (original)
+++ incubator/ivy/core/trunk/src/java/org/apache/ivy/util/filter/FilterHelper.java Tue Jul  3 06:29:32 2007
@@ -33,7 +33,7 @@
             return NO_FILTER;
         }
         String[] t = types.split(",");
-        List acceptedTypes = new ArrayList(types.length());
+        List acceptedTypes = new ArrayList(t.length); 
         for (int i = 0; i < t.length; i++) {
             acceptedTypes.add(t[i].trim());
         }
@@ -41,12 +41,17 @@
     }
 
     /**
-     * we could have used commons-collections facility for this... if we accepted to add
-     * dependencies on third party jars
+     * Returns a new collection containing only the items from the given collectoin, which are
+     * accepted by the filter.
      * 
-     * @param col
-     * @param filter
-     * @return
+     * @param  col  The collection to filter.
+     * @param  filter  The filter to use.
+     * @return  A new collection instance containing the only the instance accepted by the filter.
+     *
+     * <br />
+     * Comment: We could have used 
+     *          <a  href="http://jakarta.apache.org/commons/collections/">Commons-Collections</a>
+     *          facility for this. If we accepted to add dependencies on third party jars.
      */
     public static Collection filter(Collection col, Filter filter) {
         if (filter == null) {

Modified: incubator/ivy/core/trunk/src/java/org/apache/ivy/util/url/URLHandler.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/util/url/URLHandler.java?view=diff&rev=552835&r1=552834&r2=552835
==============================================================================
--- incubator/ivy/core/trunk/src/java/org/apache/ivy/util/url/URLHandler.java (original)
+++ incubator/ivy/core/trunk/src/java/org/apache/ivy/util/url/URLHandler.java Tue Jul  3 06:29:32 2007
@@ -117,18 +117,22 @@
     public long getLastModified(URL url, int timeout);
 
     /**
-     * never returns null, return UNAVAILABLE when url is not reachable
+     * Returns the URLInfo of the given url or a {@link #UNAVAILABLE} instance,
+     * if the url is not reachable.
      * 
-     * @param url
-     * @return
+     * @param  url  The url from which information is retrieved.
+     * @return  The URLInfo extracted from the given url, or {@link #UNAVAILABLE} when
+     *          the url is not available.
      */
     public URLInfo getURLInfo(URL url);
 
     /**
      * never returns null, return UNAVAILABLE when url is not reachable
      * 
-     * @param url
-     * @return
+     * @param  url  The url from which information is retrieved.
+     * @param  timeout  The timeout in milliseconds.
+     * @return  The URLInfo extracted from the given url, or {@link #UNAVAILABLE} when
+     *          the url is not available.
      */
     public URLInfo getURLInfo(URL url, int timeout);