Package edu.isi.pegasus.gridftp
Class GridFTPConnection
- java.lang.Object
-
- edu.isi.pegasus.gridftp.GridFTPConnection
-
public class GridFTPConnection extends java.lang.ObjectA connection to a GridFTP server- Author:
- Gideon Juve
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private classGridFTPConnection.StringBuilderDataSinkThis class is used to collect data returned by the list command into a StringBuilder.
-
Field Summary
Fields Modifier and Type Field Description private org.globus.ftp.GridFTPClientclientprivate org.ietf.jgss.GSSCredentialcredentialprivate java.lang.Stringhostprivate org.apache.commons.logging.Logloggerprivate intport
-
Constructor Summary
Constructors Constructor Description GridFTPConnection(java.lang.String host, int port, org.ietf.jgss.GSSCredential credential)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Close the connectionbooleanexists(java.lang.String path)Return true if path exists, false otherwisejava.lang.StringgetURLFor(java.lang.String path)Return a gsiftp:// URL for pathjava.util.List<FileInfo>ll(java.lang.String path)List contents of path in long formatjava.util.List<FileInfo>ls(java.lang.String path)List contents of path in short (filename only) formatprivate java.util.List<FileInfo>ls(java.lang.String path, boolean longFormat)List contents of path.voidmkdir(java.lang.String path)Create directory pathvoidrm(java.lang.String path)Remove pathvoidrmdir(java.lang.String path)Remove directory pathFileInfostat(java.lang.String path)Return information about pathprivate voidtranslateException(java.lang.Exception e, java.lang.String message)Translate the exception e into one of the subclasses of GridFTPException
-
-
-
Method Detail
-
ll
public java.util.List<FileInfo> ll(java.lang.String path) throws GridFTPException
List contents of path in long format- Throws:
GridFTPException
-
ls
public java.util.List<FileInfo> ls(java.lang.String path) throws GridFTPException
List contents of path in short (filename only) format- Throws:
GridFTPException
-
ls
private java.util.List<FileInfo> ls(java.lang.String path, boolean longFormat) throws GridFTPException
List contents of path. If longFormat is true, return the long format listing.- Throws:
GridFTPException
-
rm
public void rm(java.lang.String path) throws GridFTPExceptionRemove path- Throws:
GridFTPException
-
rmdir
public void rmdir(java.lang.String path) throws GridFTPExceptionRemove directory path- Throws:
GridFTPException
-
mkdir
public void mkdir(java.lang.String path) throws GridFTPExceptionCreate directory path- Throws:
GridFTPException
-
exists
public boolean exists(java.lang.String path) throws GridFTPExceptionReturn true if path exists, false otherwise- Throws:
GridFTPException
-
stat
public FileInfo stat(java.lang.String path) throws GridFTPException
Return information about path- Throws:
GridFTPException
-
translateException
private void translateException(java.lang.Exception e, java.lang.String message) throws GridFTPExceptionTranslate the exception e into one of the subclasses of GridFTPException- Throws:
GridFTPException
-
getURLFor
public java.lang.String getURLFor(java.lang.String path)
Return a gsiftp:// URL for path
-
close
public void close()
Close the connection
-
-