org.apache.oodt.cas.pushpull.protocol.http
Class HttpClient

java.lang.Object
  extended by org.apache.oodt.cas.pushpull.protocol.Protocol
      extended by org.apache.oodt.cas.pushpull.protocol.http.HttpClient

public class HttpClient
extends Protocol

Http Protocol communication class

Version:
$Revision$
Author:
bfoster

Field Summary
 
Fields inherited from class org.apache.oodt.cas.pushpull.protocol.Protocol
protocolType, remoteSite
 
Constructor Summary
HttpClient()
           
 
Method Summary
 void abortCurFileTransfer()
           
 void cdToRoot()
           
protected  void chDir(ProtocolPath path)
           
 void connect(String host, String username, String password)
           
static String createLinkFromHref(HttpPath parent, String href)
           
 boolean deleteFile(ProtocolFile file)
           
 void disconnectFromServer()
          Disconnects the Protocol for the server
static String findLinkInATag(String aTag)
           
 ProtocolFile getCurrentWorkingDir()
          Returns a string value of current directory -- similar to U*ix pwd()
 void getFile(ProtocolFile file, File toLocalFile)
          Downloads a file from Protocol server to the location specified by the java.io.File passed in.
 ProtocolFile getProtocolFileFor(String path, boolean isDir)
           
 boolean isConnected()
          Can be used to determine if Protocol is connected
 boolean isDirectory(String link, String virtualPath)
           
 List<ProtocolFile> listFiles()
           
static void main(String[] args)
           
 LinkedList<ProtocolFile> parseLink(HttpPath path)
           
 
Methods inherited from class org.apache.oodt.cas.pushpull.protocol.Protocol
cd, cdToHOME, cdToROOT, connect, delete, disconnect, download, download, equals, getAbsPathFor, getHomeDir, getProtocolType, getRemoteSite, isProtocolConnected, ls, ls, ls, pwd, reconnect
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpClient

public HttpClient()
           throws InstantiationException
Throws:
InstantiationException
Method Detail

chDir

protected void chDir(ProtocolPath path)
              throws ProtocolException
Specified by:
chDir in class Protocol
Throws:
ProtocolException

cdToRoot

public void cdToRoot()
Specified by:
cdToRoot in class Protocol

connect

public void connect(String host,
                    String username,
                    String password)
             throws ProtocolException
Specified by:
connect in class Protocol
Throws:
ProtocolException

disconnectFromServer

public void disconnectFromServer()
                          throws ProtocolException
Description copied from class: Protocol
Disconnects the Protocol for the server

Specified by:
disconnectFromServer in class Protocol
Throws:
ProtocolException

getFile

public void getFile(ProtocolFile file,
                    File toLocalFile)
             throws ProtocolException
Description copied from class: Protocol
Downloads a file from Protocol server to the location specified by the java.io.File passed in. Only a name can be passed in for fileName, can't be a path. User must first navigate to the directory which contains the file and then can call this method.

Specified by:
getFile in class Protocol
Throws:
ProtocolException

abortCurFileTransfer

public void abortCurFileTransfer()
Specified by:
abortCurFileTransfer in class Protocol

listFiles

public List<ProtocolFile> listFiles()
                             throws ProtocolException
Specified by:
listFiles in class Protocol
Throws:
ProtocolException

getCurrentWorkingDir

public ProtocolFile getCurrentWorkingDir()
                                  throws ProtocolException
Description copied from class: Protocol
Returns a string value of current directory -- similar to U*ix pwd()

Specified by:
getCurrentWorkingDir in class Protocol
Returns:
The path of current directory
Throws:
ProtocolException

isConnected

public boolean isConnected()
                    throws ProtocolException
Description copied from class: Protocol
Can be used to determine if Protocol is connected

Specified by:
isConnected in class Protocol
Returns:
true if Protocol is connected, otherwise false
Throws:
ProtocolException

parseLink

public LinkedList<ProtocolFile> parseLink(HttpPath path)
                                   throws ProtocolException
Throws:
ProtocolException

findLinkInATag

public static String findLinkInATag(String aTag)

isDirectory

public boolean isDirectory(String link,
                           String virtualPath)
                    throws ProtocolException,
                           IOException
Throws:
ProtocolException
IOException

createLinkFromHref

public static String createLinkFromHref(HttpPath parent,
                                        String href)

getProtocolFileFor

public ProtocolFile getProtocolFileFor(String path,
                                       boolean isDir)
                                throws ProtocolException
Overrides:
getProtocolFileFor in class Protocol
Throws:
ProtocolException

deleteFile

public boolean deleteFile(ProtocolFile file)
Specified by:
deleteFile in class Protocol

main

public static void main(String[] args)
                 throws Exception
Throws:
Exception


Copyright © 1999-2011 Apache OODT. All Rights Reserved.