Package org.eclipse.core.resources

Examples of org.eclipse.core.resources.IStorage


    super(file.getPath());
    this.file = file;
  }

  public IStorage getStorage(IProgressMonitor monitor) throws CoreException {
    return new IStorage() {

      public Object getAdapter(Class adapter) {
        return null;
      }
View Full Code Here


      IFileRevision revision = CompareUtils.getFileRevision(path, commit,
          repo, null);
      if (revision == null)
        return null;

      IStorage storage = revision.getStorage(new NullProgressMonitor());
      BlameOperation op = new BlameOperation(repo, storage, path, commit,
          HandlerUtil.getActiveShell(event), page.getSite().getPage());
      JobUtil.scheduleUserJob(op, UIText.ShowBlameHandler_JobName,
          JobFamilies.BLAME);
    } catch (IOException e) {
View Full Code Here

    when(local.exists()).thenReturn(true);
    when(local.getProject()).thenReturn(project.getProject());
    when(local.getContents()).thenReturn(
        new ByteArrayInputStream(longContent));

    IStorage storage = mock(IStorage.class);
    when(storage.getContents()).thenReturn(
        new ByteArrayInputStream(shortContent));

    IResourceVariant remote = mock(IResourceVariant.class);
    when(remote.isContainer()).thenReturn(false);
    when(remote.getStorage(any(IProgressMonitor.class))).thenReturn(
View Full Code Here

    when(local.exists()).thenReturn(true);
    when(local.getProject()).thenReturn(project.getProject());
    when(local.getContents()).thenReturn(
        new ByteArrayInputStream(localContent));

    IStorage storage = mock(IStorage.class);
    when(storage.getContents()).thenReturn(
        new ByteArrayInputStream(remoteContent));

    IResourceVariant remote = mock(IResourceVariant.class);
    when(remote.isContainer()).thenReturn(false);
    when(remote.getStorage(any(IProgressMonitor.class))).thenReturn(
View Full Code Here

    when(local.exists()).thenReturn(true);
    when(local.getProject()).thenReturn(project.getProject());
    when(local.getContents()).thenReturn(
        new ByteArrayInputStream(localContent));

    IStorage storage = mock(IStorage.class);
    when(storage.getContents()).thenReturn(
        new ByteArrayInputStream(remoteContent));

    IResourceVariant remote = mock(IResourceVariant.class);
    when(remote.isContainer()).thenReturn(false);
    when(remote.getStorage(any(IProgressMonitor.class))).thenReturn(
View Full Code Here

    when(local.exists()).thenReturn(true);
    when(local.getProject()).thenReturn(project.getProject());
    when(local.getContents()).thenReturn(
        new ByteArrayInputStream(localContent));

    IStorage storage = mock(IStorage.class);
    when(storage.getContents()).thenReturn(
        new ByteArrayInputStream(remoteContent));

    IResourceVariant remote = mock(IResourceVariant.class);
    when(remote.isContainer()).thenReturn(false);
    when(remote.getStorage(any(IProgressMonitor.class))).thenReturn(
View Full Code Here

    when(local.exists()).thenReturn(true);
    when(local.getProject()).thenReturn(project.getProject());
    when(local.getContents()).thenReturn(
        new ByteArrayInputStream(localContent));

    IStorage storage = mock(IStorage.class);
    when(storage.getContents()).thenReturn(
        new ByteArrayInputStream(remoteContent));

    IResourceVariant remote = mock(IResourceVariant.class);
    when(remote.isContainer()).thenReturn(false);
    when(remote.getStorage(any(IProgressMonitor.class))).thenReturn(
View Full Code Here

    when(local.exists()).thenReturn(true);
    when(local.getProject()).thenReturn(project.getProject());
    when(local.getContents()).thenReturn(
        new ByteArrayInputStream(localContent));

    IStorage storage = mock(IStorage.class);
    when(storage.getContents()).thenReturn(
        new ByteArrayInputStream(remoteContent));

    IResourceVariant remote = mock(IResourceVariant.class);
    when(remote.isContainer()).thenReturn(false);
    when(remote.getStorage(any(IProgressMonitor.class))).thenReturn(
View Full Code Here

    assertNotNull(provider);
    IFileHistoryProvider fileHistoryProvider = provider.getFileHistoryProvider();
    IFileHistory fileHistory = fileHistoryProvider.getFileHistoryFor(project.getProject().getWorkspace().getRoot().findMember("Project-1/A.txt"), IFileHistoryProvider.SINGLE_LINE_OF_DESCENT, new NullProgressMonitor());
    IFileRevision fileRevision = fileHistory.getFileRevision(GitFileRevision.INDEX);
    assertEquals(GitFileRevision.INDEX, fileRevision.getContentIdentifier());
    IStorage storage = fileRevision.getStorage(null);
    String content = testUtils.slurpAndClose(storage.getContents());
    assertEquals("A.txt - first version\n", content);
  }
View Full Code Here

    assertNotNull(provider);
    IFileHistoryProvider fileHistoryProvider = provider.getFileHistoryProvider();
    IFileHistory fileHistory = fileHistoryProvider.getFileHistoryFor(project.getProject().getWorkspace().getRoot().findMember("Project-1/B.txt"), IFileHistoryProvider.SINGLE_LINE_OF_DESCENT, new NullProgressMonitor());
    IFileRevision fileRevision = fileHistory.getFileRevision(GitFileRevision.INDEX);
    assertEquals(GitFileRevision.INDEX, fileRevision.getContentIdentifier());
    IStorage storage = fileRevision.getStorage(null);
    String content = testUtils.slurpAndClose(storage.getContents());
    assertEquals("B.txt - second version\n", content);
  }
View Full Code Here

TOP

Related Classes of org.eclipse.core.resources.IStorage

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.