Package org.javlo.macro.interactive
Class TransfertStaticToZip
- java.lang.Object
-
- java.lang.Thread
-
- org.javlo.macro.interactive.TransfertStaticToZip
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
-
-
Field Summary
Fields Modifier and Type Field Description booleanrunning-
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
-
-
Constructor Summary
Constructors Constructor Description TransfertStaticToZip(ContentContext ctx, File folder, URL url, File zipFile, String path, MailService mailService, String email)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description FilegetFolder()StringgetPath()URLgetUrl()voidrun()voidsetFolder(File folder)voidsetPath(String path)voidsetUrl(URL url)static voiduploadDirectory(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 booleanuploadSingleFile(org.apache.commons.net.ftp.FTPClient ftpClient, String localFilePath, String remoteFilePath)Upload a single file to the FTP server.-
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
-
-
-
Constructor Detail
-
TransfertStaticToZip
public TransfertStaticToZip(ContentContext ctx, File folder, URL url, File zipFile, String path, MailService mailService, String email) throws ZipException, IOException
- Throws:
ZipExceptionIOException
-
-
Method Detail
-
getFolder
public File getFolder()
-
setFolder
public void setFolder(File folder)
-
getUrl
public URL getUrl()
-
setUrl
public void setUrl(URL url)
-
getPath
public String getPath()
-
setPath
public void setPath(String path)
-
uploadSingleFile
public static boolean uploadSingleFile(org.apache.commons.net.ftp.FTPClient ftpClient, String localFilePath, String remoteFilePath) throws IOExceptionUpload a single file to the FTP server.- Parameters:
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 server- Returns:
- true if the file was uploaded successfully, false otherwise
- Throws:
IOException- if any network or IO error occurred.
-
uploadDirectory
public static void uploadDirectory(org.apache.commons.net.ftp.FTPClient ftpClient, String remoteDirPath, File localDir, String remoteParentDir) throws IOExceptionUpload a whole directory (including its nested sub directories and files) to a FTP server.- Parameters:
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).- Throws:
IOException- if any network or IO error occurred.
-
-