You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@oodt.apache.org by bf...@apache.org on 2011/06/09 23:17:29 UTC

svn commit: r1134083 - /oodt/branches/protocol/protocol-http/src/main/java/org/apache/oodt/cas/protocol/http/HttpProtocol.java

Author: bfoster
Date: Thu Jun  9 21:17:29 2011
New Revision: 1134083

URL: http://svn.apache.org/viewvc?rev=1134083&view=rev
Log:
- updated to add new Protocol method: ls(ProtocolFileFilter)

----------------
OODT-194

Modified:
    oodt/branches/protocol/protocol-http/src/main/java/org/apache/oodt/cas/protocol/http/HttpProtocol.java

Modified: oodt/branches/protocol/protocol-http/src/main/java/org/apache/oodt/cas/protocol/http/HttpProtocol.java
URL: http://svn.apache.org/viewvc/oodt/branches/protocol/protocol-http/src/main/java/org/apache/oodt/cas/protocol/http/HttpProtocol.java?rev=1134083&r1=1134082&r2=1134083&view=diff
==============================================================================
--- oodt/branches/protocol/protocol-http/src/main/java/org/apache/oodt/cas/protocol/http/HttpProtocol.java (original)
+++ oodt/branches/protocol/protocol-http/src/main/java/org/apache/oodt/cas/protocol/http/HttpProtocol.java Thu Jun  9 21:17:29 2011
@@ -22,6 +22,7 @@ import org.apache.oodt.cas.protocol.Prot
 import org.apache.oodt.cas.protocol.auth.Authentication;
 import org.apache.oodt.cas.protocol.exceptions.ProtocolException;
 import org.apache.oodt.cas.protocol.http.util.HttpUtils;
+import org.apache.oodt.cas.protocol.util.ProtocolFileFilter;
 
 //JDK imports
 import java.io.BufferedOutputStream;
@@ -157,6 +158,17 @@ public class HttpProtocol implements Pro
     return lsResults;
   }
 
+	public List<ProtocolFile> ls(ProtocolFileFilter filter)
+			throws ProtocolException {
+  	List<ProtocolFile> lsResults = new ArrayList<ProtocolFile>();
+  	for (HttpFile file : parseLink(currentFile)) {
+  		if (filter.accept(file)) {
+  			lsResults.add(file);
+  		}
+  	}
+    return lsResults;
+	}
+	
   public ProtocolFile pwd() throws ProtocolException {
     try {
       return currentFile;