Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support building an Either from string when it is type aliased and has an assoc object #32

Open
nh13 opened this issue Jul 1, 2018 · 0 comments

Comments

@nh13
Copy link
Member

nh13 commented Jul 1, 2018

It would be nice if com.fulcrumgenomics.commons.reflect.ReflectionUtil...buildUnitFromString could work with this:

import com.amazonaws.services.s3.AmazonS3URI
import java.nio.file.Path

type PathOrS3Uri = Either[AmazonS3URI, Path]

object PathOrS3Uri {
  def apply(path: String): S3OrPath = {
    if (path.startsWith("s3://")) Left(new AmazonS3URI(path)) else Right(PathUtil.pathTo(path))
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant