edu.isi.pegasus.gridftp
public class GridFTPConnection extends 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 GSSCredential |
credential |
private String |
host |
private org.apache.commons.logging.Log |
logger |
private int |
port |
| Constructor and Description |
|---|
GridFTPConnection(String host,
int port,
GSSCredential credential) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the connection
|
boolean |
exists(String path)
Return true if path exists, false otherwise
|
String |
getURLFor(String path)
Return a gsiftp:// URL for path
|
List<FileInfo> |
ll(String path)
List contents of path in long format
|
List<FileInfo> |
ls(String path)
List contents of path in short (filename only) format
|
private List<FileInfo> |
ls(String path,
boolean longFormat)
List contents of path.
|
void |
mkdir(String path)
Create directory path
|
void |
rm(String path)
Remove path
|
void |
rmdir(String path)
Remove directory path
|
FileInfo |
stat(String path)
Return information about path
|
private void |
translateException(Exception e,
String message)
Translate the exception e into one of the subclasses of GridFTPException
|
private org.apache.commons.logging.Log logger
private String host
private int port
private GSSCredential credential
private org.globus.ftp.GridFTPClient client
public GridFTPConnection(String host, int port, GSSCredential credential) throws Exception
Exceptionpublic List<FileInfo> ll(String path) throws GridFTPException
GridFTPExceptionpublic List<FileInfo> ls(String path) throws GridFTPException
GridFTPExceptionprivate List<FileInfo> ls(String path, boolean longFormat) throws GridFTPException
GridFTPExceptionpublic void rm(String path) throws GridFTPException
GridFTPExceptionpublic void rmdir(String path) throws GridFTPException
GridFTPExceptionpublic void mkdir(String path) throws GridFTPException
GridFTPExceptionpublic boolean exists(String path) throws GridFTPException
GridFTPExceptionpublic FileInfo stat(String path) throws GridFTPException
GridFTPExceptionprivate void translateException(Exception e, String message) throws GridFTPException
GridFTPExceptionpublic void close()