Java Code Examples for com.intellij.openapi.vcs.FileStatus

The following examples show how to use com.intellij.openapi.vcs.FileStatus. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: azure-devops-intellij   Source File: MultipleItemAction.java    License: MIT License 6 votes vote down vote up
/**
 * This method enables the action if one or more items are selected.
 *
 * @param project
 * @param files
 * @return
 */
protected boolean isEnabled(final Project project, final VirtualFile[] files) {
    if (files.length == 0 || project == null) {
        return false;
    }

    final FileStatusManager fileStatusManager = FileStatusManager.getInstance(project);
    for (VirtualFile file : files) {
        final FileStatus fileStatus = fileStatusManager.getStatus(file);
        if (fileStatus != FileStatus.NOT_CHANGED && fileStatus != FileStatus.MODIFIED && fileStatus != FileStatus.HIJACKED) {
            return false;
        }
    }

    return true;
}
 
Example 2
Source Project: azure-devops-intellij   Source File: TfsFileUtil.java    License: MIT License 6 votes vote down vote up
/**
 * Recursively look for files that have a status UNKNOWN
 *
 * @param files
 * @param fileStatusManager
 * @return
 */
public static boolean findUnknownFiles(final VirtualFile[] files, final FileStatusManager fileStatusManager) {
    for (VirtualFile file : files) {
        // if directory then check children
        if (file.isDirectory()) {
            if (findUnknownFiles(file.getChildren(), fileStatusManager)) {
                return true;
            }
        } else {
            final FileStatus fileStatus = fileStatusManager.getStatus(file);
            if (fileStatus == FileStatus.UNKNOWN) {
                return true;
            }
        }
    }
    return false;
}
 
Example 3
Source Project: consulo   Source File: DefaultInspectionToolPresentation.java    License: Apache License 2.0 6 votes vote down vote up
@Override
@Nonnull
public FileStatus getProblemStatus(@Nonnull final CommonProblemDescriptor descriptor) {
  final GlobalInspectionContextImpl context = getContext();
  if (!isDisposed() && context.getUIOptions().SHOW_DIFF_WITH_PREVIOUS_RUN){
    if (myOldProblemElements != null){
      final Set<CommonProblemDescriptor> allAvailable = new HashSet<CommonProblemDescriptor>();
      for (CommonProblemDescriptor[] descriptors : myOldProblemElements.values()) {
        if (descriptors != null) {
          ContainerUtil.addAll(allAvailable, descriptors);
        }
      }
      final boolean old = containsDescriptor(descriptor, allAvailable);
      final boolean current = containsDescriptor(descriptor, getProblemToElements().keySet());
      return calcStatus(old, current);
    }
  }
  return FileStatus.NOT_CHANGED;
}
 
Example 4
Source Project: consulo   Source File: ChangeListsIndexes.java    License: Apache License 2.0 6 votes vote down vote up
private void addChangeToIdx(final Change change, final VcsKey key) {
  final ContentRevision afterRevision = change.getAfterRevision();
  final ContentRevision beforeRevision = change.getBeforeRevision();
  if (afterRevision != null) {
    add(afterRevision.getFile(), change.getFileStatus(), key, beforeRevision == null ? VcsRevisionNumber.NULL : beforeRevision.getRevisionNumber());
  }
  if (beforeRevision != null) {
    if (afterRevision != null) {
      if (! Comparing.equal(beforeRevision.getFile(), afterRevision.getFile())) {
        add(beforeRevision.getFile(), FileStatus.DELETED, key, beforeRevision.getRevisionNumber());
      }
    } else {
      add(beforeRevision.getFile(), change.getFileStatus(), key, beforeRevision.getRevisionNumber());
    }
  }
}
 
Example 5
Source Project: consulo   Source File: ChangesBrowserLocallyDeletedNode.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public void render(@Nonnull ChangesBrowserNodeRenderer renderer, boolean selected, boolean expanded, boolean hasFocus) {
  // todo would be good to have render code in one place
  FilePath filePath = getUserObject().getPath();
  renderer.appendFileName(filePath.getVirtualFile(), filePath.getName(), FileStatus.NOT_CHANGED.getColor());

  if (renderer.isShowFlatten()) {
    FilePath parentPath = filePath.getParentPath();
    if (parentPath != null) {
      renderer.append(spaceAndThinSpace() + parentPath.getPresentableUrl(), SimpleTextAttributes.GRAYED_ATTRIBUTES);
    }
  }
  else if (getFileCount() != 1 || getDirectoryCount() != 0) {
    appendCount(renderer);
  }

  renderer.setIcon(getIcon());
}
 
Example 6
Source Project: consulo   Source File: Switcher.java    License: Apache License 2.0 6 votes vote down vote up
@Override
protected void customizeCellRenderer(@Nonnull JList<? extends FileInfo> list, FileInfo value, int index, boolean selected, boolean hasFocus) {
  Project project = mySwitcherPanel.project;
  VirtualFile virtualFile = value.getFirst();
  String renderedName = value.getNameForRendering();
  setIcon(VfsIconUtil.getIcon(virtualFile, Iconable.ICON_FLAG_READ_STATUS, project));

  FileStatus fileStatus = FileStatusManager.getInstance(project).getStatus(virtualFile);
  open = FileEditorManager.getInstance(project).isFileOpen(virtualFile);

  boolean hasProblem = WolfTheProblemSolver.getInstance(project).isProblemFile(virtualFile);
  TextAttributes attributes = new TextAttributes(fileStatus.getColor(), null, hasProblem ? JBColor.red : null, EffectType.WAVE_UNDERSCORE, Font.PLAIN);
  append(renderedName, SimpleTextAttributes.fromTextAttributes(attributes));

  // calc color the same way editor tabs do this, i.e. including EPs
  Color color = EditorTabPresentationUtil.getFileBackgroundColor(project, virtualFile);

  if (!selected && color != null) {
    setBackground(color);
  }
  SpeedSearchUtil.applySpeedSearchHighlighting(mySwitcherPanel, this, false, selected);

  IdeDocumentHistoryImpl.appendTimestamp(project, this, virtualFile);
}
 
Example 7
Source Project: consulo   Source File: PluginsTableRenderer.java    License: Apache License 2.0 6 votes vote down vote up
protected void updatePresentation(boolean isSelected, @Nonnull PluginDescriptor pluginNode, TableModel model) {
  final PluginDescriptor installed = PluginManager.getPlugin(myPluginDescriptor.getPluginId());
  if (PluginManagerColumnInfo.isDownloaded(pluginNode) || installed != null && InstalledPluginsTableModel.wasUpdated(installed.getPluginId())) {
    if (!isSelected) {
      myName.setForeground(FileStatus.ADDED.getColor());
    }
  }
  else if (pluginNode instanceof PluginNode && ((PluginNode)pluginNode).getStatus() == PluginNode.STATUS_INSTALLED || installed != null) {
    PluginId pluginId = pluginNode.getPluginId();
    final boolean hasNewerVersion = InstalledPluginsTableModel.hasNewerVersion(pluginId);
    if (hasNewerVersion) {
      if (!isSelected) {
        myName.setForeground(FileStatus.MODIFIED.getColor());
      }
      myStatus.setIcon(AllIcons.Nodes.Pluginobsolete);
    }
  }

  if (isIncompatible(myPluginDescriptor, model)) {
    myPanel.setToolTipText(whyIncompatible(myPluginDescriptor, model));
    if (!isSelected) {
      myName.setForeground(JBColor.RED);
    }
  }
}
 
Example 8
Source Project: consulo   Source File: ReplaceFileConfirmationDialog.java    License: Apache License 2.0 6 votes vote down vote up
public Collection<VirtualFile> collectModifiedFiles(VirtualFile[] files) {

    ArrayList<VirtualFile> result = new ArrayList<VirtualFile>();

    if (files == null) return result;

    for (int i = 0; i < files.length; i++) {
      VirtualFile file = files[i];
      if (myProgressIndicator != null) {
        myProgressIndicator.setText(VcsBundle.message("progress.text.searching.for.modified.files"));
        myProgressIndicator.setText2(file.getPresentableUrl());
      }
      FileStatus status = myFileStatusManager.getStatus(file);
      if (status != FileStatus.NOT_CHANGED) {
        result.add(file);
        if (result.size() > 1) return result;
      }
      result.addAll(collectModifiedFiles(file.getChildren()));
    }
    return result;
  }
 
Example 9
Source Project: consulo   Source File: ShowUpdatedDiffAction.java    License: Apache License 2.0 6 votes vote down vote up
public MyDiffRequestChain(@javax.annotation.Nullable Project project,
                          @Nonnull Iterable<Pair<FilePath, FileStatus>> iterable,
                          @Nonnull Label before,
                          @Nonnull Label after,
                          @javax.annotation.Nullable FilePath filePath) {
  myProject = project;
  myBefore = before;
  myAfter = after;

  int selected = -1;
  for (Pair<FilePath, FileStatus> pair : iterable) {
    if (selected == -1 && pair.first.equals(filePath)) selected = myRequests.size();
    myRequests.add(new MyDiffRequestProducer(pair.first, pair.second));
  }
  if (selected != -1) myIndex = selected;
}
 
Example 10
Source Project: consulo   Source File: LineStatusTrackerManager.java    License: Apache License 2.0 6 votes vote down vote up
private boolean shouldBeInstalled(@javax.annotation.Nullable final VirtualFile virtualFile) {
  if (isDisabled()) return false;

  if (virtualFile == null || virtualFile instanceof LightVirtualFile) return false;
  final FileStatusManager statusManager = FileStatusManager.getInstance(myProject);
  if (statusManager == null) return false;
  if (!myStatusProvider.isSupported(virtualFile)) {
    log("shouldBeInstalled failed: no support found", virtualFile);
    return false;
  }
  final FileStatus status = statusManager.getStatus(virtualFile);
  if (status == FileStatus.NOT_CHANGED || status == FileStatus.ADDED || status == FileStatus.UNKNOWN || status == FileStatus.IGNORED) {
    log("shouldBeInstalled skipped: status=" + status, virtualFile);
    return false;
  }
  return true;
}
 
Example 11
Source Project: consulo   Source File: ShelvedChangeList.java    License: Apache License 2.0 6 votes vote down vote up
public List<ShelvedChange> getChanges(Project project) {
  if (myChanges == null) {
    try {
      myChanges = new ArrayList<>();
      final List<? extends FilePatch> list = ShelveChangesManager.loadPatchesWithoutContent(project, PATH, null);
      for (FilePatch patch : list) {
        FileStatus status;
        if (patch.isNewFile()) {
          status = FileStatus.ADDED;
        }
        else if (patch.isDeletedFile()) {
          status = FileStatus.DELETED;
        }
        else {
          status = FileStatus.MODIFIED;
        }
        myChanges.add(new ShelvedChange(PATH, patch.getBeforeName(), patch.getAfterName(), status));
      }
    }
    catch (Exception e) {
      LOG.error("Failed to parse the file patch: [" + PATH + "]", e);
    }
  }
  return myChanges;
}
 
Example 12
Source Project: consulo   Source File: AbstractCommitChangesAction.java    License: Apache License 2.0 6 votes vote down vote up
@Override
protected void update(final VcsContext vcsContext, final Presentation presentation) {
  super.update(vcsContext, presentation);
  if (presentation.isVisible() && presentation.isEnabled()) {
    final ChangeList[] selectedChangeLists = vcsContext.getSelectedChangeLists();
    final Change[] selectedChanges = vcsContext.getSelectedChanges();
    if (vcsContext.getPlace().equals(ActionPlaces.CHANGES_VIEW_POPUP)) {
      if (selectedChangeLists != null && selectedChangeLists.length > 0) {
        presentation.setEnabled(selectedChangeLists.length == 1);
      }
      else {
        presentation.setEnabled (selectedChanges != null && selectedChanges.length > 0);
      }
    }
    if (presentation.isEnabled() && selectedChanges != null) {
      final ChangeListManager changeListManager = ChangeListManager.getInstance(vcsContext.getProject());
      for(Change c: selectedChanges) {
        if (c.getFileStatus() == FileStatus.HIJACKED && changeListManager.getChangeList(c) == null) {
          presentation.setEnabled(false);
          break;
        }
      }
    }
  }
}
 
Example 13
Source Project: consulo   Source File: ChangeGoToChangePopupAction.java    License: Apache License 2.0 6 votes vote down vote up
@SuppressWarnings("AbstractMethodCallInConstructor")
public Fake(@Nonnull Chain chain, int selection, @Nonnull Consumer<Integer> onSelected) {
  super(chain, onSelected);

  mySelection = selection;

  // we want to show ChangeBrowser-based popup, so have to create some fake changes
  List<? extends DiffRequestProducer> requests = chain.getRequests();

  myChanges = new ArrayList<Change>(requests.size());
  for (int i = 0; i < requests.size(); i++) {
    FilePath path = getFilePath(i);
    FileStatus status = getFileStatus(i);
    FakeContentRevision revision = new FakeContentRevision(path);
    myChanges.add(new Change(revision, revision, status));
  }
}
 
Example 14
Source Project: consulo   Source File: VirtualFileListCellRenderer.java    License: Apache License 2.0 6 votes vote down vote up
protected FileStatus getStatus(Object value, FilePath path) {
  final FileStatus fileStatus;
  if (value instanceof Change) {
    fileStatus = ((Change) value).getFileStatus();
  }
  else {
    final VirtualFile virtualFile = path.getVirtualFile();
    if (virtualFile != null) {
      fileStatus = myFileStatusManager.getStatus(virtualFile);
    }
    else {
      fileStatus = FileStatus.NOT_CHANGED;
    }
  }
  return fileStatus;
}
 
Example 15
Source Project: azure-devops-intellij   Source File: TfsFileUtilTest.java    License: MIT License 5 votes vote down vote up
@Before
public void setUp() {
    MockitoAnnotations.initMocks(this);
    when(virtualDirectory.isDirectory()).thenReturn(true);
    when(virtualFileAdded.isDirectory()).thenReturn(false);
    when(virtualFileUnknown.isDirectory()).thenReturn(false);

    when(fileStatusManager.getStatus(virtualFileAdded)).thenReturn(FileStatus.ADDED);
    when(fileStatusManager.getStatus(virtualFileUnknown)).thenReturn(FileStatus.UNKNOWN);
}
 
Example 16
Source Project: p4ic4idea   Source File: P4Vcs.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Returns true if the specified file path represents a file which exists in the VCS repository (is neither
 * unversioned nor scheduled for addition).
 * This method is called only for directories which are mapped to this VCS in the project configuration.
 *
 * @param path the path to check.
 * @return true if the corresponding file exists in the repository, false otherwise.
 */
@Override
public boolean fileExistsInVcs(FilePath path) {
    // TODO if this ends up being called as we expect, then delete this overridden method.

    final VirtualFile virtualFile = path.getVirtualFile();
    if (virtualFile != null) {
        final FileStatus fileStatus = FileStatusManager.getInstance(myProject).getStatus(virtualFile);
        LOG.info("Checking if file exists in VCS; if so, then it will use the `VcsHandleType` to edit the file.  File: [" + path + "]; status: " + fileStatus);
        return fileStatus != FileStatus.UNKNOWN && fileStatus != FileStatus.ADDED;
    }
    return true;
}
 
Example 17
Source Project: consulo-csharp   Source File: CSharpBaseGroupingRule.java    License: Apache License 2.0 5 votes vote down vote up
@Nullable
@Override
public FileStatus getFileStatus()
{
	T element = myPointer.getElement();
	if(element == null)
	{
		return null;
	}
	return NavigationItemFileStatus.get((NavigationItem) element);
}
 
Example 18
Source Project: idea-gitignore   Source File: IgnoreFileStatusProvider.java    License: MIT License 5 votes vote down vote up
/**
 * Returns the {@link #IGNORED} status if file is ignored or <code>null</code>.
 *
 * @param virtualFile file to check
 * @return {@link #IGNORED} status or <code>null</code>
 */
@Nullable
@Override
public FileStatus getFileStatus(@NotNull VirtualFile virtualFile) {
    return ignoreManager.isFileIgnored(virtualFile) &&
            !ignoreManager.isFileTracked(virtualFile) ? IGNORED : null;
}
 
Example 19
Source Project: consulo   Source File: CoverageListNode.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public FileStatus getFileStatus() {
  final PsiFile containingFile = ApplicationManager.getApplication().runReadAction(new Computable<PsiFile>() {
    @Nullable
    @Override
    public PsiFile compute() {
      Object value = getValue();
      if (value instanceof PsiElement && ((PsiElement)value).isValid()) {
        return ((PsiElement)value).getContainingFile();
      }
      return null;
    }
  });
  return containingFile != null ? myFileStatusManager.getStatus(containingFile.getVirtualFile()) : super.getFileStatus();
}
 
Example 20
Source Project: consulo   Source File: AbstractTreeNode.java    License: Apache License 2.0 5 votes vote down vote up
private void setForcedForeground(@Nonnull PresentationData presentation) {
  final FileStatus status = getFileStatus();
  Color fgColor = getFileStatusColor(status);
  fgColor = fgColor == null ? status.getColor() : fgColor;

  if (valueIsCut()) {
    fgColor = CopyPasteManager.CUT_COLOR;
  }

  if (presentation.getForcedTextForeground() == null) {
    presentation.setForcedTextForeground(fgColor);
  }
}
 
Example 21
Source Project: consulo   Source File: AbstractTreeNode.java    License: Apache License 2.0 5 votes vote down vote up
public Color getFileStatusColor(final FileStatus status) {
  if (FileStatus.NOT_CHANGED.equals(status) && !myProject.isDefault()) {
    final VirtualFile vf = getVirtualFile();
    if (vf != null && vf.isDirectory()) {
      return FileStatusManager.getInstance(myProject).getRecursiveStatus(vf).getColor();
    }
  }
  return status.getColor();
}
 
Example 22
Source Project: consulo   Source File: FileStatusManagerImpl.java    License: Apache License 2.0 5 votes vote down vote up
public FileStatus calcStatus(@Nonnull final VirtualFile virtualFile) {
  for (FileStatusProvider extension : FileStatusProvider.EP_NAME.getExtensionList(myProject)) {
    final FileStatus status = extension.getFileStatus(virtualFile);
    if (status != null) {
      return status;
    }
  }

  if (virtualFile.isInLocalFileSystem() && myFileStatusProvider != null) {
    return myFileStatusProvider.getFileStatus(virtualFile);
  }

  return getDefaultStatus(virtualFile);
}
 
Example 23
Source Project: consulo   Source File: FileStatusManagerImpl.java    License: Apache License 2.0 5 votes vote down vote up
private void cacheChangedFileStatus(final VirtualFile virtualFile, final FileStatus fs) {
  myCachedStatuses.put(virtualFile, fs);
  if (FileStatus.NOT_CHANGED.equals(fs)) {
    final ThreeState parentingStatus = myFileStatusProvider.getNotChangedDirectoryParentingStatus(virtualFile);
    if (ThreeState.YES.equals(parentingStatus)) {
      myWhetherExactlyParentToChanged.put(virtualFile, true);
    }
    else if (ThreeState.UNSURE.equals(parentingStatus)) {
      myWhetherExactlyParentToChanged.put(virtualFile, false);
    }
  }
  else {
    myWhetherExactlyParentToChanged.remove(virtualFile);
  }
}
 
Example 24
Source Project: consulo   Source File: FileStatusManagerImpl.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public FileStatus getStatus(@Nonnull final VirtualFile file) {
  if (file.getFileSystem() instanceof NonPhysicalFileSystem) {
    return FileStatus.SUPPRESSED;  // do not leak light files via cache
  }

  FileStatus status = getCachedStatus(file);
  if (status == null || status == FileStatusNull.INSTANCE) {
    status = calcStatus(file);
    cacheChangedFileStatus(file, status);
  }

  return status;
}
 
Example 25
Source Project: consulo   Source File: NavigationItemFileStatus.java    License: Apache License 2.0 5 votes vote down vote up
private static FileStatus getPsiElementFileStatus(PsiElement psiElement) {
  if (!psiElement.isPhysical()) return FileStatus.NOT_CHANGED;
  PsiFile contFile = psiElement.getContainingFile();
  if (contFile == null) return FileStatus.NOT_CHANGED;
  VirtualFile vFile = contFile.getVirtualFile();
  return vFile != null ? FileStatusManager.getInstance(psiElement.getProject()).getStatus(vFile) : FileStatus.NOT_CHANGED;
}
 
Example 26
Source Project: consulo   Source File: Change.java    License: Apache License 2.0 5 votes vote down vote up
public Change(@Nullable final ContentRevision beforeRevision, @Nullable final ContentRevision afterRevision, @Nullable FileStatus fileStatus) {
  assert beforeRevision != null || afterRevision != null;
  myBeforeRevision = beforeRevision;
  myAfterRevision = afterRevision;
  myFileStatus = fileStatus == null ? convertStatus(beforeRevision, afterRevision) : fileStatus;
  myHash = -1;
  myOtherLayers = new HashMap<String, Change>(0);
}
 
Example 27
Source Project: consulo   Source File: DefaultInspectionToolPresentation.java    License: Apache License 2.0 5 votes vote down vote up
@Nonnull
@Override
public FileStatus getElementStatus(final RefEntity element) {
  final GlobalInspectionContextImpl context = getContext();
  if (!isDisposed() && context.getUIOptions().SHOW_DIFF_WITH_PREVIOUS_RUN){
    if (myOldProblemElements != null){
      final boolean old = RefUtil.contains(element, myOldProblemElements.keySet());
      final boolean current = RefUtil.contains(element, getProblemElements().keySet());
      return calcStatus(old, current);
    }
  }
  return FileStatus.NOT_CHANGED;
}
 
Example 28
Source Project: consulo   Source File: ShowUpdatedDiffAction.java    License: Apache License 2.0 5 votes vote down vote up
@RequiredUIAccess
@Override
public void actionPerformed(@Nonnull AnActionEvent e) {
  final DataContext dc = e.getDataContext();
  if ((!isVisible(dc)) || (!isEnabled(dc))) return;

  final Project project = dc.getData(CommonDataKeys.PROJECT);
  final Iterable<Pair<FilePath, FileStatus>> iterable = e.getRequiredData(VcsDataKeys.UPDATE_VIEW_FILES_ITERABLE);
  final Label before = (Label)e.getRequiredData(VcsDataKeys.LABEL_BEFORE);
  final Label after = (Label)e.getRequiredData(VcsDataKeys.LABEL_AFTER);
  final FilePath selectedUrl = dc.getData(VcsDataKeys.UPDATE_VIEW_SELECTED_PATH);

  MyDiffRequestChain requestChain = new MyDiffRequestChain(project, iterable, before, after, selectedUrl);
  DiffManager.getInstance().showDiff(project, requestChain, DiffDialogHints.FRAME);
}
 
Example 29
Source Project: consulo   Source File: ChangesListView.java    License: Apache License 2.0 5 votes vote down vote up
@javax.annotation.Nullable
private static Change toHijackedChange(@Nonnull Project project, @Nonnull VirtualFile file) {
  VcsCurrentRevisionProxy before = VcsCurrentRevisionProxy.create(file, project);
  if (before != null) {
    ContentRevision afterRevision = new CurrentContentRevision(VcsUtil.getFilePath(file));
    return new Change(before, afterRevision, FileStatus.HIJACKED);
  }
  return null;
}
 
Example 30
Source Project: consulo   Source File: ShowUpdatedDiffAction.java    License: Apache License 2.0 5 votes vote down vote up
@Nonnull
@Override
public DiffRequest process(@Nonnull UserDataHolder context, @Nonnull ProgressIndicator indicator)
        throws DiffRequestProducerException, ProcessCanceledException {
  try {
    DiffContent content1;
    DiffContent content2;

    DiffContentFactoryEx contentFactory = DiffContentFactoryEx.getInstanceEx();

    if (FileStatus.ADDED.equals(myFileStatus)) {
      content1 = contentFactory.createEmpty();
    }
    else {
      byte[] bytes1 = loadContent(myFilePath, myBefore);
      content1 = contentFactory.createFromBytes(myProject, bytes1, myFilePath);
    }

    if (FileStatus.DELETED.equals(myFileStatus)) {
      content2 = contentFactory.createEmpty();
    }
    else {
      byte[] bytes2 = loadContent(myFilePath, myAfter);
      content2 = contentFactory.createFromBytes(myProject, bytes2, myFilePath);
    }

    String title = DiffRequestFactoryImpl.getContentTitle(myFilePath);
    return new SimpleDiffRequest(title, content1, content2, "Before update", "After update");
  }
  catch (IOException e) {
    throw new DiffRequestProducerException("Can't load content", e);
  }
}