Skip to content

Commit

Permalink
review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
nitin-ebi committed Jul 15, 2024
1 parent f2109d5 commit 6e36bcf
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package uk.ac.ebi.eva.submission.service;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
Expand All @@ -14,6 +16,8 @@
@Service
public class GlobusDirectoryProvisioner {

private final Logger logger = LoggerFactory.getLogger(GlobusDirectoryProvisioner.class);

private final GlobusTokenRefreshService globusTokenRefreshService;

private final RestTemplate restTemplate;
Expand Down Expand Up @@ -59,9 +63,9 @@ private void createDirectory(String directoryToCreate) {

// Check the response status and handle errors if necessary
if (response.getStatusCode().is2xxSuccessful()) {
System.out.printf("Directory '%s' created successfully%n", directoryToCreate);
logger.info("Directory '%s' created successfully%n", directoryToCreate);
} else {
System.out.printf("Failed to create directory '%s': %s", directoryToCreate, response.getStatusCode());
logger.error("Failed to create directory '%s': %s", directoryToCreate, response.getStatusCode());
}
}

Expand All @@ -83,10 +87,10 @@ public String listSubmittedFiles(String submissionDirPath) {
ResponseEntity<String> response = restTemplate.exchange(transferApiUrl, HttpMethod.GET, requestEntity, String.class);

if (response.getStatusCode().is2xxSuccessful()) {
System.out.printf("Directory %s listed successfully%n", submissionDirPath);
logger.info("Directory %s listed successfully%n", submissionDirPath);
return response.getBody();
} else {
System.out.printf("Failed to retrieve directory '%s': %s", submissionDirPath, response.getStatusCode());
logger.error("Failed to retrieve directory '%s': %s", submissionDirPath, response.getStatusCode());
return "";
}
}
Expand Down

0 comments on commit 6e36bcf

Please sign in to comment.