Class AbstractSingleCellDetector
- java.lang.Object
-
- ubic.gemma.core.loader.expression.geo.singleCell.AbstractSingleCellDetector
-
- All Implemented Interfaces:
SingleCellDetector
- Direct Known Subclasses:
AbstractSingleFileInSeriesSingleCellDetector
,MexDetector
public abstract class AbstractSingleCellDetector extends Object implements SingleCellDetector
-
-
Field Summary
Fields Modifier and Type Field Description protected org.apache.commons.logging.Log
log
-
Constructor Summary
Constructors Constructor Description AbstractSingleCellDetector()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
existsAndHasExpectedSize(Path dest, String remoteFile, long expectedContentLength, boolean decompressIfNeeded, boolean storeCompressed)
Check if a file at a given destination exists and has the size of a remote file.Path
getDownloadDirectory()
protected long
getSizeInBytes(String remoteFile)
protected InputStream
openSupplementaryFileAsStream(String filename, int attempt, boolean decompressIfNeeded)
Open a supplementary file as an input stream, possibly decompressing it.protected <T> T
retry(SimpleRetryCallable<T,IOException> callable, String what)
Retry the given callable a certain number of times before giving up.void
setDownloadDirectory(Path downloadDirectory)
Set the download directory to use for storing single-cell data.void
setFTPClientFactory(FTPClientFactory ftpClientFactory)
Set the FTP client factory to use for downloading data over FTP.void
setRetryPolicy(SimpleRetryPolicy retryPolicy)
Set the retry policy to use when downloading single-cell data.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface ubic.gemma.core.loader.expression.geo.singleCell.SingleCellDetector
downloadSingleCellData, downloadSingleCellData, getAdditionalSupplementaryFiles, getAdditionalSupplementaryFiles, getSingleCellDataLoader, hasSingleCellData, hasSingleCellData
-
-
-
-
Method Detail
-
setFTPClientFactory
public void setFTPClientFactory(FTPClientFactory ftpClientFactory)
Set the FTP client factory to use for downloading data over FTP.
-
getDownloadDirectory
public Path getDownloadDirectory()
-
setDownloadDirectory
public void setDownloadDirectory(Path downloadDirectory)
Set the download directory to use for storing single-cell data.It may be left unset if downloading is not intended or needed.
- Specified by:
setDownloadDirectory
in interfaceSingleCellDetector
-
setRetryPolicy
public void setRetryPolicy(SimpleRetryPolicy retryPolicy)
Description copied from interface:SingleCellDetector
Set the retry policy to use when downloading single-cell data.- Specified by:
setRetryPolicy
in interfaceSingleCellDetector
-
retry
protected <T> T retry(SimpleRetryCallable<T,IOException> callable, String what) throws IOException
Retry the given callable a certain number of times before giving up.- Throws:
IOException
- See Also:
SimpleRetry
-
existsAndHasExpectedSize
protected boolean existsAndHasExpectedSize(Path dest, String remoteFile, long expectedContentLength, boolean decompressIfNeeded, boolean storeCompressed) throws IOException
Check if a file at a given destination exists and has the size of a remote file.- Parameters:
dest
- file at destinationremoteFile
- filename at originexpectedContentLength
- expected size, or -1 if unknowndecompressIfNeeded
- if true and the remote file is gzipped, will only check if the local file existsstoreCompressed
- if true and the remote file is *not* gzipped, will only check if the local file exists- Throws:
IOException
-
openSupplementaryFileAsStream
protected InputStream openSupplementaryFileAsStream(String filename, int attempt, boolean decompressIfNeeded) throws IOException
Open a supplementary file as an input stream, possibly decompressing it.- Throws:
IOException
-
getSizeInBytes
protected long getSizeInBytes(String remoteFile) throws IOException
- Throws:
IOException
-
-