class GCPCredentialPathProvider {

  public Path newPath() {
    String credentialProviderPath = security.getCredentialProvider();
    if (isBlank(credentialProviderPath)) {
      return null;
    }
    // The DistributedCache of Hadoop can only link files from their relative path to the working directory
    java.nio.file.Path currentDirectory = Paths.get(System.getProperty("user.dir"));
    java.nio.file.Path pathToCredentialsFile = Paths.get(security.getCredentialProvider());
    if (pathToCredentialsFile.isAbsolute()) {
      java.nio.file.Path pathRelative = currentDirectory.relativize(pathToCredentialsFile);
      return new Path(pathRelative.toString());
    } else {
      return new Path(pathToCredentialsFile.toString());
    }
  }

  @Autowired public  GCPCredentialPathProvider(GCPSecurity security);

}