er.extensions.foundation
Class ERXLinlyn
java.lang.Object
er.extensions.foundation.ERXLinlyn
public class ERXLinlyn
- extends Object
Can upload and download files from ftp servers
|
Field Summary |
static Logger |
log
logging support |
|
Method Summary |
void |
append(String dir,
String file,
String what,
boolean asc)
|
boolean |
deleteFile(String dir,
String file)
Removes a file from a directory on the server. |
boolean |
deleteFile(String dir,
String file,
boolean keepAlive)
|
String |
download(String dir,
String file)
|
String |
download(String dir,
String file,
boolean asc)
|
String |
download(String dir,
String file,
boolean asc,
boolean keepAlive)
|
String[] |
listFiles(String dir)
Returns a list of files and associated attributes in a given directory. |
void |
upload(String dir,
String file,
byte[] bytes)
|
void |
upload(String dir,
String file,
byte[] bytes,
boolean keepAlive)
|
void |
upload(String dir,
String file,
String what)
|
void |
upload(String dir,
String file,
String what,
boolean asc)
|
void |
upload(String dir,
String file,
String what,
boolean asc,
boolean keepAlive)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
log
public static Logger log
- logging support
ERXLinlyn
public ERXLinlyn(String server,
String user,
String pass)
ERXLinlyn
public ERXLinlyn(String server,
int portNum,
String user,
String pass)
listFiles
public String[] listFiles(String dir)
throws IOException
- Returns a list of files and associated attributes in a given directory.
There is no FTP-server independent way to retrieve only the file name
portion of the result, but calling
substring(lastIndexOf(' ')+1)
on each element in the array will work so long as there are no spaces in filenames.
- Throws:
IOException
download
public String download(String dir,
String file)
throws IOException
- Throws:
IOException
download
public String download(String dir,
String file,
boolean asc)
throws IOException
- Throws:
IOException
download
public String download(String dir,
String file,
boolean asc,
boolean keepAlive)
throws IOException
- Throws:
IOException
append
public void append(String dir,
String file,
String what,
boolean asc)
throws IOException
- Throws:
IOException
upload
public void upload(String dir,
String file,
String what)
throws IOException
- Throws:
IOException
upload
public void upload(String dir,
String file,
byte[] bytes)
throws IOException
- Throws:
IOException
upload
public void upload(String dir,
String file,
byte[] bytes,
boolean keepAlive)
throws IOException
- Throws:
IOException
upload
public void upload(String dir,
String file,
String what,
boolean asc)
throws IOException
- Throws:
IOException
upload
public void upload(String dir,
String file,
String what,
boolean asc,
boolean keepAlive)
throws IOException
- Throws:
IOException
deleteFile
public boolean deleteFile(String dir,
String file)
throws IOException
- Removes a file from a directory on the server.
- Returns:
- true if the file was deleted (response 250), false otherwise.
- Throws:
IOException
deleteFile
public boolean deleteFile(String dir,
String file,
boolean keepAlive)
throws IOException
- Throws:
IOException
Copyright © 2002 – 2007 Project Wonder.