Class FtpArchiveFetcher
- java.lang.Object
-
- ubic.gemma.core.loader.util.fetcher.AbstractFetcher
-
- ubic.gemma.core.loader.util.fetcher.FtpFetcher
-
- ubic.gemma.core.loader.util.fetcher.FtpArchiveFetcher
-
- All Implemented Interfaces:
ArchiveFetcher
,Fetcher
- Direct Known Subclasses:
DataFileFetcher
,NCBIGeneFileFetcher
,RawDataFetcher
,TaxonFetcher
public abstract class FtpArchiveFetcher extends FtpFetcher implements ArchiveFetcher
Fetcher that can fetch archives (e.g., tar.gz) and unpack them.- Author:
- pavlidis
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
doDelete
org.apache.tools.ant.taskdefs.Expand
expander
-
Fields inherited from class ubic.gemma.core.loader.util.fetcher.FtpFetcher
avoidDownload, ftpClient, 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 FtpArchiveFetcher()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
cleanUp(File outputFile)
protected Collection<File>
doTask(Callable<Boolean> callable, long expectedSize, String seekFileName, String outputFileName)
protected void
initArchiveHandler(String methodName)
protected Collection<File>
listFiles(String remoteFile, File newDir, Collection<File> result)
void
setDeleteAfterUnpack(boolean doDelete)
Should the downloaded archive be deleted after unpacking?void
setExcludePattern(String excludePattern)
void
setForce(boolean force)
Set to true if downloads should proceed even if the file already exists.protected void
unPack(File toUnpack)
-
Methods inherited from class ubic.gemma.core.loader.util.fetcher.FtpFetcher
defineTask, fetch, fetch, getExpectedSize, getNetDataSourceUtil, setAvoidDownload, setNetDataSourceUtil
-
Methods inherited from class ubic.gemma.core.loader.util.fetcher.AbstractFetcher
fetchedFile, fetchedFile, formLocalFilePath, formRemoteFilePath, getExistingFile, getLocalBasePath, initConfig, isForce, mkdir, mkdir, setAllowUseExisting, waitForDownload
-
-
-
-
Method Detail
-
setDeleteAfterUnpack
public void setDeleteAfterUnpack(boolean doDelete)
Description copied from interface:ArchiveFetcher
Should the downloaded archive be deleted after unpacking?- Specified by:
setDeleteAfterUnpack
in interfaceArchiveFetcher
- Parameters:
doDelete
- whether to delete
-
setExcludePattern
public void setExcludePattern(String excludePattern)
- Parameters:
excludePattern
- the excludePattern to set
-
setForce
public void setForce(boolean force)
Description copied from class:AbstractFetcher
Set to true if downloads should proceed even if the file already exists.- Specified by:
setForce
in interfaceFetcher
- Overrides:
setForce
in classAbstractFetcher
- Parameters:
force
- new force
-
cleanUp
protected void cleanUp(File outputFile)
-
doTask
protected Collection<File> doTask(Callable<Boolean> callable, long expectedSize, String seekFileName, String outputFileName)
- Overrides:
doTask
in classFtpFetcher
-
initArchiveHandler
protected void initArchiveHandler(String methodName)
- Parameters:
methodName
- e.g., "gzip". If null, ignored
-
listFiles
protected Collection<File> listFiles(String remoteFile, File newDir, Collection<File> result) throws IOException
- Throws:
IOException
-
unPack
protected void unPack(File toUnpack)
-
-