public class GridFTPConnection
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
private class |
GridFTPConnection.StringBuilderDataSink
This class is used to collect data returned by the list command into
a StringBuilder.
|
| Modifier and Type | Field and Description |
|---|---|
private org.globus.ftp.GridFTPClient |
client |
private org.ietf.jgss.GSSCredential |
credential |
private java.lang.String |
host |
private org.apache.commons.logging.Log |
logger |
private int |
port |
| Constructor and Description |
|---|
GridFTPConnection(java.lang.String host,
int port,
org.ietf.jgss.GSSCredential credential) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the connection
|
boolean |
exists(java.lang.String path)
Return true if path exists, false otherwise
|
java.lang.String |
getURLFor(java.lang.String path)
Return a gsiftp:// URL for path
|
java.util.List<FileInfo> |
ll(java.lang.String path)
List contents of path in long format
|
java.util.List<FileInfo> |
ls(java.lang.String path)
List contents of path in short (filename only) format
|
private java.util.List<FileInfo> |
ls(java.lang.String path,
boolean longFormat)
List contents of path.
|
void |
mkdir(java.lang.String path)
Create directory path
|
void |
rm(java.lang.String path)
Remove path
|
void |
rmdir(java.lang.String path)
Remove directory path
|
FileInfo |
stat(java.lang.String path)
Return information about path
|
private void |
translateException(java.lang.Exception e,
java.lang.String message)
Translate the exception e into one of the subclasses of GridFTPException
|
private org.apache.commons.logging.Log logger
private java.lang.String host
private int port
private org.ietf.jgss.GSSCredential credential
private org.globus.ftp.GridFTPClient client
public GridFTPConnection(java.lang.String host,
int port,
org.ietf.jgss.GSSCredential credential)
throws java.lang.Exception
java.lang.Exceptionpublic java.util.List<FileInfo> ll(java.lang.String path) throws GridFTPException
GridFTPExceptionpublic java.util.List<FileInfo> ls(java.lang.String path) throws GridFTPException
GridFTPExceptionprivate java.util.List<FileInfo> ls(java.lang.String path, boolean longFormat) throws GridFTPException
GridFTPExceptionpublic void rm(java.lang.String path)
throws GridFTPException
GridFTPExceptionpublic void rmdir(java.lang.String path)
throws GridFTPException
GridFTPExceptionpublic void mkdir(java.lang.String path)
throws GridFTPException
GridFTPExceptionpublic boolean exists(java.lang.String path)
throws GridFTPException
GridFTPExceptionpublic FileInfo stat(java.lang.String path) throws GridFTPException
GridFTPExceptionprivate void translateException(java.lang.Exception e,
java.lang.String message)
throws GridFTPException
GridFTPExceptionpublic java.lang.String getURLFor(java.lang.String path)
public void close()