You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-dev@jakarta.apache.org by ju...@apache.org on 2003/04/04 17:25:32 UTC

cvs commit: jakarta-slide/src/webdav/client/src/org/apache/webdav/ui WebdavSystemView.java WebdavView.java

juergen     2003/04/04 07:25:32

  Modified:    src/webdav/client/src/org/apache/webdav/lib/properties
                        LockEntryProperty.java OwnerProperty.java
                        PrincipalCollectionSetProperty.java
                        ResourceTypeProperty.java
                        SupportedLockProperty.java
               src/webdav/client/src/org/apache/webdav/ui
                        WebdavSystemView.java WebdavView.java
  Log:
  Clean up of the import statements. Requested by many of you.
  
  Revision  Changes    Path
  1.4       +5 -5      jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/properties/LockEntryProperty.java
  
  Index: LockEntryProperty.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/properties/LockEntryProperty.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- LockEntryProperty.java	25 Apr 2002 21:27:30 -0000	1.3
  +++ LockEntryProperty.java	4 Apr 2003 15:25:31 -0000	1.4
  @@ -77,4 +77,4 @@
   
       public abstract short getScope();
       public abstract short getType();
  -}
  \ No newline at end of file
  +}
  
  
  
  1.4       +7 -16     jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/properties/OwnerProperty.java
  
  Index: OwnerProperty.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/properties/OwnerProperty.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- OwnerProperty.java	25 Apr 2002 21:27:30 -0000	1.3
  +++ OwnerProperty.java	4 Apr 2003 15:25:31 -0000	1.4
  @@ -63,19 +63,10 @@
   
   package org.apache.webdav.lib.properties;
   
  -import java.util.Enumeration;
  -import java.util.ArrayList;
  -
  -import org.w3c.dom.Element;
  -import org.w3c.dom.NodeList;
  -import org.w3c.dom.Node;
  -
   import org.apache.util.DOMUtils;
  -
  -import org.apache.webdav.lib.ResponseEntity;
   import org.apache.webdav.lib.BaseProperty;
  -import org.apache.webdav.lib.Privilege;
  -import org.apache.webdav.lib.Ace;
  +import org.apache.webdav.lib.ResponseEntity;
  +import org.w3c.dom.Element;
   
   /**
    * This interface models the <code>&lt;D:owner&gt;</code> property, which is
  @@ -115,7 +106,7 @@
       public String getHref() {
           String principal="";
           Element href = DOMUtils.getFirstElement(element, "DAV:", "href");
  -        if (href!=null) 
  +        if (href!=null)
           {
               principal = DOMUtils.getTextValue(href);
           }
  
  
  
  1.7       +48 -53    jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/properties/PrincipalCollectionSetProperty.java
  
  Index: PrincipalCollectionSetProperty.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/properties/PrincipalCollectionSetProperty.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- PrincipalCollectionSetProperty.java	25 Apr 2002 21:27:30 -0000	1.6
  +++ PrincipalCollectionSetProperty.java	4 Apr 2003 15:25:31 -0000	1.7
  @@ -64,17 +64,12 @@
   package org.apache.webdav.lib.properties;
   
   import java.util.Vector;
  -import java.util.Enumeration;
  -import java.util.ArrayList;
  -
  -import org.w3c.dom.Element;
  -import org.w3c.dom.NodeList;
  -import org.w3c.dom.Node;
  -
   import org.apache.util.DOMUtils;
  -
  -import org.apache.webdav.lib.ResponseEntity;
   import org.apache.webdav.lib.BaseProperty;
  +import org.apache.webdav.lib.ResponseEntity;
  +import org.w3c.dom.Element;
  +import org.w3c.dom.Node;
  +import org.w3c.dom.NodeList;
   
   /**
    * This class models the <code>&lt;D:principal-collection-set&gt;</code> property, which is
  @@ -102,53 +97,53 @@
   
       // --------------------------------------------------------- Public Methods
   
  -	private String[] hrefs=null;
  -	
  -	private void init() 
  -	{
  -		// check if already initialized
  -		if (this.hrefs!=null)
  -			return;
  -
  -		Vector hrefVector =	new Vector();
  -		NodeList hrefNodes = DOMUtils.getElementsByTagNameNS(element, "href", "DAV:");
  -		if (hrefNodes!=null) 
  -		{
  -			for (int i = 0; i < hrefNodes.getLength(); i++) 
  -			{
  -				Node hrefNode = hrefNodes.item(i);
  -				String href = DOMUtils.getTextValue(hrefNode);
  -				if ((href!=null) && (href.length()>0))
  -					hrefVector.add(href);
  -			}
  -		}
  -	
  -		this.hrefs=(String[]) hrefVector.toArray(new String[hrefVector.size()]);
  -	}
  +    private String[] hrefs=null;
  +
  +    private void init()
  +    {
  +        // check if already initialized
  +        if (this.hrefs!=null)
  +            return;
  +
  +        Vector hrefVector = new Vector();
  +        NodeList hrefNodes = DOMUtils.getElementsByTagNameNS(element, "href", "DAV:");
  +        if (hrefNodes!=null)
  +        {
  +            for (int i = 0; i < hrefNodes.getLength(); i++)
  +            {
  +                Node hrefNode = hrefNodes.item(i);
  +                String href = DOMUtils.getTextValue(hrefNode);
  +                if ((href!=null) && (href.length()>0))
  +                    hrefVector.add(href);
  +            }
  +        }
  +
  +        this.hrefs=(String[]) hrefVector.toArray(new String[hrefVector.size()]);
  +    }
   
       /**
        * Returns the Hrefs present in this principal-collection-set property.
  -     * 
  +     *
        * @return String[] A href array or null when there are no href.
        */
  -	public String[] getHrefs() 
  -	{
  -		init();
  -		return this.hrefs;
  -	}
  +    public String[] getHrefs()
  +    {
  +        init();
  +        return this.hrefs;
  +    }
   
       public String getPropertyAsString() {
  -		String[] hrefs = getHrefs();
  -		
  -		if ((hrefs==null) || (hrefs.length==0))
  -			return "";
  -		
  -		StringBuffer tmp = new StringBuffer(hrefs[0]);
  -		for (int i=1; i<hrefs.length ; i++) {
  -			tmp.append(", ");
  -			tmp.append(hrefs[i]);
  -		}
  -		
  +        String[] hrefs = getHrefs();
  +
  +        if ((hrefs==null) || (hrefs.length==0))
  +            return "";
  +
  +        StringBuffer tmp = new StringBuffer(hrefs[0]);
  +        for (int i=1; i<hrefs.length ; i++) {
  +            tmp.append(", ");
  +            tmp.append(hrefs[i]);
  +        }
  +
           return tmp.toString();
       }
   
  
  
  
  1.7       +11 -13    jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/properties/ResourceTypeProperty.java
  
  Index: ResourceTypeProperty.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/properties/ResourceTypeProperty.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- ResourceTypeProperty.java	25 Apr 2002 21:27:30 -0000	1.6
  +++ ResourceTypeProperty.java	4 Apr 2003 15:25:31 -0000	1.7
  @@ -63,13 +63,11 @@
   
   package org.apache.webdav.lib.properties;
   
  -import org.w3c.dom.Element;
  -import org.w3c.dom.NodeList;
  -
   import org.apache.util.DOMUtils;
  -
   import org.apache.webdav.lib.BaseProperty;
   import org.apache.webdav.lib.ResponseEntity;
  +import org.w3c.dom.Element;
  +import org.w3c.dom.NodeList;
   
   /**
    * An interface that describes a standard Resource Type property (as defined by
  @@ -82,7 +80,7 @@
   
       private boolean initialized=false;
       private boolean isCollection;
  -    
  +
       // -------------------------------------------------------------- Constants
   
   
  @@ -119,18 +117,18 @@
           return isCollection;
       }
   
  -    private void init() 
  +    private void init()
       {
           // FIXME: only <DAV:collection/> is supported
  -    
  +
           if (initialized)
               return;
  -            
  +
           NodeList tmp = element.getChildNodes();
           for (int i = 0; tmp != null && i < tmp.getLength(); i++ ) {
               try {
                   Element child = (Element) tmp.item(i);
  -                if ("collection".equals(DOMUtils.getElementLocalName(child)) 
  +                if ("collection".equals(DOMUtils.getElementLocalName(child))
                        && "DAV:".equals(DOMUtils.getElementNamespaceURI(child)))
                   {
                       isCollection=true;
  @@ -148,7 +146,7 @@
        * This method returns the value of the property.
        * For this property "COLLECTION" is returned if
        * this resource is a collection, "" otherwise.
  -     * 
  +     *
        * WARNING: this will change in the future
        * use isCollection()
        */
  
  
  
  1.8       +20 -26    jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/properties/SupportedLockProperty.java
  
  Index: SupportedLockProperty.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/properties/SupportedLockProperty.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- SupportedLockProperty.java	25 Apr 2002 21:15:14 -0000	1.7
  +++ SupportedLockProperty.java	4 Apr 2003 15:25:31 -0000	1.8
  @@ -62,19 +62,13 @@
    */
   package org.apache.webdav.lib.properties;
   
  -import java.util.Enumeration;
   import java.util.ArrayList;
  -
  -import org.w3c.dom.Element;
  -import org.w3c.dom.NodeList;
  -import org.w3c.dom.Node;
  -
   import org.apache.util.DOMUtils;
  -
  -import org.apache.webdav.lib.ResponseEntity;
   import org.apache.webdav.lib.BaseProperty;
   import org.apache.webdav.lib.Lock;
  -import org.apache.webdav.lib.methods.DepthSupport;
  +import org.apache.webdav.lib.ResponseEntity;
  +import org.w3c.dom.Element;
  +import org.w3c.dom.NodeList;
   
   /**
    * @author BC Holmes
  @@ -105,7 +99,7 @@
   
   
       // --------------------------------------------------------- Public Methods
  -        
  +
   
   
       /**
  @@ -156,7 +150,7 @@
                   ls = Lock.SCOPE_SHARED;
               }
           }
  -        
  +
           int lt = -1;
           child = DOMUtils.getFirstElement(element, "DAV:", "locktype");
           if (child != null) {
  @@ -171,17 +165,17 @@
       }
   
       public String getPropertyAsString() {
  -		Lock[] locks = getLockEntries();
  -		
  -		if ((locks==null) || (locks.length==0))
  -			return "";
  -		
  -		StringBuffer tmp = new StringBuffer(locks[0].toString());
  -		for (int i=1; i<locks.length ; i++) {
  -			tmp.append(", ");
  -			tmp.append(locks[i].toString());
  -		}
  -		
  +        Lock[] locks = getLockEntries();
  +
  +        if ((locks==null) || (locks.length==0))
  +            return "";
  +
  +        StringBuffer tmp = new StringBuffer(locks[0].toString());
  +        for (int i=1; i<locks.length ; i++) {
  +            tmp.append(", ");
  +            tmp.append(locks[i].toString());
  +        }
  +
           return tmp.toString();
       }
   }
  
  
  
  1.5       +6 -10     jakarta-slide/src/webdav/client/src/org/apache/webdav/ui/WebdavSystemView.java
  
  Index: WebdavSystemView.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/ui/WebdavSystemView.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- WebdavSystemView.java	25 Apr 2002 21:15:18 -0000	1.4
  +++ WebdavSystemView.java	4 Apr 2003 15:25:32 -0000	1.5
  @@ -63,19 +63,15 @@
   
   package org.apache.webdav.ui;
   
  -import javax.swing.filechooser.FileSystemView;
   import java.io.File;
   import java.net.MalformedURLException;
  -import java.util.List;
  -import java.util.Iterator;
  +import javax.swing.filechooser.FileSystemView;
   import org.apache.util.HttpURL;
   import org.apache.webdav.lib.WebdavFile;
  -import org.apache.webdav.lib.WebdavException;
  -import javax.swing.plaf.metal.MetalFileChooserUI;
   
   /**
    * Webdav View that behaves like a javax.swing.filechoose.FileSystemView
  - * 
  + *
    * @author Eckard Buchner
    */
   public class WebdavSystemView extends FileSystemView {
  @@ -228,7 +224,7 @@
      * gets the list of files
      */
     public File[] getFiles(File dir, boolean useFileHiding) {
  -  	// @todo param useFileHiding
  +    // @todo param useFileHiding
      return dir.listFiles();
     }
   }
  
  
  
  1.4       +4 -4      jakarta-slide/src/webdav/client/src/org/apache/webdav/ui/WebdavView.java
  
  Index: WebdavView.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/ui/WebdavView.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- WebdavView.java	25 Apr 2002 21:15:18 -0000	1.3
  +++ WebdavView.java	4 Apr 2003 15:25:32 -0000	1.4
  @@ -68,7 +68,7 @@
   
   /**
    * Used in JFileChooser to display Webdav elements
  - * 
  + *
    * @author Eckard Buchner
    */
   public class WebdavView extends FileView {
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: slide-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-dev-help@jakarta.apache.org