Skip to content
Snippets Groups Projects

dirty way of mapping locus:id to uniprot

Merged Piotr Gawron requested to merge 1898-uniprot-locus-id-issue into devel_16.2.x
6 files
+ 166
105
Compare changes
  • Side-by-side
  • Inline
Files
6
@@ -55,7 +55,7 @@ public class BigFileCacheImpl implements BigFileCache {
/**
* Buffer size used for downloading single chunk of a file.
*/
private static final int DOWNLOAD_BUFFER_SIZE = 1024;
private static final int DOWNLOAD_BUFFER_SIZE = 1024 * 1024;
/**
* Default class logger.
@@ -209,6 +209,7 @@ public class BigFileCacheImpl implements BigFileCache {
if (url.toLowerCase().startsWith("ftp:")) {
computations = new GetFtpFileTask(url, updater);
} else if (url.toLowerCase().startsWith("http:") || url.toLowerCase().startsWith("https:")) {
computations = new GetHttpFileTask(url, updater);
} else {
throw new URISyntaxException(url, "Unknown protocol for url");
@@ -219,6 +220,7 @@ public class BigFileCacheImpl implements BigFileCache {
} else {
Future<Void> task = syncExecutorService.submit(computations);
executeTask(task);
}
}
@@ -258,19 +260,18 @@ public class BigFileCacheImpl implements BigFileCache {
}
/**
* Checks if local file for given url is up to date. The check is based on
* file size check (ftp doesn't provide checksums for files, so we cannot
* compare it differently without downloading file).
* Checks if local file for given url is up to date. The check is based on file
* size check (ftp doesn't provide checksums for files, so we cannot compare it
* differently without downloading file).
*
* @param url
* url to ftp file
* @return <code>true</code> if file is up to date, <code>false</code> in
* other case
* @return <code>true</code> if file is up to date, <code>false</code> in other
* case
* @throws URISyntaxException
* thrown when url is invalid
* @throws IOException
* thrown when there is a problem with accessing local or remote
* file
* thrown when there is a problem with accessing local or remote file
*/
@Override
public boolean isLocalFileUpToDate(final String url) throws URISyntaxException, IOException {
@@ -288,8 +289,7 @@ public class BigFileCacheImpl implements BigFileCache {
*
* @param url
* url to remote file
* @return <code>true</code> if file is up to date, <code>false</code>
* otherwise
* @return <code>true</code> if file is up to date, <code>false</code> otherwise
* @throws FileNotFoundException
* thrown when local file cannot be found
* @throws URISyntaxException
@@ -347,8 +347,7 @@ public class BigFileCacheImpl implements BigFileCache {
*
* @param url
* url to remote file
* @return <code>true</code> if file is up to date, <code>false</code>
* otherwise
* @return <code>true</code> if file is up to date, <code>false</code> otherwise
* @throws IOException
* thrown when local file cannot be found or there is a problem with
* accessing remote file
@@ -530,8 +529,7 @@ public class BigFileCacheImpl implements BigFileCache {
*
* @param sourceUrl
* url that identifies file
* @return <code>true</code> if the file is cached, <code>false</code>
* otherwise
* @return <code>true</code> if the file is cached, <code>false</code> otherwise
*/
@Override
public boolean isCached(final String sourceUrl) {
@@ -776,9 +774,7 @@ public class BigFileCacheImpl implements BigFileCache {
entry.setDownloadProgress(IProgressUpdater.MAX_PROGRESS);
self.update(entry);
updater.setProgress(IProgressUpdater.MAX_PROGRESS);
output.close();
return null;
} catch (final Exception e) {
logger.error(e, e);
Loading