|
5 | 5 | import org.labkey.api.data.ConvertHelper; |
6 | 6 | import org.labkey.api.pipeline.PipelineJobException; |
7 | 7 | import org.labkey.api.pipeline.WorkDirectory; |
| 8 | +import org.labkey.api.util.FileUtil; |
8 | 9 | import org.labkey.vfs.FileSystemLike; |
9 | 10 |
|
10 | 11 | import java.io.File; |
@@ -85,20 +86,25 @@ private static boolean verifyOrCreateCachedIndex(PipelineContext ctx, @Nullable |
85 | 86 | if (wd != null) |
86 | 87 | { |
87 | 88 | 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))); |
89 | 90 |
|
90 | 91 | if (doCopy) |
91 | 92 | { |
92 | 93 | 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); |
95 | 96 | ctx.getLogger().debug(destination.getPath()); |
96 | 97 | File[] files = webserverIndexDir.listFiles(); |
97 | 98 | if (files == null) |
98 | 99 | { |
99 | 100 | return false; |
100 | 101 | } |
101 | 102 |
|
| 103 | + if (!destination.exists()) |
| 104 | + { |
| 105 | + FileUtil.mkdirs(destination); |
| 106 | + } |
| 107 | + |
102 | 108 | destination = wd.inputFile(FileSystemLike.wrapFile(webserverIndexDir), FileSystemLike.wrapFile(destination), true).toNioPathForRead().toFile(); |
103 | 109 | if (output != null && !destination.equals(webserverIndexDir)) |
104 | 110 | { |
|
0 commit comments