use of lucee.runtime.net.ftp.AFTPClient in project Lucee by lucee.
the class Ftp method actionOpen.
/**
* Opens a FTP Connection
* @return FTPCLinet
* @throws IOException
* @throws PageException
*/
private AFTPClient actionOpen() throws IOException, PageException {
required("server", server);
required("username", username);
required("password", password);
AFTPClient client = getClient();
writeCfftp(client);
return client;
}
use of lucee.runtime.net.ftp.AFTPClient in project Lucee by lucee.
the class Ftp method actionExistsFile.
/**
* check if a file exists or not
* @return FTPCLient
* @throws IOException
* @throws PageException
*/
private AFTPClient actionExistsFile() throws PageException, IOException {
required("remotefile", remotefile);
AFTPClient client = getClient();
FTPFile file = existsFile(client, remotefile, true);
Struct cfftp = writeCfftp(client);
cfftp.setEL(RETURN_VALUE, Caster.toBoolean(file != null && file.isFile()));
cfftp.setEL(SUCCEEDED, Boolean.TRUE);
stoponerror = false;
return client;
}
use of lucee.runtime.net.ftp.AFTPClient in project Lucee by lucee.
the class Ftp method actionExists.
/**
* check if a file or directory exists
* @return FTPCLient
* @throws PageException
* @throws IOException
*/
private AFTPClient actionExists() throws PageException, IOException {
required("item", item);
AFTPClient client = getClient();
FTPFile file = existsFile(client, item, false);
Struct cfftp = writeCfftp(client);
cfftp.setEL(RETURN_VALUE, Caster.toBoolean(file != null));
cfftp.setEL(SUCCEEDED, Boolean.TRUE);
return client;
}
use of lucee.runtime.net.ftp.AFTPClient in project Lucee by lucee.
the class Ftp method actionListDir.
/**
* List data of a ftp connection
* @return FTPCLient
* @throws PageException
* @throws IOException
*/
private AFTPClient actionListDir() throws PageException, IOException {
required("name", name);
required("directory", directory);
AFTPClient client = getClient();
FTPFile[] files = client.listFiles(directory);
if (files == null)
files = new FTPFile[0];
pageContext.setVariable(name, toQuery(files, "ftp", directory, client.getRemoteAddress().getHostName()));
writeCfftp(client);
return client;
}
use of lucee.runtime.net.ftp.AFTPClient in project Lucee by lucee.
the class Ftp method actionChangeDir.
/**
* change working directory
* @return FTPCLient
* @throws IOException
* @throws PageException
*/
private AFTPClient actionChangeDir() throws IOException, PageException {
required("directory", directory);
AFTPClient client = getClient();
client.changeWorkingDirectory(directory);
writeCfftp(client);
return client;
}
Aggregations