use of com.intellij.testFramework.BinaryLightVirtualFile in project intellij-community by JetBrains.
the class DiffContentFactoryImpl method createBinaryImpl.
@NotNull
private static DiffContent createBinaryImpl(@Nullable Project project, @NotNull byte[] content, @NotNull FileType type, @NotNull String fileName, @Nullable VirtualFile highlightFile) throws IOException {
// workaround - our JarFileSystem and decompilers can't process non-local files
boolean useTemporalFile = type instanceof ArchiveFileType || BinaryFileTypeDecompilers.INSTANCE.forFileType(type) != null;
VirtualFile file;
if (useTemporalFile) {
file = createTemporalFile(project, "tmp", fileName, content);
} else {
file = new BinaryLightVirtualFile(fileName, type, content);
file.setWritable(false);
}
return new FileContentImpl(project, file, highlightFile);
}
Aggregations