5757import org .labkey .api .util .FileType ;
5858import org .labkey .api .util .PageFlowUtil ;
5959import org .labkey .ehr .EHRSchema ;
60+ import org .labkey .vfs .FileLike ;
6061
6162import java .io .BufferedReader ;
6263import java .io .File ;
@@ -151,8 +152,8 @@ public RecordedActionSet run() throws PipelineJobException
151152 PipelineJob job = getJob ();
152153 FileAnalysisJobSupport support = (FileAnalysisJobSupport ) job ;
153154
154- processInbreeding (job .getContainer (), job .getUser (), support .getAnalysisDirectoryPath (). toFile (), job .getLogger ());
155- processKinship (job .getContainer (), job .getUser (), support .getAnalysisDirectoryPath (). toFile (), job .getLogger (), job );
155+ processInbreeding (job .getContainer (), job .getUser (), support .getAnalysisDirectoryFileLike (), job .getLogger ());
156+ processKinship (job .getContainer (), job .getUser (), support .getAnalysisDirectoryFileLike (), job .getLogger (), job );
156157
157158 if (GeneticCalculationsJob .isKinshipValidation ())
158159 {
@@ -170,15 +171,15 @@ public RecordedActionSet run() throws PipelineJobException
170171 return new RecordedActionSet (actions );
171172 }
172173
173- public static void standaloneProcessKinshipAndInbreeding (Container c , User u , File pipelineDir , Logger log ) throws PipelineJobException
174+ public static void standaloneProcessKinshipAndInbreeding (Container c , User u , FileLike pipelineDir , Logger log ) throws PipelineJobException
174175 {
175176 processInbreeding (c , u , pipelineDir , log );
176177 processKinship (c , u , pipelineDir , log , null );
177178 }
178179
179- private static void processKinship (Container c , User u , File pipelineDir , Logger log , @ Nullable PipelineJob job ) throws PipelineJobException
180+ private static void processKinship (Container c , User u , FileLike pipelineDir , Logger log , @ Nullable PipelineJob job ) throws PipelineJobException
180181 {
181- File output = new File ( pipelineDir , KINSHIP_FILE );
182+ FileLike output = pipelineDir . resolveChild ( KINSHIP_FILE );
182183 if (!output .exists ())
183184 throw new PipelineJobException ("Unable to find file: " + output .getPath ());
184185
@@ -190,7 +191,7 @@ private static void processKinship(Container c, User u, File pipelineDir, Logger
190191 try
191192 {
192193 try (DbScope .Transaction transaction = ExperimentService .get ().ensureTransaction ();
193- LineNumberReader lnr = new LineNumberReader (Readers .getReader (output )))
194+ LineNumberReader lnr = new LineNumberReader (Readers .getReader (output . openInputStream () )))
194195 {
195196 while (lnr .readLine () != null )
196197 {
@@ -248,7 +249,7 @@ else if (kinshipTable.getSqlDialect().isPostgreSQL())
248249 }
249250
250251 try (DbScope .Transaction transaction = ExperimentService .get ().ensureTransaction ();
251- BufferedReader reader = Readers .getReader (output );
252+ BufferedReader reader = Readers .getReader (output . openInputStream () );
252253 PreparedStatement stmt = transaction .getConnection ().prepareStatement (
253254 "INSERT INTO " + EHRSchema .EHR_SCHEMANAME + ".kinship\n " +
254255 "\t (Id, Id2, coefficient, container, created, createdby, modified, modifiedby)\n " +
@@ -619,9 +620,9 @@ private static TableInfo getRealTable(TableInfo ti)
619620 return null ;
620621 }
621622
622- private static void processInbreeding (Container c , User u , File pipelineDir , Logger log ) throws PipelineJobException
623+ private static void processInbreeding (Container c , User u , FileLike pipelineDir , Logger log ) throws PipelineJobException
623624 {
624- File output = new File ( pipelineDir , INBREEDING_FILE );
625+ FileLike output = pipelineDir . resolveChild ( INBREEDING_FILE );
625626 if (!output .exists ())
626627 throw new PipelineJobException ("Unable to find file: " + output .getPath ());
627628
@@ -636,12 +637,12 @@ private static void processInbreeding(Container c, User u, File pipelineDir, Log
636637 QueryUpdateService qus = ti .getUpdateService ();
637638 qus .setBulkLoad (true );
638639
639- try (BufferedReader reader = Readers .getReader (output ))
640+ try (BufferedReader reader = Readers .getReader (output . openInputStream () ))
640641 {
641642 try (DbScope .Transaction transaction = ExperimentService .get ().ensureTransaction ())
642643 {
643644 log .info ("Inspecting file length: " + output .getPath ());
644- try (LineNumberReader lnr = new LineNumberReader (Readers .getReader (output )))
645+ try (LineNumberReader lnr = new LineNumberReader (Readers .getReader (output . openInputStream () )))
645646 {
646647 while (lnr .readLine () != null )
647648 {
0 commit comments