Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.ja.smarkdown.location.github;
 
 
 
public class GitHubDocumentProvider extends
		super("github:""");
	}
	protected InputStream getInputStream(final GitHubLocation location,
			final String paththrows FileNotFoundException {
		try {
			final GitHub github = location.open();
			final GHRepository repo = github.getRepository(location
			.info("Using branch={}"location.getBranch());
			final GHBranch branch = repo.getBranches()
					.get(location.getBranch());
			final GHContent content = repo.getFileContent(path,
					branch.getName());
			final String text = content.getContent();
			return new ByteArrayInputStream(text.getBytes());
catch (final FileNotFoundException e) {
			throw e;
catch (final IOException e) {
			throw new FileNotFoundException("Could not loate the file at path "
path + ".  e");
		}
	}
	protected String getRootPath(final GitHubLocation location) {
		final String rootPath = super.getRootPath(location);
		return StringUtils.substringAfter(rootPath":");
	}
New to GrepCode? Check out our FAQ X