Skip to content

Commit adb4690

Browse files
committed
Bugfix when remote directory doesnt exist
1 parent 8d48862 commit adb4690

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

SequenceAnalysis/api-src/org/labkey/api/sequenceanalysis/pipeline/AlignerIndexUtil.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import org.labkey.api.data.ConvertHelper;
66
import org.labkey.api.pipeline.PipelineJobException;
77
import org.labkey.api.pipeline.WorkDirectory;
8+
import org.labkey.api.util.FileUtil;
89
import org.labkey.vfs.FileSystemLike;
910

1011
import java.io.File;
@@ -85,20 +86,25 @@ private static boolean verifyOrCreateCachedIndex(PipelineContext ctx, @Nullable
8586
if (wd != null)
8687
{
8788
String val = ctx.getJob().getParameters().get(COPY_LOCALLY);
88-
boolean doCopy = forceCopyLocal || (val == null || ConvertHelper.convert(val, Boolean.class));
89+
boolean doCopy = forceCopyLocal || (val == null || Boolean.TRUE.equals(ConvertHelper.convert(val, Boolean.class)));
8990

9091
if (doCopy)
9192
{
9293
ctx.getLogger().info("copying index files to work location");
93-
File localSharedDir = new File(wd.getDir().toNioPathForRead().toFile(), "Shared");
94-
File destination = new File(localSharedDir, localName);
94+
File localSharedDir = FileUtil.appendName(wd.getDir().toNioPathForRead().toFile(), "Shared");
95+
File destination = FileUtil.appendName(localSharedDir, localName);
9596
ctx.getLogger().debug(destination.getPath());
9697
File[] files = webserverIndexDir.listFiles();
9798
if (files == null)
9899
{
99100
return false;
100101
}
101102

103+
if (!destination.exists())
104+
{
105+
FileUtil.mkdirs(destination);
106+
}
107+
102108
destination = wd.inputFile(FileSystemLike.wrapFile(webserverIndexDir), FileSystemLike.wrapFile(destination), true).toNioPathForRead().toFile();
103109
if (output != null && !destination.equals(webserverIndexDir))
104110
{

0 commit comments

Comments
 (0)