Package org.sylfra.idea.plugins.revu

Examples of org.sylfra.idea.plugins.revu.RevuFriendlyException


      throws RevuFriendlyException
    {
      DiffProvider diffProvider = RevuVcsUtils.getDiffProvider(project, vFile);
      if (diffProvider == null)
      {
        throw new RevuFriendlyException("Failed to get DiffProvider: " + vFile,
          RevuBundle.message("friendlyError.failedToFetchVcsFile.noVcs.details.text",
          vFile.getPath()));
      }

      AbstractVcs vcs = VcsUtil.getVcsFor(project, vFile);
      assert vcs != null;

      VcsRevisionNumber vcsRevisionNumber;
      try
      {
        vcsRevisionNumber = vcs.parseRevisionNumber(rev);
      }
      catch (VcsException e)
      {
        throw new RevuFriendlyException("Failed to parse VCS revision number: " + rev,
          RevuBundle.message("friendlyError.failedToFetchVcsFile.invalidRevision.details.text",
          vFile.getPath(), rev));
      }

      ContentRevision contentRevision = diffProvider.createFileContent(vcsRevisionNumber, vFile);
      String content = null;
      if (contentRevision != null)
      {
        try
        {
          if (LOGGER.isDebugEnabled())
          {
            LOGGER.debug("Fetching from VCS:" + contentRevision);
          }
          content = contentRevision.getContent();
        }
        catch (VcsException e)
        {
          throw new RevuFriendlyException("Error while retrieving VCS content: " + contentRevision,
            null, RevuBundle.message("friendlyError.failedToFetchVcsFile.vcsError.details.text",
            RevuBundle.message("general.vcsFileAndRev.text", vFile.getPath(), rev), e.getMessage()), e);
        }
      }

      if (content == null)
      {
        throw new RevuFriendlyException("VCS fetched content is null: ",
          RevuBundle.message("friendlyError.failedToFetchVcsFile.nullContent.details.text",
          vFile.getPath(), contentRevision));
      }

      return new VcsVirtualFile(contentRevision.getFile().getPath(), content.getBytes(),
View Full Code Here


      throws RevuFriendlyException
    {
      DiffProvider diffProvider = RevuVcsUtils.getDiffProvider(project, vFile);
      if (diffProvider == null)
      {
        throw new RevuFriendlyException("Failed to get DiffProvider: " + vFile,
          RevuBundle.message("friendlyError.failedToFetchVcsFile.noVcs.details.text",
          vFile.getPath()));
      }

      AbstractVcs vcs = VcsUtil.getVcsFor(project, vFile);
      assert vcs != null;

      VcsRevisionNumber vcsRevisionNumber = vcs.parseRevisionNumber(rev);
      if (vcsRevisionNumber == null)
      {
        throw new RevuFriendlyException("Failed to parse VCS revision number: " + rev,
          RevuBundle.message("friendlyError.failedToFetchVcsFile.invalidRevision.details.text",
          vFile.getPath(), rev));
      }

      ContentRevision contentRevision = diffProvider.createFileContent(vcsRevisionNumber, vFile);
      String content = null;
      if (contentRevision != null)
      {
        try
        {
          if (LOGGER.isDebugEnabled())
          {
            LOGGER.debug("Fetching from VCS:" + contentRevision);
          }
          content = contentRevision.getContent();
        }
        catch (VcsException e)
        {
          throw new RevuFriendlyException("Error while retrieving VCS content: " + contentRevision,
            null, RevuBundle.message("friendlyError.failedToFetchVcsFile.vcsError.details.text",
            RevuBundle.message("general.vcsFileAndRev.text", vFile.getPath(), rev), e.getMessage()), e);
        }
      }

      if (content == null)
      {
        throw new RevuFriendlyException("VCS fetched content is null: "+ contentRevision,
          RevuBundle.message("friendlyError.failedToFetchVcsFile.nullContent.details.text",
          vFile.getPath()));
      }

      return new VcsVirtualFile(contentRevision.getFile().getPath(), content.getBytes(),
View Full Code Here

TOP

Related Classes of org.sylfra.idea.plugins.revu.RevuFriendlyException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.