Class FtpFetcher
- java.lang.Object
-
- ubic.gemma.core.loader.util.fetcher.AbstractFetcher
-
- ubic.gemma.core.loader.util.fetcher.FtpFetcher
-
- All Implemented Interfaces:
Fetcher
- Direct Known Subclasses:
FtpArchiveFetcher
,GeoFetcher
,HomologeneFetcher
,SDRFFetcher
public abstract class FtpFetcher extends AbstractFetcher
Download files by FTP.- Author:
- paul
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
avoidDownload
protected org.apache.commons.net.ftp.FTPClient
ftpClient
protected NetDatasourceUtil
netDataSourceUtil
-
Fields inherited from class ubic.gemma.core.loader.util.fetcher.AbstractFetcher
allowUseExisting, force, INFO_UPDATE_INTERVAL, localBasePath, log, remoteBaseDir
-
-
Constructor Summary
Constructors Constructor Description FtpFetcher()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected Callable<Boolean>
defineTask(String outputFileName, String seekFile)
protected Collection<LocalFile>
doTask(Callable<Boolean> callable, long expectedSize, String seekFileName, String outputFileName)
Collection<LocalFile>
fetch(String identifier)
Fetch files according to the identifier provided.protected Collection<LocalFile>
fetch(String identifier, String seekFile)
protected long
getExpectedSize(String seekFile)
NetDatasourceUtil
getNetDataSourceUtil()
void
setAvoidDownload(boolean avoidDownload)
abstract void
setNetDataSourceUtil()
-
Methods inherited from class ubic.gemma.core.loader.util.fetcher.AbstractFetcher
fetchedFile, fetchedFile, formLocalFilePath, formRemoteFilePath, getExistingFile, getLocalBasePath, initConfig, isForce, mkdir, mkdir, setAllowUseExisting, setForce, waitForDownload
-
-
-
-
Field Detail
-
ftpClient
protected org.apache.commons.net.ftp.FTPClient ftpClient
-
netDataSourceUtil
protected NetDatasourceUtil netDataSourceUtil
-
avoidDownload
protected boolean avoidDownload
-
-
Method Detail
-
fetch
public Collection<LocalFile> fetch(String identifier)
Description copied from interface:Fetcher
Fetch files according to the identifier provided.- Parameters:
identifier
- identifier- Returns:
- local files
-
getNetDataSourceUtil
public NetDatasourceUtil getNetDataSourceUtil()
- Returns:
- the netDataSourceUtil
-
setAvoidDownload
public void setAvoidDownload(boolean avoidDownload)
- Parameters:
avoidDownload
- Set to true to avoid download if possible and simply use existing files if they are available. This skips the usual checks for the correct file size compared to the remote one. Not all fetchers support setting this to 'true'.
-
setNetDataSourceUtil
public abstract void setNetDataSourceUtil()
-
doTask
protected Collection<LocalFile> doTask(Callable<Boolean> callable, long expectedSize, String seekFileName, String outputFileName)
-
fetch
protected Collection<LocalFile> fetch(String identifier, String seekFile)
-
getExpectedSize
protected long getExpectedSize(String seekFile) throws IOException
- Throws:
IOException
-
-