Reenabling code that was commented out after it was confirmed to work by many participating in this thread:

http://getsatisfaction.com/gsa/topics/error_thrown_when_reading_reference_file


git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@3981 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
hanna 2010-08-09 00:12:09 +00:00
parent 48e311a5ea
commit 6b4a1e3b9f
1 changed files with 32 additions and 32 deletions

View File

@ -143,39 +143,39 @@ public class ReferenceDataSource implements ReferenceDataSourceProgressListener
* but is incomplete). To avoid this, obtain shared locks on both files before creating IndexedFastaSequenceFile. * but is incomplete). To avoid this, obtain shared locks on both files before creating IndexedFastaSequenceFile.
*/ */
// FSLockWithShared dictLock = new FSLockWithShared(dictFile,true); FSLockWithShared dictLock = new FSLockWithShared(dictFile,true);
// FSLockWithShared indexLock = new FSLockWithShared(indexFile,true); FSLockWithShared indexLock = new FSLockWithShared(indexFile,true);
// try { try {
// try { try {
// if (!dictLock.sharedLock()) { if (!dictLock.sharedLock()) {
// throw new StingException("Could not open dictionary file because a lock could not be obtained."); throw new StingException("Could not open dictionary file because a lock could not be obtained.");
// } }
// } }
// catch(FileSystemInabilityToLockException ex) { catch(FileSystemInabilityToLockException ex) {
// logger.info(String.format("Unable to create a lock on dictionary file: %s",ex.getMessage())); logger.info(String.format("Unable to create a lock on dictionary file: %s",ex.getMessage()));
// logger.info("Treating existing dictionary file as complete."); logger.info("Treating existing dictionary file as complete.");
// } }
//
// try {
// if (!indexLock.sharedLock()) {
// throw new StingException("Could not open index file because a lock could not be obtained.");
// }
// }
// catch(FileSystemInabilityToLockException ex) {
// logger.info(String.format("Unable to create a lock on index file: %s",ex.getMessage()));
// logger.info("Treating existing index file as complete.");
// }
index = new IndexedFastaSequenceFile(fastaFile); try {
// if (!indexLock.sharedLock()) {
// } throw new StingException("Could not open index file because a lock could not be obtained.");
// catch (Exception e) { }
// throw new StingException(String.format("Error reading fasta file %s.", fastaFile.getAbsolutePath()), e); }
// } catch(FileSystemInabilityToLockException ex) {
// finally { logger.info(String.format("Unable to create a lock on index file: %s",ex.getMessage()));
// dictLock.unlock(); logger.info("Treating existing index file as complete.");
// indexLock.unlock(); }
// }
index = new IndexedFastaSequenceFile(fastaFile);
}
catch (Exception e) {
throw new StingException(String.format("Error reading fasta file %s.", fastaFile.getAbsolutePath()), e);
}
finally {
dictLock.unlock();
indexLock.unlock();
}
} }
/** /**