|
27 | 27 | import org.apache.taverna.robundle.manifest.Manifest;
|
28 | 28 | import org.apache.taverna.robundle.manifest.PathMetadata;
|
29 | 29 | import org.apache.taverna.robundle.manifest.Proxy;
|
30 |
| -import org.commonwl.viewer.services.GitHubService; |
31 | 30 | import org.commonwl.view.github.GitHubService;
|
32 | 31 | import org.commonwl.view.github.GithubDetails;
|
33 | 32 | import org.eclipse.egit.github.core.CommitUser;
|
@@ -137,19 +136,6 @@ public Bundle newBundleFromGithub(GithubDetails githubInfo) throws IOException {
|
137 | 136 |
|
138 | 137 | }
|
139 | 138 |
|
140 |
| - /** |
141 |
| - * Save the Research Object bundle to disk |
142 |
| - * @param roBundle The bundle to be saved |
143 |
| - * @return The path to the research object |
144 |
| - * @throws IOException Any errors in saving |
145 |
| - */ |
146 |
| - public Path saveToFile(Bundle roBundle) throws IOException { |
147 |
| - String fileName = "bundle-" + java.util.UUID.randomUUID() + ".zip"; |
148 |
| - Path bundleLocation = Files.createFile(bundleStorage.resolve(fileName)); |
149 |
| - Bundles.closeAndSaveBundle(roBundle, bundleLocation); |
150 |
| - return bundleLocation; |
151 |
| - } |
152 |
| - |
153 | 139 | /**
|
154 | 140 | * Add files to this bundle from a list of Github repository contents
|
155 | 141 | * @param bundle The RO bundle to add files/directories to
|
@@ -207,13 +193,12 @@ private void addFilesToBundle(Bundle bundle, GithubDetails githubInfo,
|
207 | 193 | fileContent = githubService.downloadFile(githubFile, commitSha);
|
208 | 194 |
|
209 | 195 | // Save file to research object bundle
|
210 |
| - Path bundleFilePath = path.resolve(repoContent.getName()); |
211 | 196 | Bundles.setStringValue(bundleFilePath, fileContent);
|
212 | 197 |
|
213 | 198 | // Set retrieved information for this file in the manifest
|
214 | 199 | aggregation = bundle.getManifest().getAggregation(bundleFilePath);
|
215 | 200 | aggregation.setRetrievedFrom(rawURI);
|
216 |
| - aggregation.setRetrievedBy(thisApp); |
| 201 | + aggregation.setRetrievedBy(appAgent); |
217 | 202 | aggregation.setRetrievedOn(aggregation.getCreatedOn());
|
218 | 203 | } else {
|
219 | 204 | logger.info("File " + repoContent.getName() + " is too large to download - " +
|
@@ -279,14 +264,14 @@ private void addFilesToBundle(Bundle bundle, GithubDetails githubInfo,
|
279 | 264 |
|
280 | 265 | /**
|
281 | 266 | * Save the Research Object bundle to disk
|
282 |
| - * @param directory The directory in which the RO will be saved |
| 267 | + * @param roBundle The bundle to be saved |
283 | 268 | * @return The path to the research object
|
284 | 269 | * @throws IOException Any errors in saving
|
285 | 270 | */
|
286 |
| - public Path saveToFile(Path directory) throws IOException { |
| 271 | + public Path saveToFile(Bundle roBundle) throws IOException { |
287 | 272 | String fileName = "bundle-" + java.util.UUID.randomUUID() + ".zip";
|
288 |
| - Path bundleLocation = Files.createFile(directory.resolve(fileName)); |
289 |
| - Bundles.closeAndSaveBundle(bundle, bundleLocation); |
| 273 | + Path bundleLocation = Files.createFile(bundleStorage.resolve(fileName)); |
| 274 | + Bundles.closeAndSaveBundle(roBundle, bundleLocation); |
290 | 275 | return bundleLocation;
|
291 | 276 | }
|
292 | 277 |
|
|
0 commit comments