Skip to content
Snippets Groups Projects
Commit e9d67f0f authored by tjc's avatar tjc
Browse files

catch exceptions in isIndexed()

git-svn-id: svn+ssh://svn.internal.sanger.ac.uk/repos/svn/pathsoft/artemis/trunk@14946 ee4ac58c-ac51-4696-9907-e4b3aa274f04
parent 46a84f41
Branches
Tags
No related merge requests found
......@@ -86,13 +86,20 @@ public class IndexFastaStream extends StreamSequence
*/
public static boolean isIndexed(Entry entry)
{
if( entry instanceof DocumentEntry &&
((DocumentEntry)entry).getDocument() instanceof FileDocument)
try
{
File fasta = ((FileDocument)((DocumentEntry)entry).getDocument()).getFile();
File fastaIndexFile = new File(fasta.getParentFile().getAbsolutePath(), fasta.getName()+".fai");
if(fastaIndexFile.exists())
return true;
if (entry instanceof DocumentEntry
&& ((DocumentEntry) entry).getDocument() instanceof FileDocument)
{
File fasta = ((FileDocument) ((DocumentEntry) entry).getDocument()).getFile();
File fastaIndexFile = new File(fasta.getParentFile().getAbsolutePath(), fasta.getName() + ".fai");
if (fastaIndexFile.exists())
return true;
}
}
catch(Exception e)
{
e.printStackTrace();
}
return false;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment