Source:
<code><START> public Triple<File, File, File> initializeWorkingDirectoryWithFiles(ToolDescriptor.TypeEnum type) { <END> File workingDir; try { workingDir = Files.createTempDir(); } catch (IllegalStateException ex) { exceptionMessage(ex, "Could not create a temporary working directory.", IO_ERROR); throw new RuntimeException(ex); } out("Created temporary working directory at '" + workingDir.getAbsolutePath() + "'"); File primaryDescriptor; File zipFile; if (!isLocalEntry) { try { primaryDescriptor = abstractEntryClient.downloadTargetEntry(entry, type, true, workingDir); String[] parts = entry.split(":"); String path = parts[0]; String convertedName = path.replaceAll("/", "_") + ".zip"; zipFile = new File(workingDir, convertedName); out("Successfully downloaded files for entry '" + path + "'"); } catch (ApiException ex) { if (abstractEntryClient.getEntryType().toLowerCase().equals("tool")) { exceptionMessage(ex, "The tool entry does not exist. Did you mean to launch a local tool or a workflow?", ENTRY_NOT_FOUND); } else { exceptionMessage(ex, "The workflow entry does not exist. Did you mean to launch a local workflow or a tool?", ENTRY_NOT_FOUND); } throw new RuntimeException(ex); } catch (IOException ex) { exceptionMessage(ex, "Problem downloading and unzipping entry.", IO_ERROR); throw new RuntimeException(ex); } } else { File primaryDescriptorBase = new File(entry); primaryDescriptor = new File(primaryDescriptorBase.getAbsolutePath()); File parentFile = primaryDescriptor.getParentFile(); if (parentFile == null) { errorMessage("Could not find parent directory of primary descriptor", GENERIC_ERROR); } zipFile = zipDirectory(workingDir, parentFile); out("Using local file '" + entry + "' as primary descriptor"); } return new MutableTriple<>(workingDir, primaryDescriptor, zipFile); }</code><technical_language>This is a style/opinion thing, I a class/interface instead of a Triple; hard File is which</technical_language>

Target:
public LauncherFiles initializeWorkingDirectoryWithFiles(ToolDescriptor.TypeEnum type) { File workingDir; try { workingDir = Files.createTempDir(); } catch (IllegalStateException ex) { exceptionMessage(ex, "Could not create a temporary working directory.", IO_ERROR); throw new RuntimeException(ex); } out("Created temporary working directory at '" + workingDir.getAbsolutePath() + "'"); File primaryDescriptor; File zipFile; if (!isLocalEntry) { try { primaryDescriptor = abstractEntryClient.downloadTargetEntry(entry, type, true, workingDir); String[] parts = entry.split(":"); String path = parts[0]; String convertedName = path.replaceAll("/", "_") + ".zip"; zipFile = new File(workingDir, convertedName); out("Successfully downloaded files for entry '" + path + "'"); } catch (ApiException ex) { if (abstractEntryClient.getEntryType().equalsIgnoreCase("tool")) { exceptionMessage(ex, "The tool entry does not exist. Did you mean to launch a local tool or a workflow?", ENTRY_NOT_FOUND); } else { exceptionMessage(ex, "The workflow entry does not exist. Did you mean to launch a local workflow or a tool?", ENTRY_NOT_FOUND); } throw new RuntimeException(ex); } catch (IOException ex) { exceptionMessage(ex, "Problem downloading and unzipping entry.", IO_ERROR); throw new RuntimeException(ex); } } else { File primaryDescriptorBase = new File(entry); primaryDescriptor = new File(primaryDescriptorBase.getAbsolutePath()); File parentFile = primaryDescriptor.getParentFile(); if (parentFile == null) { errorMessage("Could not find parent directory of primary descriptor", GENERIC_ERROR); } zipFile = zipDirectory(workingDir, parentFile); out("Using local file '" + entry + "' as primary descriptor"); } return new LauncherFiles(workingDir, primaryDescriptor, zipFile); }