Thread.State, Thread.UncaughtExceptionHandler
Modifier and Type | Field and Description |
---|---|
boolean |
running |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
Constructor and Description |
---|
TransfertStaticToFtp(ContentContext ctx,
File folder,
URL url,
String host,
int port,
String username,
String password,
String path,
MailService mailService,
String email) |
Modifier and Type | Method and Description |
---|---|
int |
createDirectories(org.apache.commons.net.ftp.FTPClient ftpClient,
String remoteDirPath,
File localDir,
String remoteParentDir) |
File |
getFolder() |
String |
getHost() |
String |
getPassword() |
String |
getPath() |
int |
getPort() |
URL |
getUrl() |
String |
getUsername() |
static void |
main(String[] args) |
static boolean |
makeDirectories(org.apache.commons.net.ftp.FTPClient ftpClient,
String dirPath)
Creates a nested directory structure on a FTP server
|
static void |
removeDirectory(org.apache.commons.net.ftp.FTPClient ftpClient,
String parentDir,
String currentDir)
Removes a non-empty directory by delete all its sub files and
sub directories recursively.
|
void |
run() |
void |
setFolder(File folder) |
void |
setHost(String host) |
void |
setPassword(String password) |
void |
setPath(String path) |
void |
setPort(int port) |
void |
setUrl(URL url) |
void |
setUsername(String username) |
int |
uploadDirectory(org.apache.commons.net.ftp.FTPClient ftpClient,
String remoteDirPath,
File localDir,
String remoteParentDir)
Upload a whole directory (including its nested sub directories and files)
to a FTP server.
|
static boolean |
uploadSingleFile(org.apache.commons.net.ftp.FTPClient ftpClient,
String localFilePath,
String remoteFilePath)
Upload a single file to the FTP server.
|
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
public TransfertStaticToFtp(ContentContext ctx, File folder, URL url, String host, int port, String username, String password, String path, MailService mailService, String email)
public String getHost()
public void setHost(String host)
public int getPort()
public void setPort(int port)
public String getUsername()
public void setUsername(String username)
public String getPassword()
public void setPassword(String password)
public File getFolder()
public void setFolder(File folder)
public URL getUrl()
public void setUrl(URL url)
public String getPath()
public void setPath(String path)
public static boolean uploadSingleFile(org.apache.commons.net.ftp.FTPClient ftpClient, String localFilePath, String remoteFilePath) throws IOException
ftpClient
- an instance of org.apache.commons.net.ftp.FTPClient class.localFilePath
- Path of the file on local computerremoteFilePath
- Path of the file on remote the serverIOException
- if any network or IO error occurred.public static boolean makeDirectories(org.apache.commons.net.ftp.FTPClient ftpClient, String dirPath) throws IOException
ftpClient
- an instance of org.apache.commons.net.ftp.FTPClient class.dirPath
- Path of the directory, i.e /projects/java/ftp/demoIOException
- if any error occurred during client-server communicationpublic int createDirectories(org.apache.commons.net.ftp.FTPClient ftpClient, String remoteDirPath, File localDir, String remoteParentDir) throws IOException
IOException
public int uploadDirectory(org.apache.commons.net.ftp.FTPClient ftpClient, String remoteDirPath, File localDir, String remoteParentDir) throws IOException
ftpClient
- an instance of org.apache.commons.net.ftp.FTPClient class.remoteDirPath
- Path of the destination directory on the server.localParentDir
- Path of the local directory being uploaded.remoteParentDir
- Path of the parent directory of the current directory on the
server (used by recursive calls).IOException
- if any network or IO error occurred.public static void removeDirectory(org.apache.commons.net.ftp.FTPClient ftpClient, String parentDir, String currentDir) throws IOException
IOException
public static void main(String[] args) throws IOException
IOException
Copyright © 2012-2018. All Rights Reserved.